sour

sour

多平台现代化版 Cube 2 Sauerbraten 开源项目

Sour 是 Cube 2: Sauerbraten 的现代化多平台开源项目,通过单一 Docker 镜像实现部署。该项目提供完整的网页版游戏体验,支持移动设备,实现与桌面玩家的跨平台对战。Sour 具备先进的游戏服务器功能,包括服务器多路复用、私人游戏服务器创建、Discord 认证和持久化地图编辑等。此外,项目还包含处理 Sauerbraten 相关内容的工具和库,方便开发者使用和扩展。

SourSauerbraten多平台WebGL开源FPSGithub开源项目
<p align="center"> <h1>🍋Sour</h1> </p> <p align="center"> <a href="https://sourga.me" target="_blank"> <img src="gh-assets/header.png" alt="Sour Cover Image"> </a> </p> <p align="center"> <!-- Gitpod --> <a target="_blank" href="https://gitpod.io/#https://github.com/cfoust/sour"> <img src="https://img.shields.io/badge/gitpod-devenv-orange" alt="Sour Gitpod Development Environment" /> </a> <img src="https://img.shields.io/badge/TypeScript-007ACC?logo=typescript&logoColor=white" alt="TypeScript Language" /> <img src="https://img.shields.io/badge/Go-00ADD8?logo=go&logoColor=white" alt="Go Language" /> <img src="https://img.shields.io/badge/Google_Chrome-4285F4?logo=Google-chrome&logoColor=white" alt="Google Chrome" /> <img src="https://img.shields.io/badge/iOS-000000?logo=ios&logoColor=white" alt="iOS" /> <!-- LICENSE --> <a target="_blank" href="https://github.com/cfoust/sour/blob/main/LICENSE"> <img src="https://img.shields.io/github/license/cfoust/sour" alt="Sour License Badge MIT" /> </a> <!-- Discord --> <a target="_blank" href="https://discord.gg/WP3EbYym4M"> <img src="https://img.shields.io/discord/1071091858576523274?label=discord&logo=discord&style=social" /> </a> <!-- Github Action Build--> <a target="_blank" href="https://github.com/cfoust/sour/actions/workflows/ci.yml"> <img src="https://github.com/cfoust/sour/actions/workflows/ci.yml/badge.svg" /> </a> </p> <p align="center"> Sour is a multiplatform modernization of <a target="_blank" href="http://sauerbraten.org/">Cube 2: Sauerbraten</a> delivered as a single Docker image. <a target="_blank" href="https://sourga.me/">Give it a try.</a> </p>

Features

  • A complete web version of Sauerbraten
    • All original game assets and features
    • Support for mobile devices
    • Connect to all existing Sauerbraten community servers and crossplay with desktop players
    • Open and play back Sauerbraten demos by dragging them to the page
    • Arbitrary game mods
    • Sophisticated load-on-demand system for assets that allows for loading arbitrary content that has been packaged for the game
    • Links to servers (/server/[ip]/[port]) and maps (/map/complex)
  • An advanced Sauerbraten game server
    • Supports connections both from the web and from desktop Sauerbraten clients
    • Server multiplexing: you can run arbitrary game servers with their own maps, modes, and configurations and allow users to move between them without disconnecting from the server
    • Players can create private game servers and invite other players on-demand
    • Discord authentication both for web and desktop clients
    • 1v1 matchmaking and persistent ELO scores for users
    • Persistent map editing: edits users make to maps are stored on the server side and visible to other clients who join (no more /getmap and /sendmap)
    • User-owned spaces that they can edit (player housing, basically)
    • User sessions can be saved as demos for debugging
    • Automatically sends game maps to desktop clients that don't have them
    • Mechanism for running client-side CubeScript on desktop clients
  • Utilities and libraries for working with Sauerbraten
    • sourdump, a tool for calculating all of the files a Sauerbraten map, model, or .cfg file uses so that you can only send the minimum set of assets a client needs
    • Go library for opening, manipulating, and saving Sauerbraten game maps
    • Go library providing interoperation between Go and CubeScript

Goals

  • Modernize Sauerbraten. The gaming landscape has changed. Provide a modern multiplayer experience with matchmaking, private games, rankings, and seamless collaboration on maps. Make as much of this functionality available to the unmodified desktop game as possible.
  • Preserve the experience of playing the original game. While it is possible that Sour may someday support arbitrary game modes, assets, clients, and server code, the vanilla game experience should still be available.
  • Be the best example of a cross-platform, open-source FPS. Deployment of Sour on your own infrastructure with whatever configuration you like should be easy. Every aspect of Sour should be configurable.

Running

docker run --rm -it -p 1234:1234 -p 28785:28785/udp ghcr.io/cfoust/sour

You can then access Sour at http://localhost:1234/ or by connecting in the desktop client with /connect localhost.

Deploying

If you wish to deploy Sour more seriously, I provide an example configuration for docker-compose here using letsencrypt-nginx-sidecar.

Architecture

