x


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 :)

more ▼

asked Jun 16 '11 at 08:29 PM

Tabu gravatar image

Tabu
176 23 26 38

(comments are locked)
10|3000 characters needed characters left

4 answers: sort voted first

Enable "Run in background" option in Player Settings.

more ▼

answered Aug 30 '11 at 09:45 AM

rstuven gravatar image

rstuven
16

(comments are locked)
10|3000 characters needed characters left

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

more ▼

answered Aug 28 '11 at 07:33 PM

Techsuport gravatar image

Techsuport
81 6 6 10

I dont understand, how can you have several instances running in different tabs? Does that work with playInBackground? And where do you set playInBackground?

Aug 28 '11 at 08:22 PM Tabu
(comments are locked)
10|3000 characters needed characters left

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

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 :) 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 :)

more ▼

answered Aug 28 '11 at 11:38 AM

Tabu gravatar image

Tabu
176 23 26 38

(comments are locked)
10|3000 characters needed characters left

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.

more ▼

answered Jun 16 '11 at 08:47 PM

DaveA gravatar image

DaveA
26.5k 151 171 256

This is kinda what I do, my problem is that I have to have a setup of two computers. What I would like, would be something where I just export to the same computer, run and connect to the server that is run from the editor.

Jun 16 '11 at 08:58 PM Tabu
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x710
x682
x53
x41

asked: Jun 16 '11 at 08:29 PM

Seen: 1500 times

Last Updated: Aug 30 '11 at 08:59 PM