免责声明:这是基于《红色井界》RA2WEB www.ra2web.com 的分析而开发,并意图基于最新的react和three版本进行重构。但请注意,本项目与运行在 www.ra2web.com 站点上的版本无关。
隆重感谢 Chronodivide 及其创始人,这是整个网页红警创意的来源。需要额外声明:Chronodivide 不是开源项目,本项目与其无关, 也未获其认可,本项目产生的BUG和功能不完善均不得引申为 Chronodivide 项目的不完善。参与本项目的开源社区成员 igofreely 宣称希望对齐 Chronodivide 官方版本(chronodivide.com),实现录像的兼容,并且提交了若干PR,尚不清楚这些代码是否涉及对 Chronodivide 项目的侵权,换言之您使用本项目亦有可能构成对 Chronodivide 项目的侵权,请谨慎。
本项目原则上不涉及对《红色警戒2》官方分发版本的逆向、反编译或者代码抄袭,亦坚决拒绝直接声称使用AI工具对《红色警戒2》项目进行逆向、反编译转录而生成的代码合入,仅在部分介绍文字使用了“红警”“红色警戒”或者“命令与征服”的字样作为介绍使用,如您是“红警”“红色警戒”或者“命令与征服”的版权相关方,认为不妥,可以随时联系我们删除。
本项目的 VXL 渲染借鉴了 OpenRA。MIX 加解密使用了 XCC 的 mix_decode.cpp(Olaf van der Spek,GPL-3.0 或更高版本)。按这些许可证的要求,本项目必须采用 GPL-3.0 或更严格的许可证,因此本项目使用 GPL-3.0。
红色警戒2网页版,一款经典的即时战略类游戏的完整TypeScript重构版本,使用React + TypeScript + Vite + Three.js构建。
Disclaimer
This project is developed based on analysis of RA2WEB(www.ra2web.com), with the intention of refactoring it using the latest versions of React and Three.js. Please note that this project is independent of the build hosted at www.ra2web.com.
Special thanks to Chronodivide and its creator, the origin of the web-based Red Alert concept. Additional notice: Chronodivide is not an open-source project. This project is not affiliated with, nor endorsed by Chronodivide. Any bugs or incomplete features present in this project shall not be attributed to deficiencies in the Chronodivide project. igofreely, an open-source community contributor to this project, has stated an intent to align with the official Chronodivide build (chronodivide.com) for replay compatibility and has submitted several pull requests. It remains unclear whether such code infringes upon the rights of the Chronodivide project. In other words, your use of this project may constitute infringement against Chronodivide; proceed with caution.
In principle, this project does not involve reverse engineering, decompilation, or code plagiarism of the official distributed release of Command & Conquer: Red Alert 2. We firmly reject merging code generated by claiming AI tools were used to reverse-engineer or transcribe decompiled assets from Red Alert 2. The terms "Red Alert", "Command & Conquer" are only used in descriptive text for introductory purposes. If you are a rights holder for "Red Alert" or "Command & Conquer" and object to such usage, you may contact us at any time to request removal.
VXL rendering in this project draws inspiration from OpenRA. MIX encryption and decryption is implemented based on mix_decode.cpp from XCC (Olaf van der Spek, GPL-3.0 or later). Pursuant to the requirements of these licenses, this project must be licensed under GPL-3.0 or a stricter license; accordingly, this project is released under GPL-3.0.
本项目是使用Typescript编写,目标是完全对标并超越“红色警戒2/尤里的复仇”的游戏逻辑,本地自行导入红色警戒2美术素材后,就可以获得类似红警2的游玩体验。当前项目还在开发中,并且已经支持完整遭遇战游玩、录像、弹幕红警对战等能力。
This project is written in TypeScript. Its goal is to fully match and surpass the game logic of Command & Conquer: Red Alert 2 / Yuri's Revenge. After you import Red Alert 2 art assets locally by yourself, you can get a gameplay experience similar to Red Alert 2. The project is still under active development, and it already supports full skirmish gameplay, replay files, and bullet-screen-style Red Alert multiplayer battles.
- 包管理与本地运行时:
Bun 1.3.10 - 开发服务器:
Vite 8.0.1 - UI:
React 19.2.4+react-dom 19.2.4 - 类型系统:
TypeScript 5.9.3 - 渲染:
three 0.183.2 - 自动化:
Playwright 1.58.2 - 默认开发和预览端口:
127.0.0.1:4000
Bun 1.3+- 现代浏览器,推荐 Chrome / Edge
- 浏览器需要支持:
WebGLWeb Audio APIFile System Access API
cd redalert2
bun install
bun run dev默认访问地址:
http://127.0.0.1:4000
生产构建与预览:
bun run build
bun run preview类型检查:
bun run typecheck:entry仓库当前已经不再只依赖手点验证。scripts/ 下维护了一组可直接执行的回归脚本,主要覆盖大厅、进图、机制和 tester 入口。
常用命令包括:
bun run debug:game-res-init
bun run debug:viewport
bun run debug:options
bun run debug:storage-explorer
bun run debug:skirmish
bun run debug:skirmish-lobby-data
bun run debug:victory-exit
bun run debug:superweapon
bun run debug:nuke
bun run debug:radiation
bun run debug:minimap-shroud
bun run debug:anti-air-hit
bun run debug:terror-drone
bun run debug:chrono-legionnaire
bun run debug:test-entries
bun run debug:tester-panels这些脚本的产物默认会写入 .artifacts/,便于回看截图和 JSON 结果。
主菜单中的测试入口目前分为三类:
- 素材测试
VXL测试SHP测试音频测试
- 机制测试
建筑测试载具测试步兵测试飞行器测试
- 场景测试
大厅测试世界测试移动测试
这些 tester 页面不是孤立 Demo,而是当前仓库里很重要的调试和回归入口。页面左侧面板状态会同步到调试状态对象,自动化脚本也会直接使用这些入口验证渲染和交互结果。
React 19.2.4TypeScript 5.9.3Vite 8.0.1three 0.183.2Bun 1.3.10Playwright 1.58.27z-wasmfile-system-access@ffmpeg/ffmpeg@ra2web/pcxfile@ra2web/wavefile
redalert2/
├── public/ 静态资源、配置、locale、遗留样式
├── scripts/ Playwright 自动化回归脚本
├── src/
│ ├── data/ 原版资源格式、编码、地图、VFS
│ ├── engine/ 渲染、音频、资源加载、底层引擎能力
│ ├── game/ 游戏逻辑、对象系统、触发器、规则、超武
│ ├── gui/ 主菜单、HUD、选项、游戏内 UI
│ ├── network/ 网络和联机相关基础设施
│ ├── tools/ 独立 tester 页面
│ └── util/ 通用工具
├── docs/ 对齐记录与工程说明
└── vite.config.ts 开发和构建配置
src/engine/
gfx/:three 渲染层、材质、批处理、viewport、lightingrenderable/:游戏对象到可视对象的桥接层sound/:音频混音、音乐、音效播放gameRes/:资源导入、CDN 加载、缓存与目录处理
src/game/
gameobject/:单位、建筑、抛射体、trait、locomotorrules/:INI 规则读取与对象规则构建trigger/:地图触发器、条件、执行器superweapon/:核弹、闪电风暴、超时空等超武逻辑
src/gui/
screen/mainMenu/:主菜单、地图选择、大厅、选项screen/game/:游戏内 HUD、世界交互、菜单component/:React 组件jsx/:自定义 UI 渲染桥接
src/tools/
- 提供素材、机制、场景三类 tester 页面
- 当前是调试结果可视化和自动化断言的重要入口
bun run dev
bun run build
bun run preview
bun run typecheck:entry- 开发端口固定为
4000 - 主要技术对齐记录维护在
docs/build-alignment-log.md - 自动化产物默认输出到
.artifacts/ - 构建通过并不等于所有行为已完全对齐,功能层面仍应优先参考专项脚本和实际流程验证
提交改动前,至少建议执行:
bun run typecheck:entry
bun run build如果改动涉及大厅、资源加载、进图、HUD、机制或 tester,请补跑相应的 debug:* 脚本。
本项目基于GNU General Public License v3.0(GPL-3.0)许可证开源。详见 LICENSE 文件。
- 可以自由使用、修改和分发,但禁止商用
- 必须保留版权声明和许可证文本
- 任何衍生作品必须使用相同的 GPL-3.0 许可证
- 必须提供源代码,包括修改后的版本
- 不能将 GPL 代码集成到专有软件中
注意: 本项目仅用于学习和研究目的,只维护引擎部分。红色警戒2游戏副本是EA公司的知识产权,导入美术素材时请确保拥有合法的游戏副本。
NOTE: This project is for educational and research purposes only, and only maintains the engine component. Copies of Command & Conquer: Red Alert 2 are intellectual property of Electronic Arts (EA). Please ensure you own a legitimate copy of the game before importing its art assets.
- Chronodivide
- 《红色井界》RA2WEB.COM
- Three.js 社区
- React 团队
- TypeScript 团队
- 相关开源依赖维护者
- 红警2/命令与征服/心灵终结/尤里的复仇 玩家社区
本项目仅供学习研究使用,不用于商业目的。



