generate the region maps as the game does

Every map in all 118 stored regions matches the save to the pixel, so
the port is checked against ground truth rather than eyeballed. Getting
there meant reproducing .NET quirks the output depends on: LCGRandom
reseeding from its previous seed, Dictionary slot order in
NaturalShape, and C#'s left-to-right evaluation of RNG draws.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-08 18:12:40 +03:00
parent 90b5d50fa5
commit 63fd30a189
12 changed files with 1843 additions and 36 deletions

View File

@@ -18,8 +18,10 @@ all: $(B)/vsmv $(B)/vs-map-viewer
# any Sex object.
SEX_SRC := $(wildcard src/*.sex)
# Statement-level #line directives can land inside a ?: and break the
# C (see Sex-field-notes.org), so they are kept to toplevel forms.
$(B)/%.o: src/%.sex $(SEX_SRC) | $(B)
$(SEXC) $< -c -o $@ -- $(CFLAGS) $(SEX_CFLAGS) $(CPPFLAGS)
$(SEXC) --line-directives=toplevel $< -c -o $@ -- $(CFLAGS) $(SEX_CFLAGS) $(CPPFLAGS)
$(B)/nk.o: src/nk.c src/nk.h | $(B)
$(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
@@ -30,7 +32,7 @@ $(B)/cJSON.o: cJSON/cJSON.c cJSON/cJSON.h | $(B)
$(B)/stb.o: src/stb.c third_party/stb/stb_image_write.h | $(B)
$(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
VSMV_OBJ = vsmv cs pb json save img dump cJSON stb
VSMV_OBJ = vsmv cs pb json maps save img dump lcg noise shape worldgen verify cJSON stb
$(B)/vsmv: $(VSMV_OBJ:%=$(B)/%.o)
$(CC) $^ -o $@ -lsqlite3