0 Favourites

Multiplayer template

  • if I understood well

    But this not working for me and others

  • delgado

    I don't have a capx. Use the Real-time Multiplayer example from C2

    Also from you're image you're giving them actions locally, but not telling the host what you're doing

    What you need to do is send a variable to the host that when the host receives the variable and then does the same action base on what variable it receives and transmits that action to the other peers. The example has this already coded into it.

  • Thndr i build game based on real time multiplayer tamplate.

    Im going great but (prabably its simple but not for me) i cant figure out how other playerA can see projectile spawned by PlayerB and when PlayerA destroy for example solid wall on Player B screen this same wall is still there.

    Weird dont you think?

    CAPX if needed https://dl.dropboxusercontent.com/u/44710358/dbon.capx

  • You need to either sync the object (see the stuff in the Signaling group for example) or use some form of messaging (Broadcast Message in the Multiplayer object) to tell the peers what is happening so they can do it locally.

    For example if you make kiblast a synced object (Position and Angle) then when you spawn a new one on the host it will spawn them on the peer clients as well.

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • delgado

    I'm not at my C2 computer often during the week so I won't be able to look at it, but all the information you need to know is in the Real-Time Multiplayer example. Just look at the events and see how it sends input to the host.

    If you see on the PEER object that it has a variable called "inputs" that is synced, and when the Not-Host pushes a button, it moves it locally AND sends that input to the host. That input is read by the host and makes your character move on his end. Since you're playing the same game it syncs up fine 90% of the time.

    The left click action spawns lasers and such so that would be the best way to figure out how to make them see it, and you can use the same information to see how it processes being hit. Since it's basic it revolves around the PEER object so it won't give the most optimal way to handle secondary objects like the wall being destroyed, but it's all the same system so you can just make the wall sync or receive a message to be destroyed.

    My first assumption I'd treat it like how player-damage is treated from the laser, but there might be a method that uses less bandwidth (unless sync only sends data when it changes, then it'd probably be pretty sweet)

  • mzo i do something like that:

    Its the right way?

  • Thndr obout projectiles i do something like that:

    But only HOST see projectiles of other players, other joined players see only self projectiles

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic
152 19,232
Magistross's avatar
Magistross
Unread hot topic
224 49,520
ThePhotons's avatar
ThePhotons
Unread hot topic
190 41,423
juantar's avatar
juantar