Here is a high level description of the repository's contents:

  • services/game: All of the Cube 2 code and Emscripten compilation scripts. Originally this was a fork of BananaBread, kripken's original attempt at compiling Sauerbraten for the web. Since then I have upgraded the game to the newest mainline version several times and moved to WebGL2.
  • services/go/: All Go code used in Sour and its services.
    • A Go program that calculates the minimum list of files necessary for the game to load a given map.
    • The Sour game server, which provides a number of services to web clients:
      • Gives clients both on the web and desktop client access to game servers managed by Sour.
      • Periodically fetches Sauerbraten server information from the master server, pings all of the available servers, and broadcasts the results to web clients. This is so we can fill in the server browser.
  • services/assets: Scripts for building web-compatible game assets. This is an extremely complicated topic and easily the most difficult aspect of shipping Sauerbraten to the web. Check out this section's README for more information.
  • services/ingress/: nginx configurations for development, production, and Gitpod.
  • services/proxy/: A fork of wsproxy. This allows web clients to connect to all of the existing Sauerbraten servers and crossplay with desktop clients.
  • services/client/: A React web application that controls Sauerbraten, pulls assets, and proxies all game communication over WebSockets.

Contributing

Join us on Discord to chat with us and see how you can help out! Check out the issues tab to get an idea of what needs doing.

The easiest way to hack on Sour is in Gitpod using the button below. Gitpod is a web-based VSCode environment that runs everything necessary for development in a cloud-based container, meaning that everything is set up and working for you right away. You do not even have to use VSCode; Gitpod supports custom dotfiles which allows me to use my full vim-based setup from a browser tab.

Open in Gitpod

If you want to run things locally all you need is Docker, Earthly, and docker-compose. After that, just run ./serve. Then navigate to http://localhost:1234. All of the game's services will recompile and restart when you make changes.

Inspiration

Some years ago I came across BananaBread, which was a basic tech demo that used Emscripten to compile Sauerbraten for the web. The project was limited in scope and done at a time when bandwidth was a lot more precious.

License

Each project that was forked into this repository has its own original license intact, though the glue code and subsequent modifications I have made are licensed according to the MIT license specified in LICENSE.

编辑推荐精选

商汤小浣熊

商汤小浣熊

最强AI数据分析助手

小浣熊家族Raccoon,您的AI智能助手,致力于通过先进的人工智能技术,为用户提供高效、便捷的智能服务。无论是日常咨询还是专业问题解答,小浣熊都能以快速、准确的响应满足您的需求,让您的生活更加智能便捷。

imini AI

imini AI

像人一样思考的AI智能体

imini 是一款超级AI智能体,能根据人类指令,自主思考、自主完成、并且交付结果的AI智能体。

Keevx

Keevx

AI数字人视频创作平台

Keevx 一款开箱即用的AI数字人视频创作平台,广泛适用于电商广告、企业培训与社媒宣传,让全球企业与个人创作者无需拍摄剪辑,就能快速生成多语言、高质量的专业视频。

即梦AI

即梦AI

一站式AI创作平台

提供 AI 驱动的图片、视频生成及数字人等功能,助力创意创作

扣子-AI办公

扣子-AI办公

AI办公助手,复杂任务高效处理

AI办公助手,复杂任务高效处理。办公效率低?扣子空间AI助手支持播客生成、PPT制作、网页开发及报告写作,覆盖科研、商业、舆情等领域的专家Agent 7x24小时响应,生活工作无缝切换,提升50%效率!

TRAE编程

TRAE编程

AI辅助编程,代码自动修复

Trae是一种自适应的集成开发环境(IDE),通过自动化和多元协作改变开发流程。利用Trae,团队能够更快速、精确地编写和部署代码,从而提高编程效率和项目交付速度。Trae具备上下文感知和代码自动完成功能,是提升开发效率的理想工具。

AI工具TraeAI IDE协作生产力转型热门
蛙蛙写作

蛙蛙写作

AI小说写作助手,一站式润色、改写、扩写

蛙蛙写作—国内先进的AI写作平台,涵盖小说、学术、社交媒体等多场景。提供续写、改写、润色等功能,助力创作者高效优化写作流程。界面简洁,功能全面,适合各类写作者提升内容品质和工作效率。

AI辅助写作AI工具蛙蛙写作AI写作工具学术助手办公助手营销助手AI助手
问小白

问小白

全能AI智能助手,随时解答生活与工作的多样问题

问小白,由元石科技研发的AI智能助手,快速准确地解答各种生活和工作问题,包括但不限于搜索、规划和社交互动,帮助用户在日常生活中提高效率,轻松管理个人事务。

热门AI助手AI对话AI工具聊天机器人
Transly

Transly

实时语音翻译/同声传译工具

Transly是一个多场景的AI大语言模型驱动的同声传译、专业翻译助手,它拥有超精准的音频识别翻译能力,几乎零延迟的使用体验和支持多国语言可以让你带它走遍全球,无论你是留学生、商务人士、韩剧美剧爱好者,还是出国游玩、多国会议、跨国追星等等,都可以满足你所有需要同传的场景需求,线上线下通用,扫除语言障碍,让全世界的语言交流不再有国界。

讯飞智文

讯飞智文

一键生成PPT和Word,让学习生活更轻松

讯飞智文是一个利用 AI 技术的项目,能够帮助用户生成 PPT 以及各类文档。无论是商业领域的市场分析报告、年度目标制定,还是学生群体的职业生涯规划、实习避坑指南,亦或是活动策划、旅游攻略等内容,它都能提供支持,帮助用户精准表达,轻松呈现各种信息。

AI办公办公工具AI工具讯飞智文AI在线生成PPTAI撰写助手多语种文档生成AI自动配图热门
下拉加载更多