Unity, RTS Multiplayer, Lock-step simulations and fixed game timings

Started by
1 comment, last by StubbornDuck 10 years, 5 months ago

Greetings fellas,

I am currently developing game with Unity, it has RTS style and looks like Warcraft III and my part is to implement Multiplayer there

Before it I had experience creating Multiplayer for Six Guns ( iOS ) using not Unity, the system of synchronization and replicating game worlds in FPS shooters is totally clear for me, especially it's easy to make Multiplayer when you work with opened source game engine and understand all processes inside.

Unfortunately I don't have experience with Unity and RTS games and all my knowledges about these are only theoretical, so guys I hope you will fix my way and improve my conception or disprove it

My goal is -

to create Multiplayer with simultaneous game world simulations, all user inputs splits into commands and sync over network,

so the main trick is not to sync all units and their states, all events etc ( because it's RTS and there would be a lot info to sync ) and to have the same game worlds on all machines, I am going to achieve this by rounding floats, using FixedUpdate, executing all commands of users at the same time or same "command turn"

Techniques I am going to use :

  1. http://www.gamasutra.com/view/feature/3094/ this is used almost in all RTS games

The main questions I do concern about:

  1. is it real to have the same game world, behavior and states if you execute commands in the same time on all clients, assuming that clients may have different fps and lags
  2. I'm also curious is there any game published or tutorial using such techniques

p.s, the game uses Physics for colliding, designing for 2-6 players

I would appreciate any useful examples to achieve my goal, any additional articles and any ideas/critics

Thanks, Igor (fromegg)

Advertisement

Unity simulation is not deterministic across all machines.

Thus, you have to build your own simulation, that takes in user inputs, and puts out unit positions/status.

You can then have code that takes the output of your own simulation and applies it to the position/animation of the various Unity game objects.

enum Bool { True, False, FileNotFound };

Indeed, you will have to throw out a lot of what Unity gives you.

While that is said, lockstep synchronization for RTS has so many advantages over "normal" network synchronization methods that I think it's worth it, as long as the command-response lag is acceptable. For an RTS/FPS hybrid for example I would not necessarily decide to use lockstep.

This topic is closed to new replies.

Advertisement