Drop in / Drop out real time session version of the tank tutorial
J
Jim Bending
started a topic
over 6 years ago
Hello
I'm trying to create a drop in / out version of the tank tutorial. I'm currently thinking that I can instantiate 30 playable characters (the game would be max 30 players) and keep them all hidden / inactive.
My idea is that when someone logs in with peerID 25, they take over the playerCharacter[25] in my array of player characters. Any unused playerCharacters remain hidden and don't send any network data. Is this a mad way of going about it?
How does the Peer ID work? I'm assuming in my 30 player max game, the peerID will always be a value between 1 and 30. If someone drops out, say PeerID 5, I'm assuming that peerID is then available to anyone who joins again? Would peerID ever exceed 30 and crash the game?
The RT- session will actually preserve the peerID for anyone who has 'dropped out', just in case they want to come back in. So, for example in a match of 4 players, if Peer 1 drops out and another player joins, they will be given peerID 5.
When a change to the match happens, each player will get a MatchUpated message. So, from this you can check if there are any new players that need to be instantiated.
Does that make sense? Sean
1 Comment
Customer Support
said
over 6 years ago
Answer
Hey Jim,
The RT- session will actually preserve the peerID for anyone who has 'dropped out', just in case they want to come back in. So, for example in a match of 4 players, if Peer 1 drops out and another player joins, they will be given peerID 5.
When a change to the match happens, each player will get a MatchUpated message. So, from this you can check if there are any new players that need to be instantiated.
Jim Bending
Hello
I'm trying to create a drop in / out version of the tank tutorial. I'm currently thinking that I can instantiate 30 playable characters (the game would be max 30 players) and keep them all hidden / inactive.
My idea is that when someone logs in with peerID 25, they take over the playerCharacter[25] in my array of player characters. Any unused playerCharacters remain hidden and don't send any network data. Is this a mad way of going about it?
How does the Peer ID work? I'm assuming in my 30 player max game, the peerID will always be a value between 1 and 30. If someone drops out, say PeerID 5, I'm assuming that peerID is then available to anyone who joins again? Would peerID ever exceed 30 and crash the game?
Hope this makes sense! Thanks very much
https://docs.gamesparks.com/api-documentation/realtime-api/rtplayer.html
Thanks!
Jim
The RT- session will actually preserve the peerID for anyone who has 'dropped out', just in case they want to come back in.
So, for example in a match of 4 players, if Peer 1 drops out and another player joins, they will be given peerID 5.
When a change to the match happens, each player will get a MatchUpated message.
So, from this you can check if there are any new players that need to be instantiated.
Does that make sense?
Sean
Customer Support
The RT- session will actually preserve the peerID for anyone who has 'dropped out', just in case they want to come back in.
So, for example in a match of 4 players, if Peer 1 drops out and another player joins, they will be given peerID 5.
When a change to the match happens, each player will get a MatchUpated message.
So, from this you can check if there are any new players that need to be instantiated.
Does that make sense?
Sean
-
Documentation Notes
-
Design issues with user events
-
Using NoSQL
-
Runtime Collections vs Metadata Collections
-
Anonymous authentication from browser app
-
Modules
-
Movement With Unity
-
Problem with url parameters for downloadables
-
Querying NoSql GameSparks database
-
Challenge accesType
See all 2487 topics