# Multiplayer game with Unity + Node.js
Proof of concept to excercise building a multiplayer game in Unity and to explore having a non-Unity authoritative server built in Node.js.
The server uses Socket.IO and is written in TypeScript and then transpiled via Webpack. It uses ESLint and Prettier for linting and formatting, and uses Jest for unit testing.
The goal is to explore having a non-Unity authoritative server built in Node.js
Player initial connection
The socket sends the initial “connection” event to the server. The server calculates the initial position where to render the player and replies with a welcome message that has the position as payload. The client (game) then renders the local player.
Player joins the game (confirms it is rendered locally)
Once rendered locally the game lets the server know this. The server registers the player and then proceeds to send existing players back and to broadcast the player to those other players.
Player moves - IN PROGRESS
The player moves locally, then this information is sent to the server for validation. The server validates the position, sends it back and also sends the confirmed position to other players.
The initiating game corrects position if it needs to and the other games render the position change for the player.
Collisions - NOT STARTED
Player actions: jump, shoot, etc - NOT STARTED
When a player closes the game the server updates the players list and informs other games about this.
- Movement: Rigidbody vs Translate
- Troubleshooting: character falling over problem
- Rotation with Rigidbody
Unity + Socket.IO
Multiplayer Network Movement
Unity Unit Testing