2026-spring-project

Project progress — 4/16/25

This document summarizes the indep repository as of the current tree: layout, implemented features, the server-side map/entity graph model, and practical build-system notes.


Repository layout

Area Role
server/ Go HTTP + WebSocket game server, SQLite auth DB, lobby/simulation logic (main.go, game.go, auth.go, db.go, HTML shells).
client_wasm/ Emscripten + raylib C++ client: 3D scenes, menu, WebSocket bridge to the server (main.cpp, ws_init.hpp, GameState.hpp, headers for scenes/camera).

There is no single top-level Makefile tying server and client together; each half is built with its own toolchain.


Features implemented so far

Server (server/)

Client (client_wasm/)

Auth / security notes (current design)


Map and entity data structures (server game.go)

The game world is modeled as a directed graph of rooms with entities stored per room and a tracker for fast lookup and movement history.

GameGraphNode (map / room graph)

Each node is one navigable room (or chokepoint such as a door):

Field Meaning
RoomID Numeric room id (some P2 nodes still use placeholder 100 in the graph builder).
AliasName Stable string key used by the server and client ("stage", "party_room", "lhs_door", …) for camera checks and tooling.
Entities Slice of Entity currently standing in this node (denormalized list on the graph).
NextNodes Outgoing edges: possible forward destinations from this room.
PrevNode Set by AddNext to the last parent that linked this node (useful for debugging; not a full multi-parent representation — the graph is authored as a tree/DAG from code).
IsBlocked If true, movement into this node from a parent is treated as blocked (e.g. door closed); EntityTracker.MoveEntity resets the entity toward its path start when the chosen next node is blocked.

Construction

Lookup

Entity (character / animatronic record)

Field Meaning
Id, Name Identity for logs and wire formats (camera check).
AggressionMultiple, Position, TimeInRoom Reserved / future tuning (not central to current movement logic).
PreferredNextIndex Chooses which NextNodes[index] to follow when moving; falls back to index 0 if out of range.

EntityTracker

SpawnEntities

GameState


Build system — challenges and how things fit together

Two independent stacks

  1. Go server — run from server/ with Go 1.19+ (go.mod). Depends on CGO for SQLite (github.com/mattn/go-sqlite3): you need a C toolchain (gcc) on the build machine; cross-compiling with CGO is extra friction.
  2. C++ Web client — CMake + Emscripten + raylib (client_wasm/CMakeLists.txt). Desktop builds can use system raylib or FetchContent to download raylib 5.5.

client_wasm / Emscripten + raylib

Go module naming

Operational gaps to be aware of


Suggested next steps (optional)


This file is a snapshot of the repository structure and behavior described in source; re-run builds and grep for Step( / action when verifying sim and control features on your branch.