Combining many RPCs into a list to be sent as 1

Options
I am working on an RTS game with point and click commands. Also many "scene" ai zombies which are controlled by RPCs. At full scale I am going to have problems with too many RPCs being called. As a solution, rather than sending every single RPC for commands and changing targets and attacks, etc., I want to send all of these commands to a "UnitManager" which will collect all of the similar orders into a list and then every .2 seconds or so send them over the network as 1 RPC.

For example, if a player clicks, all of his selected group members would (through the UnitsManager) send an RPC with their current position (vector3), target gameobject (identified as an int held by the units manager), destination (vector3), etc. Similar RPCs are sent to zombies to change targets. Anyone have any thoughts on how I can combine all of the player commands into a list to be send later after a short delay? (Player command would be: int, int, int, vector3, vector3).

Any ideas on how to achieve this?

Comments