Search Unity

Using unity for online games

Discussion in 'Multiplayer' started by Gardon, Aug 3, 2008.

  1. Gardon

    Gardon

    Joined:
    Nov 5, 2006
    Posts:
    26
    I've always been a 'do-it yourself' kind of guy when it comes to programming, artwork, web design, etc. When I stumbled on Unity I was amazed at the quality, and instantly wanted to learn more.

    I took the 30 day trial and figured out how awesome and productive it would be to create a single player game with this engine. It does all the calculations for graphics, physics, etc. all internally, so I don't have to mess with that crap myself.

    However, if I want to take a game online, how do I transfer ownership of the logic processing to the server, and not just a physics and rigidbody type check on the client? Currently Unity handles everything in game, so how would I use a server to monitor and process the game?

    Example: Lerpz is able to walk around in the 3D world, collecting fuel cells and health pickups. He can attack, and be attacked by, enemies which are trying to kill him. Collision tests are done to see if these two meet, and if so, one shall kill the other.

    If I wanted the game to be put online, so that several players could join in Lerpz's fun, they each would have to know about the collision detection and state of the enemy.

    So rather than running the collision tests on others machines (which is highly unoptimized and unsecured) how can I transfer that to the server, so the server can manage what player is getting what information, and how the game is supposed to be played out?
     
  2. Gardon

    Gardon

    Joined:
    Nov 5, 2006
    Posts:
    26
    I realized that post didn't make much sense. Basically if I were to write my own server/client program like I have done in the past, I would have the server handle all calculations and send only necessary data to the client.

    Ex: User chooses to move forward. The user sends the request to the server, which then tells the player that he has collided with another object (say a tree), so the player should stop moving. Had the player done the collision detection on his own system, it would have never sent the request to the server to move in the first place, but then instances of delaying sever data packets to cheat is involved.

    I would need the server to receive a "move" message and handle the collision detection accordingly.
     
  3. Jessy

    Jessy

    Joined:
    Jun 7, 2007
    Posts:
    7,325