How do I sync multiplayer sprites, events and other issues?

0 favourites
  • 2 posts
From the Asset Store
14 amazing sound files of game events like Level Ups, Level Completes, object spawn, object taking etc.
  • Hi guys,

    I'm trying to implement multiplayer into my game (SHMUP) and gotten it to work somehow . I have tried with 2 devices and they are able to connect and player sprites do appears on both devices.

    But i have some issues:

    1) On both devices, the enemies on screen are not sync-ed, both devices shows different placement of enemies and status of enemies. How do i make sure that both devices sees the same amount of enemies and enemies types on screen?

    2) On player (PEER) the controls are very unstable, the ship jerks around and when the host plays the games, the peer ships tries to follow the host ships around too, its like you are fighting to control the ship with the Host on the Peer side of game play. My controls are very simple it's just dragging the ship around the screen and it fires by itself.

    3) How do i implement a "searching for player feature" then follow by "start game when all players are connected"? I would like this in my game so that the level starts at the same time for all players in my game. Right now it's host joins first then Peer join but the level would have already started by the time Peer joins in.

    I tried to follow the example capx multiplayer file from C2 itself and i think regarding the controls for Peer the issue comes about me maybe not understanding how it works. Below is the event screenshot:

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • To 1 and 2 I can't answer because don't know exactly what's hapening. Seeing the screenshot you posted I assume you are "cloning" the Ghost Shooter multiplayer example that comes with Construct.

    If so, the only thing I could advice to you is to check the Sync statements on the Signalling section and look if all variables controlling ship movement are synched. And if so, perhaps change his mode of "Interpolation" to see if that resolves the placement problems you are experiencing.

    In the multiplayer games I'm developing I'm using a mechanism to synchronize some Arrays with data about each player between all peers and host (cards each one has in hand, cards played, ...). But position of sprites is left to the Multiplayer plugin and his synchronization mechanism.

    About point 3, in the games I'm developing I put a screen in the "host" that shows "peers" as they are being connected. And a button to "Start game!" when the host sees all the "peers" are already connected. The host is not a player, is something like a "game-master", controlling the other players, maintaing synchronized all the underlying data, ... He has controlls to modify the state of the game and also to "kill" the game if he decides to do so.

    Also, on top of this, there is a mechanism implemented to control the reconnection of a "peer" in case it disconnects in the middle of a game, saving his state in case of disconnection and restoring it whenever the peer connects again. Only connections of peers previously connected are allowed. We check it using the "nickname" introduced on first connection. Not the most efficient mechanism but it works for our needs.

    Don't know if I have given you the directions you need to implement point 3. It's tricky because the Multiplayer model of Construct, but doable.

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