English | 日本語
Authoritative game server for TriggerOn — a multiplayer networked FPS. Runs on Linux, deployed via Docker.
- Server-authoritative physics, movement, and combat simulation
- 32 Hz fixed tick rate with accumulator-based timestep
- UDP networking via ENet
- Team-based combat — RED vs BLUE with asymmetric weapon stats
- Up to 4 players concurrent
- Docker-ready with multi-stage build
Native build:
- Linux (Debian/Ubuntu recommended)
- g++ with C++17 support
- make
Docker build:
- Docker
make
./game_server --port=7777# Build
docker build -t triggeron-server .
# Run
docker run -p 7777:7777/udp triggeron-serverTo pull and run the published image from Docker Hub:
# docker-compose.yml
services:
game-server:
image: pisto3/triggeron_game_server:latest
ports:
- "7777:7777/udp"
restart: unless-stoppeddocker compose up -d| Option | Default | Description |
|---|---|---|
--port=XXXX |
7777 | UDP port to listen on |
| Parameter | Value |
|---|---|
| Tick rate | 32 Hz (31.25 ms/tick) |
| Max players | 4 |
The server follows a server-authoritative model:
- Client → Server:
InputCmd(24 bytes) — player intent only (movement axes, yaw/pitch, button bitfield) - Server → Client:
Snapshot— authoritative world state (positions, velocities, health, flags)
The server never trusts client positions. All movement, collision, and combat are simulated server-side from input commands.
Key components:
ENetServerNetwork— UDP peer management, packet routingGameServer— Per-player state (unordered_map<uint8_t, PlayerData>), physics tick, combat resolutionserver_collision.h— Header-only pure-math collision library (no DirectXMath)server_raycast.h— Weapon hit detection via raycasting
main.cpp Entry point, signal handling, main loop
Network/
├── game_server.h/cpp Core game logic, physics, combat
├── enet_server_network.h/cpp ENet UDP server implementation
├── net_common.h Protocol structs (shared with client)
├── net_packet.h Packet type enum (shared with client)
├── i_network.h Abstract network interface (shared with client)
├── map_colliders.h Map geometry (shared with client)
├── server_collision.h Collision math (server-only)
└── server_raycast.h Raycast hit detection (server-only)
ThirdParty/
├── enet/ ENet networking library
└── toml++/ TOML config parser (header-only)