Help with multiplayer game - turret not sync in host/peer

  • I am making this multiplayer game demo to learn how to program for multiplayer.

    The problem I am having is with the Turret on the tank. If I set the initial turret tacking so the turret is locked forward it works fine in both host and peer modes. If I set the initial turret tacking so the turret has mouse movement it works fine in both host and peer modes. But once I try to change that mode in game the problem starts. It works right on the computer you made the change on but all other computer don't show the change.Does not matter if you are the host or a peer.

    The Instance variable I use is "TurretTracking" in the PeerTank Object. I use "[" for the turret is locked forward and "]" to have mouse movement for the turret. As I said above you can change this variable in the PeerTank Object and it works right. But once the game is running and you try to change the turret mode you run into the problem.

    were I have the code to change the turret mode is in the game events in the common group.

    I have upload my project cap for you to look at.

    Thanks so much for any help you can give.

  • Have you tried to put lines 78-80 under one "System: For each PeerTank" condition, like in attachment?

    Cannot test the multiplayer, but It could be the problem of more than one tank of same type.

  • razorMonkey I gave that a try but did not help

  • You have to pass the input from the peer to the host so the host can handle the tracking condition. All I did was add new inputs to the peer and host group to handle the [ and ] presses. So it passes the info to the host on client update.

  • Thanks thatserafimkid, the Peer is working right now. when you change modes it shows up right on both the host and peer computers. but the host is working on the host computer but still not changing on the peer computers.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • thatserafimkid, I found the last bit of the problem. In the host group under the turret tracking 2 subgroup you needed to set the inputs like you do when you fire the laser and let the common group update it for both the host and peer computer.

    thanks again thatserafimkid for showing me that I needed to have more inputs commands.

    I am just learning the multiplayer programing and there is a big learning curve to the logic to it.

    here is a updated cap with my fix

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