Initial commit: Transcience MVP

Top-down twin-stick bullet-hell, Godot 4.7, server-authoritative dedicated
server with client-side prediction. Clients send input only; the server
resolves every hit for both players and enemies (no PvP).

- SimWorld: whole simulation as plain RefCounted objects (no nodes, no
  physics server), ~0.24ms/tick at peak load -- runs headless for free and
  drives 78 tests in under a second
- BulletPool: struct-of-arrays bullet storage, replicated as spawn/despawn
  events rather than per-tick state
- Emitter framework (Ring/AimedSpread/WallGap/ArcSweep) shared by trash
  enemies and bosses -- a new boss is data in src/content/content.gd, no
  simulation changes
- The Warden of the Fold: stationary 4-phase boss built entirely on that
  format
- Lobby hub with a portal into on-demand dungeon instances; one process
  hosts the hub plus every concurrent dungeon
- Emergency escape: 3s server-owned channel, cancelled by damage
- tools/check.sh, test.sh (GUT), smoke.sh (real server + bot clients over
  ENet), bench.gd; git hooks wired to the same scripts
- docs/ARCHITECTURE.md, NETCODE.md, WORKFLOW.md, ROADMAP.md
This commit is contained in:
2026-09-03 16:03:57 +02:00
commit c4beeae38f
385 changed files with 28725 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
class_name Protocol
extends RefCounted
## Wire constants. Bump [constant VERSION] whenever a codec layout changes; the
## server refuses mismatched clients at handshake rather than desyncing later.
const VERSION := 1
const DEFAULT_PORT := 27015
const MAX_CLIENTS := 32
## ENet channels. Separating them stops a burst of reliable bullet events from
## head-of-line blocking the unreliable snapshot stream.
const CH_CONTROL := 1 ## handshake, instance transitions -- reliable
const CH_SNAPSHOT := 2 ## world state -- unreliable, newest wins
const CH_EVENTS := 3 ## bullet spawns/despawns, hits -- reliable ordered
const CH_INPUT := 4 ## client -> server intent -- unreliable ordered
## Must be identical on both ends, and larger than the highest channel above.
const CHANNEL_COUNT := 8
enum InstanceKind { LOBBY, DUNGEON }
## Player flags packed into the snapshot's per-player byte.
const F_ALIVE := 1
const F_INVULN := 2
const F_ESCAPING := 4