Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zvoverman/multiplayer-game
Fast server-authoritative game architecture built with Node.js
https://github.com/zvoverman/multiplayer-game
aws aws-ec2 ec2-instance expressjs nodejs server-authoritative socket-io
Last synced: 4 days ago
JSON representation
Fast server-authoritative game architecture built with Node.js
- Host: GitHub
- URL: https://github.com/zvoverman/multiplayer-game
- Owner: zvoverman
- Created: 2024-01-18T06:37:55.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-08-10T01:12:42.000Z (6 months ago)
- Last Synced: 2024-11-24T11:14:19.369Z (2 months ago)
- Topics: aws, aws-ec2, ec2-instance, expressjs, nodejs, server-authoritative, socket-io
- Language: JavaScript
- Homepage:
- Size: 151 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Node.js Multiplayer Game Demo
A Node.js powered game demo utilizing the Javascript HTML5 Canvas for rendering.
**Fast and Responsive Client-Server Architecture**:
- Server authoratative gameplay
- Variable frame rate
- Client-side prediction
- Server reconciliation
- Entity interpolationLots of research from **[Client-Server Game Architecture](https://www.gabrielgambetta.com/client-server-game-architecture.html)** by Gabirel Gambetta _(amazing article)_
## Getting Started
Steps on how to install and run the game locally.
### Prerequisites
1. Install [Node.js](https://nodejs.org/en/download/package-manager)
### Local Installation
1. Clone the Repo
```bash
git clone https://github.com/zvoverman/multiplayer-game.git
```2. Install Project Dependencies
```bash
npm install
```3. Run the Server Locally
```bash
npm run start
```## AWS Automation
### Development1. Create a dotenv (.env) file
```bash
INSTANCE_TYPE=""
SECURITY_GROUP=""
REGION=""
OWNER_ID=""
SSH_USER=""
KEY_NAME=""
```2. Run Express.js Server on an EC2 Instance
```bash
npm run start-ec2
```3. Update Server Packages and Pull New Game Code
```bash
npm run update-ec2
```4. Terminate Last Created EC2 Instance
```bash
npm run stop-ec2
```### Deployment
1. Create a dotenv (.env) file
```bash
INSTANCE_TYPE=""
SECURITY_GROUP=""
REGION=""
OWNER_ID=""
SSH_USER=""
KEY_NAME=""
```2. Create Instance, Start Express.js Server, and Terminate Instance (Ctrl+C)
```bash
npm run deploy
```