I’m just starting out (still using the trial) and I need networking (no single player mode planned), but the docs are somewhat lacking.
Does anyone have a really simple network multiplayer example? Two spheres in a box would do, as long as it shows the networking code on both server and client.
Well, make that an empty box and a sphere spawned for every client that connects. Really, extremely primitive, no FPS code, no explosions, just something that shows a working example of how to init a server, how to init a client and make it connect.
Please?
Now, not in three weeks when my trial period is up?
It’s coming. UT has in the past been pretty generous with trial extensions if you have a decent reason to need one… when the example does come out you’ll probably be able to get an extension by emailing them explaining your situation.
I’m new, still in the trial and attempting to absorb as much as possible. I’ve found the documentation to be excellent but a networking tutorial would be very helpful.
Not sure if this is useful or not, but here’s a very short script to do some basic networking including NAT punching. It’s a super simple RPC broadcast to get P2P chat working. Sorry JS guys its in C#.
Paste it into a C# Script called NetworkTest.cs and add it to a GameObject.
Change the P2PGameType and P2PGameName.
EDIT:
3. Add a Network View to the GameObject, turn of state sync and observed to Nothing.
To be a server - click Start Server, then Register with Master Facilitator - wait 3 to 5 seconds and your game should appear below.
To be a client, just click Get Host List. This will connect to the Master Facilitator and get a list of games of the GameType you specified. At the bottom of the list (you may need to scroll) - there is a connect button - click it.
Start typing in the Chat window, and if everything is working OK, all members of session should get the text.
Wow shaun thank you !!! – this is what I’ve been looking for.
I can get two machines to almost talk to each other, but not quite –
I can start a server, and register it, and connect with the other machine – the display shows two machines on the server – but nothing happens on either machine when I type.
is this a network view problem I wonder???
EDIT: All I needed to do was attach a network view component to the gameobject with the script.
Thanks again shaun… some of you guys can put this stuff together without working examples, but I’m just a dumb right-brainer. I need a working example to take apart and learn from…
Unclet: you’re absolutely right. thanks
I’ve updated the post with the additional step.
EDIT:
After getting some further infomation, I realize that Network.TestConnection is an asynchronous function, which means you must keep calling it until it returns a value. Once it returns a value, it wont test again, unless you set the forceTest paramter to true. So, keep clicking that Test NAT button, or copy the connection testing code into OnGUI and set forceTest=true in the button code