Junnior's Forum Posts

  • 4 posts
  • Did you apply local input prediction to objects on the peer side?

    Local input prediction is something I tried but I don't know if I did it correctly and in an optimized way. However, in this case, the disc accessories (which are offline, it's worth noting) are following the player disc when in fact it is already far ahead. It lags behind and it's hard to understand what's going on.

  • First of all, I apologize to everyone for my poor English.

    I'm experiencing serious lag issues in my multiplayer game, which uses the Construct 3 Multiplayer Plugin with peer-to-peer (P2P) architecture. The game is similar to Haxball, where the synchronization needs to be precise to keep the gameplay fluid. However, players are reporting that the lag is making the game almost unplayable, even in situations where latency should be acceptable.

    Currently, the plugin's default clientDelay is 80ms, but I've noticed that this value causes noticeable delay in inputs and object synchronization. I've made a few changes to try to solve the problem:

    - I reduced the clientDelay to 20ms. This has brought some improvement, but the lag still persists, especially on networks with an average ping above 50ms.

    - I also increased the packets per second (pps) rate from 30pps to 24pps, which helped reduce data traffic, but had minimal impact on lag.

    - I considered increasing it to 60pps. However, since the game is running relatively well at 24pps, I believe the problem may be more related to state extrapolation and correction than just the sending frequency.

    In my game, I only sync the following information:

    - Players: Position, skin, pass state (0-1), shot state (0-1), velX and velY (ranging from -220 to 220).

    - Ball: Position only.

    - Game status (propsmatch): Game control information (pretty much static).

    Still, the lag doesn't decrease to a playable level. Ideally, the delay between player action and game response should be between 30-80ms, but I can't achieve this consistently.

    Another serious issue I'm facing is object persistence when switching rooms. When a player leaves a room and enters another, the objects are not reset correctly. This causes:

    The settings from the last room to remain active.

    Objects to get "stuck" in their old states, which affects the new game.

    For example:

    - Synchronized players and objects do not appear (they become invisible)

    Apparently, the layout is not resetting as it should, and this has become a critical issue for maintaining a consistent experience.

    I'm open to suggestions on how to tweak the plugin's parameters or even modify the initialization logic to fix the issues. If games like Haxball can handle lag and maintain a playable experience, I believe I can achieve a similar result in my project as well.

  • Hi, I'm Junnior.

    I am developing a multiplayer soccer game where each player moves their player in the match. When touching the ball, the ball starts to be in front of the player who has it dominated. I feel that the game itself, the mechanics, are perfect (or almost), however, the game does not have an efficient lag compensator, that's where the problem comes in.

    Due to the delay of the host to deliver the information and receive, the player who is the ball can see himself away from his opponent, but suddenly he disarms him and takes the ball. The reason? For the host, the player was a few steps behind and, therefore, the opponent managed to steal the ball because, in the view of the host, he managed to reach the ball.

    I've seen many tutorials in the construct about realtime lag compensator, however, none of them were very efficient with the football I created. I do not accept responses saying that WebRTC is not the best way to create because, haxball runs its multiplayer with this same API and is very functional.

    I await answers, I hope you can give me ideas to improve this lag in my game.

    Translated by Google Translate (Portuguese for English)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi, I'm Junnior, I'm Brazilian and I've been using Construct (specifically 2) for some time.

    Recently, I studied and created a game using the standard multiplayer Plug-In from construct 2. The game is football, everyone moves their player, and the game is very good, but this is not entirely the case.

    I've been wondering if, it is possible to make a game version for the host where, the host will only transmit variables, locations and arrays, and will not see anything more than a "console" (formed by texts and textboxes).

    Thus, transmitting only location information, players, and everything needed, customers would view the game using the information that the host will pass on.

    The clients (or peers) would create objects, movements on the screen, according to what the host will send to them.

    Remember that all this using the multiplayer plug-in.

    Because I thought about it: The complexity of my game makes it very heavy, sometimes the connection is good, the ping is great, but the computer is processing the game slowly and because of that, the peer feels the host's locks on the game.

    I'm thinking of creating a system with this concept, what do you think?

    Add information, give me information, so we can create ways to make a multiplayer game better in the construct.

    Translated from Portuguese to English by Google.

  • 4 posts