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.

编辑推荐精选

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自动配图热门
讯飞星火

讯飞星火

深度推理能力全新升级,全面对标OpenAI o1

科大讯飞的星火大模型,支持语言理解、知识问答和文本创作等多功能,适用于多种文件和业务场景,提升办公和日常生活的效率。讯飞星火是一个提供丰富智能服务的平台,涵盖科技资讯、图像创作、写作辅助、编程解答、科研文献解读等功能,能为不同需求的用户提供便捷高效的帮助,助力用户轻松获取信息、解决问题,满足多样化使用场景。

热门AI开发模型训练AI工具讯飞星火大模型智能问答内容创作多语种支持智慧生活
Spark-TTS

Spark-TTS

一种基于大语言模型的高效单流解耦语音令牌文本到语音合成模型

Spark-TTS 是一个基于 PyTorch 的开源文本到语音合成项目,由多个知名机构联合参与。该项目提供了高效的 LLM(大语言模型)驱动的语音合成方案,支持语音克隆和语音创建功能,可通过命令行界面(CLI)和 Web UI 两种方式使用。用户可以根据需求调整语音的性别、音高、速度等参数,生成高质量的语音。该项目适用于多种场景,如有声读物制作、智能语音助手开发等。

咔片PPT

咔片PPT

AI助力,做PPT更简单!

咔片是一款轻量化在线演示设计工具,借助 AI 技术,实现从内容生成到智能设计的一站式 PPT 制作服务。支持多种文档格式导入生成 PPT,提供海量模板、智能美化、素材替换等功能,适用于销售、教师、学生等各类人群,能高效制作出高品质 PPT,满足不同场景演示需求。

讯飞绘文

讯飞绘文

选题、配图、成文,一站式创作,让内容运营更高效

讯飞绘文,一个AI集成平台,支持写作、选题、配图、排版和发布。高效生成适用于各类媒体的定制内容,加速品牌传播,提升内容营销效果。

热门AI辅助写作AI工具讯飞绘文内容运营AI创作个性化文章多平台分发AI助手
材料星

材料星

专业的AI公文写作平台,公文写作神器

AI 材料星,专业的 AI 公文写作辅助平台,为体制内工作人员提供高效的公文写作解决方案。拥有海量公文文库、9 大核心 AI 功能,支持 30 + 文稿类型生成,助力快速完成领导讲话、工作总结、述职报告等材料,提升办公效率,是体制打工人的得力写作神器。

下拉加载更多