Search Unity

Parallel Simulation in Unity?

Discussion in 'Multiplayer' started by liquidgraph, Jul 11, 2009.

  1. liquidgraph

    liquidgraph

    Joined:
    Feb 26, 2009
    Posts:
    324
  2. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    There is no problem with that if you use RPC calls.
    Its not really much about network than more about how to make which data available from what it looks.

    what you can not use is the cheapo way through the auto sync as that will sync all objects at a specific rate
     
  3. liquidgraph

    liquidgraph

    Joined:
    Feb 26, 2009
    Posts:
    324
    As I understand it though, parallel simulation requires a fully deterministic game world, and there are inherent architecture assumptions there.

    For example, as described in the above article, Age of the Empires sped up or slowed down execution of key game loops, like rendering and physics to account for latency. They calculated latency and average fps that a machine could handle on the fly and scaled their game loops from the default 200ms. Is this possible in Unity? Has it been done? And if not, why not, because this method reduces bandwidth usage substantially and virtually eliminates cheating?
     
  4. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    Well you can't render faster than what the graphic card offers but you can slow it down.
    The general game loop speed is out of your hands, more precisely there is no single gameloop at all.
    But you can reduce the simulation speed by altering the speed for example.


    why has it not done: Don't know.
    I guess because there are only few RTS games and about no commercial ones, so a lot of effort for hobbiests.
     
  5. liquidgraph

    liquidgraph

    Joined:
    Feb 26, 2009
    Posts:
    324
    "...you can slow it down..."

    What specifically can be slowed down? Can Unity's physics be relied upon in a deterministic simulation? Things like random numbers, etc. have to be seeded such that every player on the network is running the exact same game given specific keyboard and mouse inputs -- which is all that I'd be passing. Every client would have to calculate positions, rotations, and states for individual units and those need to match up, whatever the performance or lag.

    I'm trying to get a sense of how difficult this would be in Unity, in not altogether impossible given certain restrictions like access to rendering. Obviously this is meant for a professional project, not an amateur endeavor.
     
  6. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    Physics is not realiable in any physics engine.
    Thats why CPU driven physics is not beeing used in any multiplayer environment.

    You would have self written physics (much simpler than real physics simulation) that are calculated on the server which is then shared.

    Such a thing will be a medium to big task in any <= 5 figure engine, at least any that I am aware off.

    Unity is no exception to that.
    It can be done but its neither something you will pull off in a few weeks nor anything that beginners or hobbiests will ever pull off.
     
  7. lindapret88

    lindapret88

    Joined:
    Jul 14, 2009
    Posts:
    1
    Thanks for sharing this useful information. It's great.


    taux pret auto