https://github.com/cryptojones/xspacewar-ai
A modern, AI-driven networked space-fighter — a 2026 reimagining of the classic networked Spacewar!
https://github.com/cryptojones/xspacewar-ai
Last synced: 7 days ago
JSON representation
A modern, AI-driven networked space-fighter — a 2026 reimagining of the classic networked Spacewar!
- Host: GitHub
- URL: https://github.com/cryptojones/xspacewar-ai
- Owner: CryptoJones
- License: apache-2.0
- Created: 2026-06-11T14:15:56.000Z (8 days ago)
- Default Branch: main
- Last Pushed: 2026-06-11T16:16:58.000Z (8 days ago)
- Last Synced: 2026-06-11T16:18:12.287Z (8 days ago)
- Language: GDScript
- Homepage:
- Size: 85 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Notice: NOTICE
Awesome Lists containing this project
README
# XSpaceWar-AI
[](https://github.com/CryptoJones/XSpaceWar-AI/actions/workflows/ci.yml)
[](https://github.com/CryptoJones/XSpaceWar-AI/releases/latest)
[](LICENSE)
[](https://godotengine.org)
[](https://github.com/CryptoJones/XSpaceWar-AI/releases/latest)
[](https://codeberg.org/CryptoJones/XSpaceWar-AI)
A modern, AAA-styled networked **space-fighter** with a strong AI focus — a
2026 reimagining of the classic networked *Spacewar!* / `xspacewar`. Bird's-eye
view like the original, but with
**space-accurate Newtonian physics**, **100% procedurally-generated graphics**
(no hand-drawn art assets), and **LAN + internet multiplayer for up to 16
ships**.
Built with **Godot 4** for **Windows, Linux, and macOS**. Licensed under
**Apache 2.0**.
## Screenshots
A free-for-all dogfight — sixteen distinct ship colors, kill feed, live
scoreboard, and the minimap:

The gravity well takes another victim:

---
## Heritage
XSpaceWar-AI stands on the shoulders of one of gaming's oldest lineages:
- **Spacewar!** — MIT, 1962, on the DEC **PDP-1** (Steve Russell et al.).
- **PDP-11 port** — Bill Seiler & Larry Bryant, 1974. The networked
space-fighter spirit this project carries forward.
- **xspacewar 1.2** — an **X11/C** version written by **Ron Frederick** in
**1992**, an early *serverless* networked multiplayer game where peers shared
state directly (IP unicast/multicast) and each client simulated independently.
This is an **original clean-room implementation** — see [`NOTICE`](NOTICE) for
full attribution. Huge thanks to **Ron Frederick**
([github.com/ronf](https://github.com/ronf) ·
[webrtc-spacewar](https://github.com/ronf/webrtc-spacewar) ·
[timeheart.net/spacewar](https://www.timeheart.net/spacewar)) whose 1992
networked Spacewar is this game's direct ancestor.
## Features
- Top-down arena dogfights around a gravity well, up to **16 ships**.
- Modern **Newtonian** flight — conserved momentum, inverse-square gravity on
ships *and* torpedoes, gravity-assist slingshots, hyperspace.
- **Procedurally generated everything** — stars, planets, moons, asteroid
fields, nebulae, ships, VFX, *and audio* (every sound is synthesized from
math at load) — every match a new seeded arena.
- **Game modes:** Free-for-all, Team battle, AI bots (Rookie → Insane), and
**Movie Mode** — an all-AI spectator attract that regenerates a fresh
arena, roster, and teams every 30 minutes.
- **Multiplayer (working today):** host-authoritative netcode with
client-side prediction + reconciliation, automatic **LAN discovery**,
**direct IP**, and platform-agnostic **internet play** via this repo's own
relay/master server — room codes, an online server browser, and no port
forwarding or platform services required.
## Multiplayer quick start
- **LAN:** one player clicks *HOST — LAN skirmish*; everyone else sees the
game in the menu's server list (or uses *JOIN IP*).
- **Internet:** run the relay on any mutually reachable box (a $5 VPS works):
```bash
godot --headless --path . --script res://server/relay_main.gd -- --port 24645
```
Players put `that-box:24645` in the relay field (or set `XSW_RELAY`), the
host clicks *HOST ONLINE* and shares the 4-letter room code, friends use
*JOIN CODE* or *BROWSE* (tick *Spectate* to watch without taking a ship).
Full deployment guide (firewall, systemd): [`server/README.md`](server/README.md).
- **Ports** (all UDP): `24642` game host (open this inbound to host
direct-internet games; LAN needs nothing) · `24643` LAN discovery
broadcast (never leaves your subnet) · `24645` relay server (open on
the VPS; relay *players* need no port forwarding at all).
## Project layout
```
src/sim/ Deterministic, render-free game simulation (fixed timestep)
src/net/ Host/join, LAN discovery, matchmaking, platform services
src/gameplay/ Game modes, AI bots, scoring, spawning
src/render/ Procedural shaders, particles, ship/starfield visuals
src/ui/ Menus, server browser, HUD, settings
server/ Standalone relay/master service
tests/ Headless simulation tests
build/ Export presets + CI scripts (Win/Linux/macOS)
```
The simulation in `src/sim/` is **deterministic and headless** (no rendering
deps, fixed timestep) so the authoritative host sim, client-side prediction,
AI, and replay all share one codebase.
## Getting the game
**Prebuilt binaries (no engine needed):** grab the zip for your platform from
the [Releases page](https://github.com/CryptoJones/XSpaceWar-AI/releases).
Every push to `main` also uploads fresh builds as artifacts on the
[Actions tab](https://github.com/CryptoJones/XSpaceWar-AI/actions) (sign-in
required), e.g.:
```bash
gh run download --repo CryptoJones/XSpaceWar-AI -n xspacewar-ai-linux-x86_64
chmod +x xspacewar-ai.x86_64 && ./xspacewar-ai.x86_64
```
## Running from source
**Easiest:** the install script downloads Godot 4.6.3 (SHA-512 verified
against the official release sums), puts it on your PATH, and builds the
project's import cache:
```bash
./install.sh # Linux (x86_64/arm64) + macOS; safe to re-run
./install.sh --test # same, then prove it with the headless test suites
godot --path . # play
```
**Manual route** — the repo ships no engine binary; install **Godot 4.6.x**
(standard build, not .NET) from the
[official releases](https://github.com/godotengine/godot/releases/tag/4.6.3-stable):
```bash
# Linux example
mkdir -p ~/tools/godot ~/.local/bin && cd ~/tools/godot
curl -LO https://github.com/godotengine/godot/releases/download/4.6.3-stable/Godot_v4.6.3-stable_linux.x86_64.zip
unzip Godot_v4.6.3-stable_linux.x86_64.zip && mv Godot_v4.6.3-stable_linux.x86_64 godot
# Put `godot` on your PATH (most distros include ~/.local/bin already):
ln -sf ~/tools/godot/godot ~/.local/bin/godot
godot --version # if "command not found", open a new shell or use the
# full path ~/tools/godot/godot in the commands below
```
(Windows: `Godot_v4.6.3-stable_win64.exe.zip` · macOS:
`Godot_v4.6.3-stable_macos.universal.zip` — same page.)
```bash
# One-time after cloning (or pulling big changes): build the import cache.
# Skipping this can give you a black screen / missing resources on launch.
godot --headless --path . --import
# Run the game
godot --path .
# Run the headless test suites
godot --headless --path . --script res://tests/run_tests.gd # sim
godot --headless --path . --script res://tests/net_tests.gd # LAN netcode
godot --headless --path . --script res://tests/relay_tests.gd # online relay
godot --headless --path . --script res://tests/audio_tests.gd # synthesis
godot --headless --path . --script res://tests/scene_smoke.gd # scene boot
# Export release builds locally (needs export templates installed)
build/export_all.sh
```
## Performance on weak GPUs
On bottom-tier integrated graphics (e.g. Intel UHD GT1) the default
Vulkan renderer can stall — the window freezes while the process lives.
The game auto-disables its HDR glow on such adapters, but the robust fix
is the lightweight OpenGL renderer:
```bash
godot --path . --rendering-method gl_compatibility
```
Keeping the OPTIONS → Nebula slider at 0 also helps — the nebula is the
most expensive pixel work in the game.
## Thanks
To our play testers, who flew the rough builds and filed the truth:
**Claude Fable 5**, **Trevor Flurry**, **Patrick Hannah**, and
**Adam Testagrossa**.
## Dedication
To "JVL / Boxest" for all the nights we stayed up playing Ron Fredrick's game
in 90s-era Dickinson, Texas.
HTMFPWGCBNOTDOD!
## Mirrors
- GitHub: https://github.com/CryptoJones/XSpaceWar-AI
- Codeberg: https://codeberg.org/CryptoJones/XSpaceWar-AI (auto-synced)
## License
Apache License 2.0 — see [`LICENSE`](LICENSE) and [`NOTICE`](NOTICE).
Proudly Made in Nebraska. Go Big Red! 🌽 https://xkcd.com/2347/