How do I Destroy Objects, Multiplayer

Get help using Construct 2

Post » Fri Sep 12, 2014 8:43 am

DuckfaceNinja wrote:So far I think sync instance variable probably only useful to change the object state (done by host) to "sync" animation or conditional highlighting for exclusive peer only.

As far as object creation and destroy is concerned, I still think it is the best to go with host, because you can minimize communication requirement from peer relay style to one-way authority style.


Value your input, and I agree. The sync instance variable doesn't perform as expected(at least how I would expect it to).
You think you can do these things, but you can't, Nemo!
Just keep reading.
Just keep learning.
B
65
S
16
G
9
Posts: 1,429
Reputation: 12,718

Post » Mon Sep 22, 2014 4:19 pm

I have problem long time ago wit similiar problem, thats why im not working on multiplayer, its really confusing even if i work on c2 two years.
i got this same problem, i use sync to all my blocks BUT in my game on start of layout system create 5 random position blocks. Result is... on host side is diferent positions than on peer side. Any ideas how fix this?

@Ashley please add to existed example of multiplayer shooter few blocks to destroy because answer for this problem is missing on forum
That will be great
B
113
S
28
G
48
Posts: 1,882
Reputation: 36,478

Post » Mon Sep 22, 2014 5:09 pm

I'm late to this thread, but it should be really simple. Use 'Sync object' to sync the blocks, and then destroy them on the host. When synced objects are destroyed on the host, the syncing automatically destroys them on all of the peers as well. So you don't even need to send any special messages or have any special flags.
Scirra Founder
B
402
S
238
G
89
Posts: 24,613
Reputation: 195,993

Post » Thu Sep 25, 2014 10:06 am

@Ashley I use on start of layout-> sync object, every tick- > sync object. I add this action on under 'Peer' 'Host' and 'common' group and if projectile collide on block this also dont work

I think we need more multiplayer examples with included, hp bars, destroying entities, switch weapons, more examples or one example updates.
Its really diferent and confusing when make simpliest multiplayer game.
Conventional ways of creating games do not work .
I feel like three years ago when I first used the Construct 2 im greenhorn
B
113
S
28
G
48
Posts: 1,882
Reputation: 36,478

Post » Thu Sep 25, 2014 11:20 am

delgado wrote:every tick- > sync object

I don't think you should use it like this, it supposed to be trigger once, right?
delgado wrote:I think we need more multiplayer examples with included, hp bars, destroying entities, switch weapons, more examples or one example updates.

HP bars
Keep data on host, only sync instance variable for display.

Destroying entity
This should be covered by host.

Switch weapon
Peer send a message (reliable), host receive it then process/update to all peers -or- change the instance variable so all peers have updated visual. mechanic wise as in the damage amount done by certain weapon is still best covered/calculated by host.

@Ashley If I were to suggest a new official example, I would say a turn based game (bingo or tictactoe) or something like rock-paper-scissor. This is to emphasize correct use of send message and broadcast message which I think most people disregard it's awesomeness.
Note: Beginners really hooked to sync object, and thinks it's the only way to sync things, based on my observation of question thrown out before.

I don't know what is the philosophy of other people use for multiplayer, but my philosophy is , host=calculator, peer=visual update only. If the host is player then host=calculator/visual update.

Maybe the only MP beginner tips that I can give is do not calculate anything on peer.

delgado wrote:Its really diferent and confusing when make simpliest multiplayer game.

The pong example is a great example of how a small [2-5 event] game will turn out if MP implemented. It's that kind of "**upscaling**".
Last edited by DuckfaceNinja on Thu Sep 25, 2014 11:35 am, edited 1 time in total.
B
28
S
8
G
4
Posts: 553
Reputation: 4,924

Post » Thu Sep 25, 2014 11:28 am

@DuckfaceNinja
You sound like you have a well established multiplayer, do you know how create walls/blocks randomly on the map when you start the game?

"do not calculate anything on peer." i got it!
B
113
S
28
G
48
Posts: 1,882
Reputation: 36,478

Post » Thu Sep 25, 2014 11:46 am

delgado wrote:@DuckfaceNinja
You sound like you have a well established multiplayer

Nothing that is complete, for now. :?
Tried RPG, bloody hell difficult, then I stopped. Then I tried my dream game to make, a CCG, which I learnt the importance of understanding the send message and how to fully exploit it. I would say send message is the core functionality in any mid-high scale game. I'm using it like 80% of my MP function in my CCG currently.
If I decide to go back to the RPG, I don't see myself having the same problem as before, except that it's better to start from scratch for that lol.
delgado wrote: how do you know that the walls were arranged randomly on the map when you start the game?

Mind elaborate? I don't get the question.
B
28
S
8
G
4
Posts: 553
Reputation: 4,924

Post » Thu Sep 25, 2014 12:22 pm

@DuckfaceNinja sorry its only english translator ;/ I want to create on start of layout few randomly generated sprites (wallblock) on game layout.
B
113
S
28
G
48
Posts: 1,882
Reputation: 36,478

Post » Thu Sep 25, 2014 12:44 pm

delgado wrote:@DuckfaceNinja sorry its only english translator ;/ I want to create on start of layout few randomly generated sprites (wallblock) on game layout.

If host sync the wallblock onstart of layout, then created object will appear on all peer as well. What you see on host is what you'll see on all peer.
B
28
S
8
G
4
Posts: 553
Reputation: 4,924

Post » Thu Sep 25, 2014 3:15 pm

@DuckfaceNinja i create simple action under HOST group, on start of layout > repeat 5 times create object.
Sprites are not created on start.

But when i put this event on outside this group (host) object are created but different to each peer
You do not have the required permissions to view the files attached to this post.
B
113
S
28
G
48
Posts: 1,882
Reputation: 36,478

PreviousNext

Return to How do I....?

Who is online

Users browsing this forum: max2612, YoHoho and 8 guests