Search Unity

Any tips on multiplayer development workflow?

Discussion in 'Multiplayer' started by malkere, Dec 20, 2018.

  1. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,212
    Having to build every time I want to test something multiplayer adds up really fast to a lot of waiting over the past few weeks. Has anyone successfully faked a client connection and scene in the editor or found any ways to speed up the development process? Ultimately I know it's best to have everything sectioned and self-contained, bring it to it's own test scene, and work with it there, but when it comes to multiplayer I need to have most of my stuff moving or it doesn't serve as a real test =3

    Just though I'd ask if anyone has come up with anything clever over the months and years.
    Cheers.
     
  2. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    I find that most of the time I'm not making changes that run on both the client and server, so often I don't even need to create a new build to test something. I also came up with a process for deploying new server builds quickly, usually up and running within 10 minutes, so that has helped. I could see someone though just setting up a second computer with Unity and running both client and server in different editors to skip creating builds. Could be done using a VM on the same computer as well.
     
    malkere likes this.
  3. JesOb

    JesOb

    Joined:
    Sep 3, 2012
    Posts:
    1,109
    My case is client and server code it is the same code that I write on client and don't care separate server side.

    To all this work there are 2 ways I like:

    1. Make IPeer interface that abstract your connection, data sending receiving and you can fake it and run server inside editor. (doable not for every code structure)

    2. Just make new project folder and symlink (mklink /j ... on windows CMD) inner folders such as Assets, ProjectSettings and Packages. Also copy library folder to not wait for full asset import. Now you have 2 projects from single repository and single code base. It means pull changes once and get updated 2 project instances, make code change in one IDE and get updated and recompiled in both instances. Just press play in both editors and run one as server and second as client and test your game. For some scenarios I have few of such ghost projects to connect several clients to server
     
    malkere likes this.
  4. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,212
    I'm definitely trying that!