Search Unity

Cross Platform Engine Accuracy

Discussion in 'Multiplayer' started by neutrino15, May 21, 2008.

  1. neutrino15

    neutrino15

    Joined:
    May 3, 2008
    Posts:
    27
    Hello Gang!

    I am building a simulation/strategy game where the player can control hundreds (if not thousands) of little robots by issuing text commands. I want to add a multiplayer module to my game (because battling with thousands of robots will be amazing), but I need to decide on my fundamental networking method first.
    Should I send positions of robots over the network, or should I send the commands that control the robots?
    Basically, if every machine does it's math correctly, I should be able to run the same exact simulation given the same exact parameters.. So I don't need to send positions and vectors for every robot in play, just the commands that the users issue.. And the robots will behave as the physics engine on each player's machine makes them behave.
    My issue is that very small rounding errors, or very small positioning errors could be magnified as the game progresses. Think about it, if 1000 robots collide, and one team moves forwars for a split second more on one user's machine, how would that change that user's outcome?
    The game has to be fair. The simulation has to look exactly the same on everyone's machine, and there will be one winner..

    To make it slightly easier, it's turn based. So the commands don't have to be issued "live." Rather, everyone's commands are collected and executed at once. This cuts out any network delay problems.

    My question simply boils down to how accurate the engine is. Will the simulation return the exact same result on any machine? The iPhone? Windows? Sending all of the vectors doesn't even seem like an option (seeing as there are thousands of them.) My server would crumble, and you would practically need fiber optics to the home to play it!

    How would you deal with this?

    Thank You in Advance-
    -Jordan
     
  2. Colin Holgate

    Colin Holgate

    Joined:
    Jan 15, 2007
    Posts:
    263
    I think that in other words the question is whether or not Unity is deterministic. I suspect it won't be, and you'll need to send the robot data.
     
  3. neutrino15

    neutrino15

    Joined:
    May 3, 2008
    Posts:
    27
  4. Charles Hinshaw

    Charles Hinshaw

    Joined:
    Feb 6, 2008
    Posts:
    1,070
    I don't think you want to send the positions of all of the robots to everyone all of the time unless everyone can see all thousands of robots at the same time and all thousands of robots can do something that would change the nature of the game at all times. Unless that is the case, some blended approach might work better to significantly reduce the volume of information being sent.
     
  5. neutrino15

    neutrino15

    Joined:
    May 3, 2008
    Posts:
    27
    I will probably, as you said, do a hybrid.

    It increases the complexity of the game exponentially. I will probably have the commands sent to everyone's computer.. I will also have each client send the positions of the robots they control to the server every few seconds. This will make it so that the computer that "owns" each robot has the final say on it's position.. This would mean at most, each client uploading the positions of 500-or-so bots every 5-10 seconds... I am not worried about downloads because most people's connections have plenty of downstream.

    Any other tips would be appreciated!