Jump to content

  • Log In with Google      Sign In   
  • Create Account

Lock Stepping For RTS


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
6 replies to this topic

#1 SillyCow   Members   -  Reputation: 899

Like
0Likes
Like

Posted 03 August 2012 - 07:38 PM

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 Posted Image.

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?

Edited by SillyCow, 03 August 2012 - 07:43 PM.

My new android game : Enemies of the Crown

My previous android game : Killer Bees


Sponsor:

#2 AdrianC   Members   -  Reputation: 602

Like
0Likes
Like

Posted 03 August 2012 - 08:59 PM

Is lock-stepping even an option for an RTS?

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.

As I understand it you just send each player's input, not each unit's action.

#3 Hodgman   Moderators   -  Reputation: 31805

Like
0Likes
Like

Posted 03 August 2012 - 10:10 PM

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.

#4 SillyCow   Members   -  Reputation: 899

Like
0Likes
Like

Posted 04 August 2012 - 03:11 AM

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?

My new android game : Enemies of the Crown

My previous android game : Killer Bees


#5 hplus0603   Moderators   -  Reputation: 5707

Like
0Likes
Like

Posted 04 August 2012 - 12:51 PM

"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?


Yes; that's the whole point of "lock step."

A unit get's a logic step ~every 1-2 seconds.


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 :-)

enum Bool { True, False, FileNotFound };

#6 SillyCow   Members   -  Reputation: 899

Like
0Likes
Like

Posted 04 August 2012 - 11:10 PM

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.

My new android game : Enemies of the Crown

My previous android game : Killer Bees


#7 hplus0603   Moderators   -  Reputation: 5707

Like
0Likes
Like

Posted 05 August 2012 - 01:16 AM

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.


If you do lock stepping, then no step will result in a message. The only thing that results in messages is user commands.
enum Bool { True, False, FileNotFound };




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS