About
Unity3D networking Part 1, concepts
I have set about learning about networking on Unity3D in order to implement multiplayer support for Zombie Gecko’s Comrade In Arms. I have a fair amount of experience with networking, having first cut my teeth writing real-time transactional system allowing Unix hosts to update banking details to a IBM Mainframe using XNA, then working on early Internet credit card authorizations system and finally developing the server/networking code for Fung Wan Online MMOG. Well enough about me ;P
Unity3D uses RakNet for standard networking and who ever is implementing things will have a lot of plumbing to take care of inorder to get things working. Unity uses a “Networking View” component which must be attached to all objects which in turn Network State Synchronization and Remote Procedure Calls(RPC’s) to occur. You can set specific spatial components to be observed by a network view but usually you will implement a script that will pre/post process network information sent. This was something I missed when I first started out tinkering with networking on Unity
Let’s go back a bit and talk about the 2 different methods of communicating in Unity:
- State synchronization – this is basically a method of setting the network view to observe a script component that processes changes in states that can be sent to the server which in turn are transmitted to all listening clients.
- Remote Procedure Calls – This is a common enough networking concept that allows you send invoke functions on the server or all clients with parameters being passed.
You can do some additional reading on networking by looking up the following resource:
- Unity documentation
- iPhone Multiplayer demo – still works and you can substitute a web view for an iphone
- Unity Networking Example – Still works on Unity 3.3
- M2H networking tutorials – It cost money now, but there was a simple network tutorial that is floating around the network.
In a follow up posting, I will go through making connections,extrapolation,interpolation and hooking RigidBody objects.
[…] your findings, please leave a message below and I’ll be in touch. Meanwhile, check out the Part 1 and Part 2 Unity3D Networking Concept by Terence […]