Apache License 2.0

项目介绍

giongto35/cloud-game 是一个托管在 GitHub 上的开源项目,主要使用 Go 编写,采用 Apache License 2.0 许可证,目前获得 2.5k 个 Star、387 次 Fork。

仓库全名
giongto35/cloud-game
开源许可证
Apache License 2.0
Star 数
2.5k
Fork 数
387
未关闭 Issue
6

README 摘要

CloudRetro Open-source Cloud Gaming Service For Retro Games Video demo: https://www.youtube.com/watch?v=GUBrJGAxZZg Technical wrapup: https://webrtchacks.com/open-source-cloud-gaming-with-webrtc/ CloudMorph: https://github.com/giongto35/cloud-morph: My current focus on generic solution for cloudgaming Discord: Join Us Try it at cloudretro.io Direct play an existing game: Pokemon Emerald) Introduction CloudRetro…

完整内容见 GitHub 原始 README 或本页 。

常见问题

cloud-game 用什么语言开发?

主要使用 Go 编写,采用 Apache License 2.0 许可证,目前有 2.5k 个 Star。

cloud-game 可以免费商用吗?

仓库采用 Apache License 2.0 许可证,可免费使用与修改,商业使用请遵守许可证条款(例如保留版权声明与许可声明)。

如何获取 cloud-game 的源码?

可以直接克隆仓库:git clone https://github.com/giongto35/cloud-game.git,默认分支为 master;安装与运行步骤见仓库 README。

cloud-game 最近还在维护吗?

仓库最近一次更新为 1 周前,当前有 6 个未关闭 Issue;Star 数为 2.5k,可作为社区活跃度的参考。

关于

GitHub 原始描述(英文)

Web-based Cloud Gaming service for Retro Game

描述取自 GitHub 官方 API,保持仓库作者书写的原文。

语言占比

C
CSS
Dockerfile
Go
HTML
JavaScript
Makefile
Shell

Release

README

CloudRetro

Build Latest release

Open-source Cloud Gaming Service For Retro Games
Video demo: https://www.youtube.com/watch?v=GUBrJGAxZZg
Technical wrapup: https://webrtchacks.com/open-source-cloud-gaming-with-webrtc/
CloudMorph: https://github.com/giongto35/cloud-morph: My current focus on generic solution for cloudgaming

Discord: Join Us

screenshot

Try it at cloudretro.io

Direct play an existing game: Pokemon Emerald

Introduction

CloudRetro provides an open-source cloud gaming platform for retro games. It started as an experiment for testing cloud gaming performance with WebRTC and Libretro, and now it aims to deliver the most modern and convenient gaming experience through the technology.

Theoretically, in cloud gaming, 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.

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.

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.
  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 crowdplay(TwitchPlaysPokemon), multiple players can play the same game together by addressing the same deeplink. The game experience is powered by cloud-gaming, so the game is much smoother. Check CrowdPlay section
  5. Online multiplayer: The first time in history, you can play multiplayer on Retro games online. You can try Samurai Showndown with 2 players for fighting game example.
  6. Horizontally scaled: The infrastructure is designed to be able to scale under high traffic by adding more instances.
  7. Cloud storage: Game state is storing on online storage, so you can come back and continue playing your incomplete game later.

Development environment

  • Install Go
  • Install GStreamer
# Ubuntu / Windows (WSL2)
apt-get install -y make gcc pkg-config libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev gstreamer1.0-plugins-good

# macOS
brew install pkg-config gstreamer gst-plugins-base gst-plugins-good

# Windows (MSYS2)
pacman -Sy --noconfirm --needed git make mingw-w64-ucrt-x86_64-{gcc,pkgconf,gstreamer,gst-plugins-base,gst-plugins-good}

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/coordinator/main.go - spawn coordinator
  • go run cmd/worker/main.go --coordinatorhost localhost:8000 - spawn workers connecting to coordinator

Additionally, you may install and configure an X Server display in order to be able to run OpenGL cores. See the docker-compose.yml file for Xvfb example config.

Run with Docker

Use makefile script: make dev.run-docker or Docker Compose directly: docker compose up --build. It will spawn a docker environment and you can access the service on localhost:8000.

Configuration

The default configuration file is stored in the pkg/config/config.yaml file. This configuration file will be embedded into the applications and loaded automatically during startup. In order to change the default parameters you can specify environment variables with the CLOUD_GAME_ prefix, or place a custom config.yaml file into one of these places: just near the application, .cr folder in user’s home, or specify own directory with -w-conf application param (worker -w-conf /usr/conf).

Deployment

See an example of deployment scripts if you want to try to host your own cloud-retro copy in the cloud. This script (deploy-app.sh) allows pushing configured application to the group of servers automatically. The cloud server should be any Debian-based system with the docker-compose application installed.

Technical documents

FAQ

Crowd Play, play game together

By clicking these deep link, you can join the game directly and play it together with other people.

And you can host the new game by yourself by accessing cloudretro.io and click “share” button to generate a permanent link to your game.

Credits

We are very much thankful to everyone we’ve been lucky to collaborate with and many people for help and inspiration from their awesome works.

Thanks:

Art

Announcement

CloudMorph is a sibling project that offers a more generic to run any offline games/application on browser in Cloud Gaming approach: https://github.com/giongto35/cloud-morph)

Team

Authors:

Maintainers:

评论

暂无评论