Jump to content
  • Advertisement
Sign in to follow this  

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

This topic is 2080 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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)

Share this post

Link to post
Share on other sites

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.

Share this post

Link to post
Share on other sites

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.

Edited by Petter Hansson

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!