Best networking architecture of this game type

Started by
3 comments, last by hplus0603 12 years, 2 months ago
[font=Calibri]

[color=#000000]I am working on a hybrid RTS / third person shooter. [/font]

[font=Calibri]

[color=#000000]Up to 10 players 5 vs. 5[/font]

[color=#000000][font=Calibri]Each player can control up to 12 physics based vehicles and 132 kinematic infantry. Most like alot less.[/font]

[font=Calibri]

[color=#000000]I need to pick the architecture[/font]

[font=Calibri]

[color=#000000]a: trusted client with checking[/font]
[font=Calibri]

[color=#000000]b: authoritative server [/font]
[font=Calibri]

[color=#000000]c: P2P full synchronized. [/font]

[font=Calibri]

[color=#000000]I know most RTS game are full synchronized however, I do not think this will work well for me due to the physics I use etc may not be deterministic. Some of my physics including damage physics and AI may not be lightweight. [/font]

[font=Times New Roman]

[color=#000000]Thanks.[/font]

Advertisement
Pick one, figure out your network implementation, and do a simple calculation on how much CPU, RAM and network bandwidth will be needed. Does the calculation pencil out? If so, you should move forward and implement it, and see if it actually works out.

Note: It's totally possible to make the game simulation be based on a deterministic engine, and then use non-deterministic physics to "spice up" the display. It is also possible to make certain physics engines (such as ODE or Bullet) fully deterministic with sufficient attention to detail.
enum Bool { True, False, FileNotFound };
Just to clarify, what are your main concerns? e.g.
- Synching events between clients
- Synching visuals between clients
- Preventing cheating
- Dealing with buggy clients / clients on different architectures
- Dealing with lag

If you can get your physics working deterministically as the mod said, would be best to do any randomness with your own random numbers, and just pass the seed used between clients.
Right now, I use physx none of my code is written with determinism in mind. I also use C# not sure, how that would affect stuff. Full synchronized just seems like a lot of problems.

144 units per player would optimistically be about 80 kbps per player. Most likely, it would be more like 150 kbps however most of the time a player would likely have more like 50 units. plan to have total unit limit among all players at 1,000. I think more like 300 would be the high point in a normal game.

Basically it is just barely doable as an authoritative server. Since this game will not use a dedicated server. An authoritative server puts more CPU load on the server hopefully not a prohibitive amount. I have read over all the papers I can find on game networking. I can optimize some of this by sending the path units will follow from the server. When the player is not directly controlling his units. The player can only control 1 unit at a time when hes is in directly control

- Synching events between clients
yes

- Synching visuals between clients

yes to a degree for aiming. I plan to us something like valves latency compensation

- Preventing cheating
Yes to a degree. This is mostly a problem if the game becomes popular. So I can deal with it latter after release to a degree.

- Dealing with buggy clients / clients on different architectures
no

- Dealing with lag
yes P2P will create more of this I think

The following series is a lot like the game I am trying to develop I think it uses a server of some kind because if the host leaves the game will end. But I have no idea what it's really doing.

soldiers heroes of ww2, faces of war and men of war
Let's say you checkpoint all units once every ten seconds, and then send unit updates on a rolling basis (N units per packet) until the next full update.
Let's settle on an update rate -- say 10 Hz. No packet sent by the server should take more than 1/10th of a second to send to all players, then, or you will introduce jitter across frames. What would that look like?
If your server has 1.5 Mbit/s up, and needs to send to 9 players, that's about 165 kbit/s/player. Divide by 10 means 16.5 kbit/player/update, which is about 2 kB. Can you fit a full world update into 2 kB? Let's say each unit uses three shorts for position (range is +/- 1000 meters, with 1/32m resolution), four bytes for orientation (3x10 bits quaternion + 2bits for which axis was dropped), three bytes for velocity, three bytes for spin, and four bytes for misc status (damage, ammo, etc). Add about 2 bytes per unit for overhead. This will let you send approximately 80 units in a checkpoint, if you checkpoint all players at one time.
If you rotate the checkpoint -- checkpoint one player each second -- then you can send bigger checkpoints, because the server only needs to send one big packet, and several small packets, per time window.

So, with those assumptions, I think a "loose" and occasionally-checkpointed server-client model would work.
enum Bool { True, False, FileNotFound };

This topic is closed to new replies.

Advertisement