VERY simple 2 player network multiplayer ?

Hey, I’m currently making a little web game and I’m thinking of making it a multiplayer too.
But I don’t want to make a split screen and I thought I should learn some simple networking scripting and so to make a 2-4 multiplayer game. But is this very difficult to make and what do I need to start ?

I’m not going to make a big mmo or something but I still need a server ? or ?

Could someone point me in the right direction ?

Thanks :wink:

Whats the game… In any case, if there is only going to be 2-4 players, then you will not need to host your own servers. You will need a server for the MasterServer, but while developing you can use the Unity server.

Start here: http://forum.unity3d.com/threads/29015-UniKnowledge-entry-Unity-Networking-the-Zero-to-Hero-guide

It’s just a little racing game and I don’t want to do splitscreen in the web player.
So I thought it would be cool to play together online but not more than 4 players at the same time :wink:

I’ll check out the link and see what I could come up with.

Another fun thing for Master Servers - there’s a PHP masterserver you can implement on your own webserver.

Clicky.

Best of fortune!

WOOOAAAHHH!!! Thanks a bunch, I have that bookmarked.

Hey–

Here is simple code to get you started:

//put this function on the server
function LaunchServer () 
{
  //Network.incomingPassword = "HolyMoly";
  var useNat = !Network.HavePublicAddress();
  Network.InitializeServer(32, 25000, useNat);
}

//put on the client and call
function ConnectToServer () 
{
  Network.Connect("127.0.0.1", 25000);
}

//attach a Network View component to what you want to send and receive data
function OnGUI () 
{
  if (GUILayout.Button("Print Message")) 
  {
     networkView.RPC("SpawnBox",RPCMode.All,"DATA");
  }
}

@RPC
function SpawnBox (msg : String) 
{
  Debug.Log (msg);
}

All RPC functions (declared with the @RPC) must be called from the script that the network view is on.

Good luck!