lennaert's Forum Posts

  • Is the synced objects angle also synced ?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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 .

  • **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.

  • Is the textbox big enough for the reply ?

    Also, you can hit F12 or CTRL+SHIFT+J for the console, and perhaps check the network tab, and filter for your url,

    If you then click on your url in that pane you get a few tabs with your request with information regarding headers and reply.

  • I see you use single qoutes in the url, those will not work.

    make sure the results of your data url looks like something as:

    site.com?option=something&scale=1

    and not like

    site.com?option='something'&scale='1'

    Just remove the single qoutes stuff

    Also, it might be a good idea to give your request a tag, and use that tag with the on completed trigger too.

  • >

    >

    > Why not ?

    >

    > Socket.io is far more susceptible to lag and packet sniffers.

    >

    for packet sniffers you can sync things and make sure data will received

    but multiplayer plugin problems are :

    - some modem configures can not connect to it

    - all browser dont support it or dont support it well

    - when a user get disconnected (for net problems) it not reconnect to same room fast and we can reconnect it but it takes a lot of time for : connect to signalling > loggin > go to room > connect !

    it really not a good tool for big games because with socket.io you have control of everything and when a user get disconnect you can reconnect it fast

    multiplayer plugin just desing for small games . you can just play scirra ghost shooter demo wich you can not play it for more then 20m because game will end if you have a small connection problem !

    Yup, most of of the above stands, but you can narrow down lots of issues with decent implementation plans.

    -Connections over routers/modems: Use dedicated signalling and ice servers for optimum results.

    -It is true, WebRTC is not widely supported yet, but it is quickly getting there.

    -I would guess any game loosing its signal to the host requires a form of logging in again. with a good fallback plan, one could easily come back to the game. If you have been playing for some time, you would not mind having to wait 10 or 30 seconds before being able to play again (assuming the connection loss was an oddity)

    -Game size: this is just a matter of design. If you plan on making a map with dozens of players real time playing, then you can expect problems with bandwidth consumption. To add, fiber connections are becoming more and more popular in home based situations, greatly reducing the issue.

    If you compartmentalize your gaming map, you can easily make a huge multiplayer game. Just be careful what gets synced, and if a certain amount of users could exceed decent bandwidth usage, then limit the max amount of players.

    Then, combine the construct 2 multiplayer with Ajax and a php/mysql backend, then you can do nearly anything most mmo's are capable.