Testing Network Code in Unity

I am currently working on getting some network code to work. And since I am not that good at programming, I need to test ALOT to make sure my code works, so I don’t end up in a situation where something breaks, and I have to use alot of time trying to figure out what I broke.

So right now, I export what I have, to my labtop, set up my desktop as a server, and connect from my labtop. If I try to do everything from my desktop, only the active program running will update (So if my server window is not active, everything freezes) It is absolutely annoying that I have to export and transfer everytime, and have a setup of two coputer to test. Does anyone have experience and some suggestions how I can do quick itterative testing on only one computer?

Thanks for your time :slight_smile:

what you should be doing is have playInBackground turned on, so the editor and any instances of the game still update the networking stuff.

and for networking i plan to make my projects hostable online so i build for the web player, and i can have multiple instances of my project open in different browser tabs, while staying connected to that network in the editor (still able to interact with the project view)

this way you dont have to use a thrd party app

Enable “Run in background” option in Player Settings.

You can set up a local server. I like ServerToGo. It can also be a real server, but I wouldn’t trust it for being very secure that way. But for local testing, it’s great. PHP and mySQL come with it.

BTW: No matter how good you are at programming, a LOT of testing is always a good idea.

Ok, so I found a propper sollution for this. It acually working ok, and its free :slight_smile:

I installed an old XP on Virtual Box: (http://www.virtualbox.org/)
From here I can easily just share a folder, and run the game server in the Virtual Machine, then go outside without loosing focus to launch my game. Works fine :slight_smile: And I dont have to have a setup of more real machines to test my network code.

Pointers if you try to do this. Remember to set it up so that the VM uses the graphic card (as basic, it has no graphic card.) and add a network card and set it to “host only” this will make it easier to test stuff.

Having trouble doing this, let me know and I will help :slight_smile: