feat: 3D blobber dungeon generator (PR 1)

Replaces the 2D-only demo pipeline with a 3D cell-based blobber
generator. Per-cell face walls, per-material mesh emission, and a
GDExtension binding that returns a Dictionary with ArrayMesh surfaces
the demo consumes directly.

- src/blobber/: cell3d_t data model, dungeon container, pipeline that
  wraps the 2D generator per level and materializes into cell3d
- src/mesh/: face-quad emitter with per-material groups + .obj dump
- src/genesis3d_main.c: new CLI driving the blobber + mesh
- godot/: BrogueGen.generate_dungeon(seed, num_levels, depth) binding
  with dungeon_to_dict packing cells + mesh surfaces
- demo/: demo_blobber.tscn + dungeon_builder.gd, func_godot addon for
  the .map export path, point/entity templates, TrenchBroom docs
- Retired: old arcade/FPS demo scenes and their scripts, unused meshlib

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
saarsena@gmail.com 2026-04-18 13:24:27 -04:00
parent 6ee49c3375
commit 7a6ae79d01
160 changed files with 7209 additions and 2072 deletions

View file

@ -2,11 +2,35 @@ CC := cc
CFLAGS := -std=c99 -Wall -Wpedantic -Werror=implicit -Wmissing-prototypes -O2 -g -Isrc
LDFLAGS :=
GEN_SRC := $(wildcard src/gen/*.c)
GEN_OBJ := $(GEN_SRC:src/%.c=obj/%.o)
GEN_SRC := $(wildcard src/gen/*.c)
GEN_OBJ := $(GEN_SRC:src/%.c=obj/%.o)
.PHONY: all clean genesis test stress godot godot-clean
all: genesis
BLOBBER_SRC := $(wildcard src/blobber/*.c)
BLOBBER_OBJ := $(BLOBBER_SRC:src/%.c=obj/%.o)
MESH_SRC := $(wildcard src/mesh/*.c)
MESH_OBJ := $(MESH_SRC:src/%.c=obj/%.o)
.PHONY: all clean genesis genesis3d test stress godot godot-clean map tb-sync
all: genesis genesis3d
# --- TrenchBroom round-trip helpers -----------------------------------------
# Override on the command line: `make map SEED=99 DEPTH=30 LEVELS=4`.
GENERATOR ?= brogue
SEED ?= 42
DEPTH ?= 20
LEVELS ?= 1
MAP_OUT ?= $(abspath demo/maps/generated.map)
TB_GAME_DIR ?= $(HOME)/.TrenchBroom/games/brogue-genesis
map:
@mkdir -p $(dir $(MAP_OUT))
godot --headless --path demo --script scripts/export_map.gd -- \
--generator $(GENERATOR) --seed $(SEED) --depth $(DEPTH) \
--levels $(LEVELS) --out $(MAP_OUT)
tb-sync:
godot --headless --path demo --script scripts/export_tb_config.gd -- $(TB_GAME_DIR)
test: bin/genesis
@bash test/run_tests.sh
@ -20,12 +44,17 @@ godot:
godot-clean:
@rm -rf godot/build godot/godot-cpp/bin demo/addons/brogue_gen
genesis: bin/genesis
genesis: bin/genesis
genesis3d: bin/genesis3d
bin/genesis: $(GEN_OBJ) obj/genesis_main.o obj/json_emit.o
@mkdir -p bin
$(CC) $(LDFLAGS) -o $@ $^ -lm
bin/genesis3d: $(GEN_OBJ) $(BLOBBER_OBJ) $(MESH_OBJ) obj/genesis3d_main.o
@mkdir -p bin
$(CC) $(LDFLAGS) -o $@ $^ -lm
obj/%.o: src/%.c
@mkdir -p $(dir $@)
$(CC) $(CFLAGS) -c $< -o $@
@ -34,6 +63,10 @@ obj/genesis_main.o: src/genesis_main.c
@mkdir -p $(dir $@)
$(CC) $(CFLAGS) -c $< -o $@
obj/genesis3d_main.o: src/genesis3d_main.c
@mkdir -p $(dir $@)
$(CC) $(CFLAGS) -c $< -o $@
obj/json_emit.o: src/json_emit.c src/json_emit.h
@mkdir -p $(dir $@)
$(CC) $(CFLAGS) -c $< -o $@