What is the recommended way to replicate movement in an RTS?
LemurDev
✭
in Photon Bolt
I am trying to create a small tech demo for an RTS. The model I'm trying to follow is Client connection to Auth Server, which has authority over individual unit state as the owner and assigns control to the client. The server in this example is not a player, but is created when the game is hosted.
I followed the ClickToMove tutorial, and implemented it as a working model. My entities are on a Navmesh with an Agent, and have a rigidbody. The problem is, in this tutorial Commands get queued by SimulateController every frame. This is fine if I just have, say, less than 12 entities (units) active syncing their movement, but once I add more (16+), the server can't handle the amount of command inputs coming in and throws up "Input Queue Is Full" or Package overflow.
Is this tutorial meant for only simulating a smaller number of entity movements? In the case of a larger amount of things being active in the scene (We could theoretically have 100 entities that need to have movement replicated), is there a different approach that should be followed?
I followed the ClickToMove tutorial, and implemented it as a working model. My entities are on a Navmesh with an Agent, and have a rigidbody. The problem is, in this tutorial Commands get queued by SimulateController every frame. This is fine if I just have, say, less than 12 entities (units) active syncing their movement, but once I add more (16+), the server can't handle the amount of command inputs coming in and throws up "Input Queue Is Full" or Package overflow.
Is this tutorial meant for only simulating a smaller number of entity movements? In the case of a larger amount of things being active in the scene (We could theoretically have 100 entities that need to have movement replicated), is there a different approach that should be followed?
0
Best Answers
-
I would recommend using events for sending input instead of commands. Commands aren't designed for use with more than a couple entities.
The sample pack has an example of replicating movement of 100+ entities.5 -
Whether you are using commands or events to send input, you are not necessarily fully server authoritative if within that input you have "move to this position immediately" rather than "I want to move forward". However you can accomplish full server auth using events or commands for input. https://doc.photonengine.com/en-us/bolt/current/troubleshooting/authoritative-server-faq5
Answers
-
I would recommend using events for sending input instead of commands. Commands aren't designed for use with more than a couple entities.
The sample pack has an example of replicating movement of 100+ entities.5 -
If using events to send user input, will the movement be authoritative?0
-
Whether you are using commands or events to send input, you are not necessarily fully server authoritative if within that input you have "move to this position immediately" rather than "I want to move forward". However you can accomplish full server auth using events or commands for input. https://doc.photonengine.com/en-us/bolt/current/troubleshooting/authoritative-server-faq5