- Home /
Is there any C# multiplayer (ONLINE/NETWORKING) tutorials out there?
Hey guys! Me and some friends is making a game for a school project. And we wanted it to be a 4 player puzzle game. But the thing is, I do not know how to make it online (with the NAT and IP ports).
What I'm asking for is, is the "Unity Scripting Reference" enough to help me do this; Or do I need an actual Tutorial? Because, I'm scripting in C#, and the MH2 tutorial and every other tutorial is in JavaScript. So can any of you guys give some constructive help or links in order to "guide" me towards making an "Semi-online" game.
Thank you for reading this! :)
Answer by Bunny83 · Apr 18, 2012 at 12:10 PM
The BurgZerg hack-slash-rpg-tutorial is written in C#. Anyway whether you need a tutorial or not is up to you ;) The Networking engine (RakNet) is pretty simple, however there's no golden solution that fits for all multiplayer setups. A online card game has a much different setup than a 3D FPS shooter, but the basics are the same.
Yea, I've been doing the first 40 videos of the BurgZerg hack-slash-rpg-tutorial, and I understand pretty much everything he does :) - But is it recommended to first complete a single player game, before "venturing" into the world of multiplayer games?
Anyways, thanks for the quick answer! I've thumbed it up!
Well, not necessarily ;) Sending data to other clients isn't really compilcated, but you have to get behind how all those different objects are related to each other.
Basically every peer has it's own objects. Everything happens on the users own PC. If 3 people play together they play3 different games ;) The NetworkView component is the magic thing. It has NetworkViewID (just a number) that is unique on all peers. The owner of this ID (the one that creates the object) can send updates for this object. All other peers will receive the updates and apply them on their own object that has the same NetworkViewID.
You can also use only RPC calls so you decide what is sent and what happens with the data on the other side.
Wow, that helped a lot man! I think I understand the basics behind Networking now then ;) - Nothing left but to start scripting! :)
Thanks alot man! :)