Search Unity

Testing Network Code

Discussion in 'Connected Games' started by ryanzec, Sep 15, 2009.

  1. ryanzec

    ryanzec

    Joined:
    Jun 10, 2008
    Posts:
    663
    I am in the process of build a game chat type system and was wondering how I would be able to test this. What I will need to be able to test in when I type something, anybody connected will also see it. What is the normal workflow (if it is possible) to test network functionality on a single machine?

    BTW, I am Running Unity 2.5 on Windows.
     
  2. MikeHergaarden

    MikeHergaarden

    Joined:
    Mar 9, 2008
    Posts:
    978
    I generally run the game in the editor and run one more more webplayers/standalone builds. The side I need to debug (Server or client) is the one running in the editor.
     
  3. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,088
    Yeah - for "development testing", I'd recommend a "big machine" that allows you to easily have a couple of instances of your game running simultanuously. Usually, two instances should be enough; or 3 if you have a dedicated server (1 server + 2 clients).

    In general, I'd recommend planning for multiplayer-testing early on in the process. In particular, I think it's usually a good idea to have some sort of robots so that you can easily simulate a couple of players (or "lots of players" if that's something you're targeting). Then, it's nice to have a few machines at your hands (maybe desktop + notebook).

    Finally, you should have a setup to test actual "real world networking", in other words: several machines running on different networks, maybe connected via DSL, plus some firewalls and stuff like that in between. Since that kind of set up is usually much more complex (you may have to ask a couple of friends to help you ;-) ), I'd plan for only a few tests every once in a while in that kind of environment (but start with it early on).