Web-based Cloud Gaming service for Retro Game
Find a file
2019-05-19 05:24:58 +08:00
cmd Clean code 2019-05-19 05:24:58 +08:00
config WIP 2019-04-28 21:45:30 +07:00
cws update architecture 2019-05-19 03:12:21 +08:00
emulator Add todo 2019-05-12 18:16:11 +08:00
overlord Clean code 2019-05-19 05:24:58 +08:00
static Merge branch 'master' of github.com:giongto35/cloud-game 2019-05-18 02:50:52 +08:00
util Allocation inplace 2019-05-15 02:52:00 +08:00
vpx-encoder Allocation inplace 2019-05-15 02:52:00 +08:00
webrtc Merge branch 'master' into fix-sdp 2019-05-17 02:31:13 +08:00
worker Clean code 2019-05-19 05:24:58 +08:00
.gitattributes Help github detect golang 2019-04-15 00:51:50 +08:00
.gitignore Update gitignore 2019-04-16 01:35:13 +08:00
Dockerfile update run script 2019-05-05 21:11:37 +08:00
LICENSE Update LICENSE 2019-04-11 02:13:48 +08:00
README.md Update readme 2019-05-05 16:29:51 +08:00
run_local.sh update run script 2019-05-05 21:11:37 +08:00

Cloud Gaming Service Lite

Cloud Gaming Service Lite is an open source Cloud Gaming Service building on WebRTC.

With cloud gaming, you can play any of your favourite NES games directly on your browser without installing it. It also brings modern online multiplayer gaming experience to classic NES game, so two people can play the game together.

screenshot

Feature

  1. Can play NES games directly from browser.
  2. Immediately startup, no need to install.
  3. Can multiplayer over internet. A person host a game and the other person can join the same game as 1st or 2nd player.
  4. Save (S) and Load (L) at any point in time.
  5. If you save the roomID, next time you can come back to continue play in that room.
  6. The game can be hosted on local and your game session can be accessed over internet.

Demo

https://www.youtube.com/watch?v=qkjV2VIwVIo

Try the game

For the best gaming experience, please select the closest region to you.

Southeast Asia:

US West (Los Angeles):

US East: (Haven't hosted)

Europe: (Haven't hosted)

Note: The current state of cloud gaming service lite are not optimized for production. The service will still experience lag in the case of heavy traffic. You can try hosting your own service following the instruction in the next session.

Run on local

You can host the server yourself by running ./run_local.sh. It will spawn a docker environment and you can access the emulator on localhost:8000.

Given the roomID, the game session on your local can be accessed over ethernet. The server will bypass NAT and set up a peer connection from remote service to local.

Development environment

Install Golang https://golang.org/doc/install

Install dependencies

# Ubuntu
apt-get install -y pkg-config libvpx-dev

# MacOS
brew install libvpx pkg-config

# Windows
...
  • go get github.com/pion/webrtc/
  • go get github.com/gorilla/websocket

Then we can run the main directly

  • go run cmd/main.go -debug - for debug UI
  • go run cmd/main.go - for gameboy UI

Code structure

├── games: roms list, no code logic
├── nes: emulator internal
├── static: static file for front end
│   ├── js
│   │   └── ws.js: client logic
│   ├── gameboy.html: frontend with gameboy ui
│   └── index_ws.html: raw frontend without ui
├── ui
│   ├── director.go: coordinator of views
│   └── gameview.go: in game logic
├── vpx-encoder: vp8 encoding images -> video track
├── webrtc: peer to peer communication
├── main.go: integration between emulator + webrtc (communication) + websocket (signalling)
└── run_local.sh

Follow up

This project demos the simplest cloud game with NES. Integrating with other emulator like GBA, NDS will also be possible. I'm welcome for the contribution.

Credits

Contributor

Nguyen Huu Thanh
https://www.linkedin.com/in/huuthanhnguyen/

Tri Dang Minh
https://trich.im