I've finished my naive multiplayer implementation for my RTS game, and I've measured how many bytes I'm sending through.
The figure I got was ~70 Kilobytes-per-second for a small map (~30 units).
This is raw game data, without the added overhead of network protocols.
Since I want to use a remote game-server, this rate is unacceptable.
The technique I am using is lock-stepping. I send a message each time a unit moves from one square to another on the grid.
I've read the 1,500 archers article http://www.gamasutra...8_network_.php/ .
I'm targeting androids, so I'm not sure it is an option. I'd probably have to clear the code of every floating point calculation I have.
And besides, it seems harder, and I'm lazy .
I can probably optimize the 70 kB/s figure by a factor of 10.
But 7 kB/s is still bad for a small map on an RTS which has to link to a remote server.
I've read somewhere that Star-Craft 2 uses ~15kb/s for large maps.
So what I want to ask is:
Is lock-stepping even an option for an RTS?
Would you try to implement the same-state-simulation as described in "1,500 archers" on Android phones?
Should I try to compress (Huffman) my communications on an ARM chip allready running an RTS game?
Lock Stepping For RTS
Is lock-stepping even an option for an RTS?[/quote]
Lock step is the only option for RTS games.
I send a message each time a unit moves from one square to another on the grid.[/quote]
As I understand it you just send each player's input, not each unit's action.
What is you 'tick' rate? How often do you run your 'step' logic on each client?
As I understand it you just send each player's input, not each unit's action.That's generally the point of lock-step systems, yep.
A unit get's a logic step ~every 1-2 seconds. There are many other logic steps, but those are generally related to path-finding, and U don't send those.
I think I might have misunderstood what lock-step is, I'm new to multi-player.
I send each unit's action: 1 message each for each moving unit ~every second. Aside from that, game state is replicated on both machines. But only one machine does path-finding. I only send the complete state once at the beginning of the game. I thought that was lock-step.
"you just send each player's input" is what's described in the "1,500 archers" article and is what I didn't do. Is that method what is necessary?
I think I might have misunderstood what lock-step is, I'm new to multi-player.
I send each unit's action: 1 message each for each moving unit ~every second. Aside from that, game state is replicated on both machines. But only one machine does path-finding. I only send the complete state once at the beginning of the game. I thought that was lock-step.
"you just send each player's input" is what's described in the "1,500 archers" article and is what I didn't do. Is that method what is necessary?
"you just send each player's input" is what's described in the "1,500 archers" article and is what I didn't do. Is that method what is necessary?
[/quote]
Yes; that's the whole point of "lock step."
A unit get's a logic step ~every 1-2 seconds.[/quote]
I don't think that's often enough, but it might be, depending on the game. Typically, your logic step rate will be between 10 and 30 steps per second in a typical RTS (if such a thing exists :-)
The logic step for thr game occurs 50 times a second. A meaningful step happens only once per second per unit. A meaningful step being one that results in a message. Most other steps concern path finding and ai, which are not sent.
The logic step for thr game occurs 50 times a second. A meaningful step happens only once per second per unit. A meaningful step being one that results in a message. Most other steps concern path finding and ai, which are not sent.[/quote]
If you do lock stepping, then no step will result in a message. The only thing that results in messages is user commands.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement