A Rust game engine built on the Entity Component System (ECS) design pattern, with a wgpu renderer, winit windowing, and an imgui debug UI.
flowchart LR
PEERS["Game peers (players)"] -->|"Create/Join lobby"| MM["Matchmaker"]
MM -->|"MatchStart + endpoints"| HOST["Host peer"]
MM -->|"MatchStart + endpoints"| CLIENT["Client peer(s)"]
CLIENT -->|"Input"| HOST
HOST -->|"Replicated state / corrections"| CLIENT
flowchart TD
LOOP["Event loop"] --> UPDATE["Update systems"]
UPDATE --> WORLD["World state"]
WORLD --> DRAW["Build draw commands"]
DRAW --> RENDER["Render frame (wgpu + optional imgui)"]
# terminal 1: matchmaker (listen on all interfaces)
cargo run --bin matchmaker -- --bind 0.0.0.0:7000
# terminal 2: player client (launcher UI)
cargo run --bin game
# optional: override default gameplay UDP port (default is 7001)
cargo run --bin game -- --game-port 7010Enter 127.0.0.1:7000 as the matchmaker address and click "Connect", then proceed to create or join a lobby.
If the client runs on another machine, replace 127.0.0.1 with the matchmaker host's LAN IP.
The demo uses UDP:
7000for matchmaker7001for gameplay peers by default (--game-portchanges this)
Open these ports on every machine that hosts matchmaker or runs a player client.
Windows (PowerShell as Administrator):
netsh advfirewall firewall add rule name="Forge Matchmaker UDP 7000 In" dir=in action=allow protocol=UDP localport=7000 profile=private
netsh advfirewall firewall add rule name="Forge Matchmaker UDP 7000 Out" dir=out action=allow protocol=UDP localport=7000 profile=private
netsh advfirewall firewall add rule name="Forge Gameplay UDP 7001 In" dir=in action=allow protocol=UDP localport=7001 profile=private
netsh advfirewall firewall add rule name="Forge Gameplay UDP 7001 Out" dir=out action=allow protocol=UDP localport=7001 profile=privateLinux (ufw):
sudo ufw allow 7000/udp
sudo ufw allow 7001/udp
sudo ufw reloadLinux (firewalld):
sudo firewall-cmd --permanent --add-port=7000/udp
sudo firewall-cmd --permanent --add-port=7001/udp
sudo firewall-cmd --reloadIf you run clients with a non-default gameplay port, open that UDP port instead of 7001.
cargo run --bin demoRequires a working GPU with Vulkan, DX12, or Metal support.
The demo opens a 1280x720 window showing two oscillating shapes:
- An orange circle on the left
- A blue rectangle on the right
The "Entity Colors" imgui window (top-left) lets you:
- Edit RGBA colors for each shape live
- Adjust oscillation frequency (0.1 - 5.0 Hz)
- Adjust oscillation amplitude (10 - 400 px)