How do I Sync object destroy (multiplayer)

Get help using Construct 2

Post » Fri Jul 10, 2015 3:04 pm

Hi there, sorry for my bad English, but please help me! :)

I read all the topics on forum about sync object, but I didn't understand and I can't do what I want.

I'm creating a multiplayer shoot game like the tutorial made by Ashley, but with a difference: this game got two teams, like a deathmatch. So, I've two different peers, teamblu and teamred and right now works all fine, except to destroy the peer killed.

As you can see in the image below, I put a condition to destroy the peer when health is under or egual to 0:

Image

If I put this in the host group, the peer is destroyed for host and after circa 3 seconds will be destroyed for peer too.
If I put this in the peer group, the peer will be destroyed for peer only..

The hit method for bullet is similar, but works fine, so I think this depends on variable health

Can anyone help me? I've tryed several solution, but without any result. Thanks!
B
17
S
5
G
3
Posts: 76
Reputation: 2,948

Post » Fri Jul 10, 2015 3:09 pm

Generally, a synched object needs to be destroyed on the host end, which gets reflected on the peer end a moment later.

To smooth-en this a bit, I always use some logic to synch the health as on the host to the peers, and on the peer end, when the health would be gone, set the object invisible. (or other effect related to death) During its invisible moment it should get destroyed.

Its actually some nifty camouflage for the lag time difference.
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,572

Post » Fri Jul 10, 2015 3:36 pm

Oh thanks. Invisible on health under 0 seems good. I will work on this, I hope is the right solution! Thanks!
B
17
S
5
G
3
Posts: 76
Reputation: 2,948


Return to How do I....?

Who is online

Users browsing this forum: Christmas, Colludium, irina, minigame and 7 guests