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
+67
View File
@@ -0,0 +1,67 @@
class_name GameOpts
extends RefCounted
## Process-wide options parsed from the command line.
##
## These are per-machine settings and must never affect the simulation -- if a
## value would change how the world evolves, it belongs in [SimConfig] so server
## and client cannot disagree about it.
static var is_server: bool = false
static var port: int = Protocol.DEFAULT_PORT
static var host_address: String = "127.0.0.1"
static var player_name: String = "player"
## Replaces keyboard input with a scripted loop so CI can play the game with no
## display. See `tools/smoke.sh`.
static var bot_client: bool = false
## Quit after this many physics ticks. 0 = run forever.
static var autoquit_ticks: int = 0
## Skip the menu and connect straight away. Implied by --bot.
static var autojoin: bool = false
## Skip the menu and start a listen server (host + local player).
static var listen: bool = false
## Server-side dev switch: new dungeons open straight onto the boss, skipping
## the trash waves. For iterating on a pattern without clearing two waves first.
static var boss_rush: bool = false
static var parsed: bool = false
static func parse(argv: PackedStringArray = PackedStringArray()) -> void:
if argv.is_empty():
argv = OS.get_cmdline_user_args()
var i := 0
while i < argv.size():
match argv[i]:
"--server":
is_server = true
"--bot":
bot_client = true
autojoin = true
"--join":
autojoin = true
"--listen":
listen = true
"--boss-rush":
boss_rush = true
"--port":
i += 1
if i < argv.size():
port = int(argv[i])
"--host":
i += 1
if i < argv.size():
host_address = argv[i]
"--name":
i += 1
if i < argv.size():
player_name = argv[i]
"--autoquit":
i += 1
if i < argv.size():
autoquit_ticks = int(argv[i])
"--verbose":
GameLog.min_level = GameLog.Level.DEBUG
"--quiet":
GameLog.min_level = GameLog.Level.WARN
i += 1
GameLog.role_tag = "server" if is_server else "client"
parsed = true