lennaert's Recent Forum Activity

  • Is the synced objects angle also synced ?

  • You could go into the console Ctrl + Shift J or F12 and check the network tab. Here you should be able to see failing connections.

  • First problem, tell the host to give up host position, and be sure your the first to connect after that. You could do that with commands to all other peers like, leave and wait x seconds before reconnecting, where you connect first.

    To use multiple tabs of the same browser instance, use incognito modus in Chrome, you can open these with CTRL + Shift + N

  • You should be relying on the "On error" condition to determine that an error has occurred, only using the ErrorMessage expression to get a description of the error.

    true, thanks for that

  • In the multiplayer plugin, we have the "Multiplayer.ErrorMessage".

    Works nice as soon as you get an error. But it looks like it remains having that error in the expression after having displayed it.

    Checking if there is an error, there is always an error after having received this one "already in a room".

    Scenario:

    If I have this expression displaying in a textbox, it keeps showing the error "already in a room" while the error is no longer being generated.

    The following would be nice:

    After having used the expression: Multiplayer.ErrorMessage , clear the error message from the object.

    So a next call to "Multiplayer.ErrorMessage" gives you a false response, no new errors.

    edit:

    An action to clear error could be wiser perhaps, as there are likely people displaying the error message every tick .

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • **snippet from another post**

    Host wants to move

    The host simply moves his object and its movement is synched in a broadcasting like method, telling all the peers where the host object needs to go.

    Peers wants to move

    In most synched scenarios, the peer needs to tell the host where it wants to move, the host then move the object on the host game, and it broadcasts it to all the peers, including the peer wanting to move.

    Peer forced moving:

    When the peer wants to optimize the positioning of its object; while sending the movement to the host, the peer can also move its synched object in the direction it has told the host it wanted to move. This forces it in a direction, closer to the next synched position the peer will receive for its own movement, potentially increasing more smoothness on the moving.

    Check the forced moving bit.

    also, keep synching to a minimum. The less you synch, the less overhead, the less chance of lag / line congestion.

  • Hah, no worries

    Looking at what you want, it seems you would be better off using a one time action instead of a continuous sync of state.

    Something like

    -host:

    event

    On button press select class

    action

    set animation class

    broad cast message 'classinfo' : MyId &"|"&class

    -peer

    event

    On button press select class

    action

    set animation class

    send message to host 'classinfo' : MyId &"|"&class

    -common

    event

    on peer message 'classinfo'

    pick all peer

    pick peer by evaluating peer.peerid = tokenat(Multiplayer.Message, 0,"|")

    action

    set peer animation = tokenat(Multiplayer.Message, 1,"|")

    sub is host // if host receives, broadcasts to the rest

    action broad cast message 'classinfo' : multiplayer.message

  • Do you have a none multiplayer model working with displaying the correct animations ?

    If so, post a capx or explain the mechanics, and I'll try to assist

  • Ah, yes, then it will not be possible right from the bat.

    The work around:

    Use pode's html Iframe plugin, and add the iframe to your project.

    Whenever you need to load the info from that URL, load it through the url of the iframe.

    either use the iframe as a results box, or, grab the content from the iframe after loading and place it where needed.

  • Add this to the top of your PHP file:

    header('Access-Control-Allow-Origin: *');

  • The trigger event needs some kind of reference to the object your trying to manipulate.

    In lots of cases, developers continually or periodically loop through the involved object, for each.

    for instance,

    event

    for each enemy

    compare 2 values: distance(enemy.x,enemy.y,player.x,player.y) < 100

    action

    enemy move towards player

    Here, because the for each determines one of the looped objects potentially being closer to the player then 100 pixels, then uses that object, which is automatically referenced due to the loop, and performs the desired action.

    In other cases, a reference could be an overlaps/collision

    event

    enemy is overlapping/is colliding with player

    action

    enemy do something

    Here the reference is determined by the overlapping/collision event

    without such a reference, construct 2 will interpret an action such as:

    event

    Every 3 second

    action

    enemy move left

    like you are referencing ALL enemies, as there is no reference to an instance.

    Same goes for:

    event

    on start of layout

    action

    destroy enemy

    which will destroy all enemies on the layout

  • event:

    on peer disconnect

    compare 2 values: multiplayer.peerid = multiplayer.hostid

    action:

    set Group "Peer" inactive

    disconnect from room

    event:

    on player leave room

    action

    autojoin room

    event:

    on join room

    sub is host: set group "Host " active

    sub else set group "Peer" active

    This lets you reconnect, but, it will depend how you setup your objects and syncing and game mechanism if it can just pick off where it left.

    If you have a situation where by the host intial objects are set with certain behaviors or stats, be sure to set them again when the peer becomes host. In various scenario's, your objects can become the new "host" version if you apply it right.

lennaert's avatar

lennaert

Early Adopter

Member since 8 Oct, 2013

Twitter
lennaert has 13 followers

Connect with lennaert

Trophy Case

  • 11-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • x5
    Popular Game One of your games has over 1,000 players
  • Famous Game One of your games has over 10,000 players
  • x2
    Coach One of your tutorials has over 1,000 readers
  • Educator One of your tutorials has over 10,000 readers
  • Regular Visitor Visited Construct.net 7 days in a row
  • Steady Visitor Visited Construct.net 30 days in a row
  • Enduring Visitor Visited Construct.net 90 days in a row
  • RTFM Read the fabulous manual
  • x2
    Great Comment One of your comments gets 3 upvotes
  • Delicious Comment One of your comments gets 10 upvotes
  • Email Verified

Progress

25/44
How to earn trophies