Web-based Cloud Gaming service for Retro Game
Find a file
giongto35 fde4a24158
Merge aspect ratio to master (#116)
* Add frame scaling support (#107)

* Update README.md with additional info about Windows builds

* Add frame scaling

* Add and enable bilinear scaling (#109)

* Add and enable bilinear scaling

* Use Go x/image lib for interpolation

* Reformat the code goimport/gofmt

* Move worker config into the pkg/worker directory

* Change separator in the save file path allowing it to work on Windows (#113)
2019-10-19 02:29:07 +08:00
.github Update FUNDING.yml 2019-09-09 12:32:09 +08:00
assets Use homebrew rom. (#94) 2019-10-03 01:30:13 +08:00
cmd Merge aspect ratio to master (#116) 2019-10-19 02:29:07 +08:00
docs Refactor of cloud game overlord and overworker (#70) 2019-09-12 03:35:21 +08:00
hack Refactor of cloud game overlord and overworker (#70) 2019-09-12 03:35:21 +08:00
pkg Merge aspect ratio to master (#116) 2019-10-19 02:29:07 +08:00
tests/e2e Refactor of cloud game overlord and overworker (#70) 2019-09-12 03:35:21 +08:00
vendor Add C vendor 2019-09-12 04:06:26 +08:00
web Join same room when giving roomID (#111) 2019-10-17 03:49:24 +08:00
.dockerignore Improve performance (#92) 2019-09-30 02:17:38 +08:00
.gitattributes Update new frontend (#38) 2019-05-25 13:16:32 +08:00
.gitignore Improve performance (#92) 2019-09-30 02:17:38 +08:00
_config.yml Set theme jekyll-theme-cayman 2019-07-25 15:25:41 +08:00
Dockerfile Update readme spawn docker (#89) 2019-09-22 04:12:38 +08:00
go.mod Merge aspect ratio to master (#116) 2019-10-19 02:29:07 +08:00
go.sum Merge aspect ratio to master (#116) 2019-10-19 02:29:07 +08:00
LICENSE Update LICENSE 2019-04-11 02:13:48 +08:00
Makefile Use homebrew rom. (#94) 2019-10-03 01:30:13 +08:00
README.md Update collaborative playing 2019-10-18 00:42:24 +08:00

CloudRetro

Open-source Cloud Gaming Service For Retro Games
Video demo: https://www.youtube.com/watch?v=GUBrJGAxZZg

Introduction

This project aims to experiment Cloud-gaming performance with WebRTC and libretro, as well as trying to deliver the most modern and convenient gaming experience through the technology. Theoretically, games are run on remote servers and media are streamed to the player optimally to ensure the most comfortable user interaction. It opens the ability to play any retro games on web-browser directly, which are fully compatible with multi-platform like Desktop, Android, IOS. This flexibility also enables online gaming experience to retro games.

Try the service at

http://cloudretro.io
Chrome and Chrome on Android is recommended. It's not working on iPhone and some other explorers. Click help button in the game UI to see keyboard mapping.

*In ideal network condition and less resource contention on servers, the game will run smoothly as in the video demo. Because I only hosted the platform on limited servers in US East, US West, Eu, Singapore, you may experience some latency issues + connection problem. You can try hosting the service following the instruction the next section to have a better sense of performance.

Screenshot Screenshot
screenshot screenshot
screenshot screenshot

Feature

  1. Cloud gaming: Game logic and storage is hosted on cloud service. It reduces the cumbersome of game initialization. Images and audio are streamed to user in the most optimal way using advanced encoding technology.
  2. Cross-platform compatibility: The game is run on web browser, the most universal built-in app. No console, plugin, external app or devices are needed. Chrome with the latest version and fully WebRTC support is recommended for the game.
  3. Emulator agnostic: The game can be played directly without any extra effort to set up the gaming emulator or platform.
  4. Collaborate gameplay: Follow the idea of "Twitch Plays Pokemon", multiple players can play the same game together by addressing the same deeplink. The game experience is powered by cloud-gaming, so it's even smoother and diverse than "Twitch Plays Pokemon".
    Try Play Pokemon Emerald Together
  5. Vertically scaled: The infrastructure is designed to be able to scale under high traffic by adding more instances.
  6. Cloud storage: Game state is storing on online storage, so you can come back and continue playing your incomplete game later.
  7. Online multiplayer: Bring online multiplayer gaming to retro games. (In Road map)

Run on local by Docker

You try running the server directly by make dev.run-docker. It will spawn a docker environment and you can access the service on localhost:8000.

Development environment

Install Golang https://golang.org/doc/install . Because the project uses GoModule, so it requires Go1.11 version.

(Optional) Setup MSYS2 (MinGW) environment if you are using Windows:

  • Please refer to the Libretro doc for initial environment setup
  • Add Golang installation path into your .bashrc
    $ echo 'export PATH=/c/Go/bin:$PATH' >> ~/.bashrc
    
  • Install dependencies as described down bellow
  • Copy required Libretro Core DLLs into the cloud-game\assets\emulator\libretro\cores folder and replace existing Linux SOs in the cloud-game\pkg\config\config.go EmulatorConfig object.
  • Use C:\msys64\mingw64.exe for building
  • To run the app use either MinGw terminal or copy: libdl.dll, libogg-0.dll, libopenal-1.dll, libopus-0.dll, libopusfile-0.dll, libvpx-1.dll files from C:\msys64\mingw64\bin into the ./bin folder and then run.

Install dependencies

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

# MacOS
brew install libvpx pkg-config opus opusfile

# Windows (MSYS2)
pacman -S --noconfirm --needed git make mingw-w64-x86_64-toolchain mingw-w64-x86_64-pkg-config mingw-w64-x86_64-dlfcn mingw-w64-x86_64-libvpx mingw-w64-x86_64-opusfile

Because the coordinator and workers need to run simultaneously. Workers connect to the coordinator.

  1. Script
  • make dev.run
  • The scripts spawns 2 processes one in the background and one in foreground
  1. Manual
  • Need to run coordinator and worker separately in two session
  • go run cmd/overlord/main.go - spawn coordinator
  • go run cmd/overworker/main.go --overlordhost ws://localhost:8000/wso - spawn workers connecting to coordinator

Wiki

FAQ

Contribution

  • The project cannot be possible without the contribution with those amazing people:
  • sadlil for massive code structure reogranization; log and monitor server introduction.
  • sergystepanov for Audio re-implementation; bilinear, nearest neighbor interpolation scaling; Window setup document.

Credits

Author

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

Tri Dang Minh
https://trich.im