Jason Wiser's Madwomb.com



Game Design MULITPLAYER and NETWORKED GAMES

BASIC MULTIPLAYER NOTES ON ONE COMPUTER (FROM TIM HO):

We built a multiplayer game, so I can share our method. The main thing is that you'll need two GameObjects to represent the two players, each with their own script. You could write two separate scripts but since all our players shared the same actions, I used one script for all of them. I called it PlayerController. The key trick is to make public the user input variables. Here's a snippet of what our code looked like:

public KeyCode left, right, up, down;  // this is at the top, outside of Start() and Update()

public Update()

{

     if (Input.GetKey(left)) {

          // code to move left

     } else if (Input.GetKey(right) {

          // code to move right

     } ...

}

That way, when I drag the script to my player GameObject, I can set the keys in the component window in the public variable fields. I can set player 1's Left to 'A', Up to 'W', Down to 'S', and Right to 'D'. In the player 2 GameObject, I can set the keys to the up, down, left, right arrows. You find where in the "First Person Controller" script the inputs are selected and replace them with the Input.GetKey functions.

A mouse is only used by one person; I advise getting two separate inputs working first and then using Xbox Controllers to move the different joysticks for each player's camera control, etc.

MULTI-MACHINE NETWORKING IN UNITY:

Unity has its own tools for networking, called “UNet”!

Step-by-step lesson:

UNet setup:

UNet conversion:

Quick Tutorial:



Video Tutorials:

Intro to Unity Networking:

Intro to multiplayer FPS:

(see more, next page)

OTHER NETWORKING OPTIONS:

Here are some popular Unity plugins for networking:

Good reviews of each of the below tools:

How to create a online multiplayer game using Photon Unity Networking (PUN), instead of the standard Unity networking:

PHOTON: “Photon Unity Network” (PUN):

Asset Store:

Intro video:

Free download/play for small # users (like class). Paid for commercial use (large CCU).

FORGE NETWORKING REMASTERED:

Asset Store (Free):

Documentation:

DARKRIFT:

Asset Store (Free version):

Learn about Hazel:

DarkRift has less out-of-the-box support, and is best for experienced C# programmers

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download