Bug Tile movement and multiplayer

Not favoritedFavorited Favorited 0 favourites
  • 11 posts
From the Asset Store
Each tile 64 by 64 pixels - Ultimate Tile Set for your awesome games
  • As the title suggests, I believe we have a bug when using tile-movement and multiplayer.

    I followed both the multiplayer tutorial using the 8-way behavior and the car behavior to the letter. But I can't get the same behavior when moving on the grid.

    This project is from 2020 when I faced the bug and abandoned construct 3 exactly because of that.

    Now 5 years later I've come back and I still encounter the same problem. Check out c3p and also the example video in my other post. Do we have a known limitation here or am I just doing things wrong?

    construct.net/en/forum/construct-3/general-discussion-7/multiplayer-lot-delay-151017

  • Multiplayer doesn’t care which movement behavior you’re using — it simply transmits data between two computers. The issue is likely that you’re sending Player.controle continuously. Instead, you should send it once per tile movement.

    For example, when the D key is down and the player moves from tile 1 to tile 2, you should send a single 'move right' command. If you send it multiple times, network latency might cause the peer to move more than one tile unintentionally.

    Another option is to send the target position. So when the player moves from tile (0,1) to (0,2), you transmit the coordinates of the target tile - (0,2)

  • Multiplayer doesn’t care which movement behavior you’re using — it simply transmits data between two computers. The issue is likely that you’re sending Player.controle continuously. Instead, you should send it once per tile movement.

    For example, when the D key is down and the player moves from tile 1 to tile 2, you should send a single 'move right' command. If you send it multiple times, network latency might cause the peer to move more than one tile unintentionally.

    Another option is to send the target position. So when the player moves from tile (0,1) to (0,2), you transmit the coordinates of the target tile - (0,2)

    Hello, thanks for the reply!

    Is what you say an assumption or have you seen my project?

    I don't think I'm doing this, but I could be wrong. Please point out where this is happening

    drive.google.com/file/d/11jWl4KGl1z3BS_b2t1h52e9xxYwByFsu/view

    Thx

  • Yes, I've seen your project.

  • In fact, when you press the key once, the action is executed several times. I tested this with a click counter.

    I also tried to limit it in some way,

    using activate only once when true ❌

    set time ❌

    what do you suggest?

  • In fact, when you press the key once, the action is executed several times. I tested this with a click counter.

    Yes, and that's why it doesn't work - see my initial comment. You need to send the control bit once per tile movement.

    Or send the coordinates of the target tile, and on the peer side move the character to that tile.

  • Thanks for the way, but I still have no idea how to do this. In the image I sent above, I should separate the submit buttons and try something with some variable that would store the previous one. I really don't know what to imagine and what actions to use.

  • As a quick fix you can try adding "Player is NOT moving" condition to events 12 and 30.

    By the way, you also need to delete duplicate events 40-43

  • As a quick fix you can try adding "Player is NOT moving" condition to events 12 and 30.

    Actually, no, that probably won't work.

    Try this version:

    dropbox.com/scl/fi/adxkzi2ya5c62rkgm7uhj/LabirintoEscuroOnline2.c3p

  • Thanks, interesting.

    The peer is started at the beginning of the grid (I also changed the variables to 1.1 ❌). I adjusted the maze. But the peer is no longer moving when pressing keys. I tried to change some actions, but it still doesn't move, I'll keep trying. Why -9999?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Why -9999?

    Just to distinguish from any real value.

    My example doesn't work properly. I haven't used multiplayer plugin for a very long time, so I can't tell you the exact steps to fix it.

    Looking at the official Multiplayer Pong example, you can probably sync player position, without transmitting any controls.

Jump to:
Active Users
There are 0 visitors browsing this topic (0 users and 0 guests)