Jump to content

  • Log In with Google      Sign In   
  • Create Account


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


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
2 replies to this topic

#1 fromegg   Members   -  Reputation: 104

Like
0Likes
Like

Posted 03 November 2013 - 04:22 PM

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)



Sponsor:

#2 hplus0603   Moderators   -  Reputation: 5067

Like
0Likes
Like

Posted 03 November 2013 - 07:01 PM

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 };

#3 Petter Hansson   Members   -  Reputation: 587

Like
0Likes
Like

Posted 03 November 2013 - 08:17 PM

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, 03 November 2013 - 08:20 PM.





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