feat(maze): shrink map and rebalance compact gameplay

This commit is contained in:
2026-09-08 22:14:13 +03:00
parent 5346f9296f
commit f043b63732
18 changed files with 297 additions and 61 deletions
+2 -2
View File
@@ -303,9 +303,9 @@ static void test_default_map_chunk_bounds(void) {
maze32_view_t view;
assert(maze32_game_project_view(&game, MAZE32_GAME_ROLE_OBSERVER, &view) ==
MAZE32_GAME_RESULT_ACCEPTED);
assert(view.cell_count == 8192U && view.object_count == 30U);
assert(view.cell_count == 1024U && view.object_count == 12U);
size_t chunks = maze32_game_view_chunk_count(&view);
assert(chunks == 688U);
assert(chunks == 88U);
char payload[MAZE32_GAME_VIEW_CHUNK_BYTES];
size_t largest_chunk = 0U;
for (size_t chunk = 0U; chunk < chunks; ++chunk) {
+5
View File
@@ -93,6 +93,11 @@ static void test_bounded_regeneration_failure(void) {
static void test_large_seed_set(void) {
maze32_maze_config_t config = maze32_maze_default_config();
assert(config.width == 32U && config.height == 32U);
assert((uint32_t)config.width * config.height == 1024U);
assert(config.cross_half_pairs == 2U && config.extra_cycle_pairs == 8U);
assert(config.minimum_exit_separation == 22U);
assert(config.landmark_pairs == 2U && config.artifact_pairs == 1U);
uint16_t minimum_cycles = UINT16_MAX;
uint16_t maximum_cycles = 0U;
uint16_t minimum_dead_ends = UINT16_MAX;
+4 -3
View File
@@ -82,8 +82,9 @@ test("chunk assembly replaces projection cells without explored-map memory", ()
assert.deepEqual(player.projectedCellIndices(replacement), [18]);
assert.equal(replacement.cells.some(cell => cell[0] === 9 || cell[0] === 10), false);
assert.equal(assembler.accept({v: 1, type: "view", seq: 22, payload: {chunk: 0, chunks: player.MAX_VIEW_CHUNKS + 1, cells: [], objects: []}}), null);
assert.equal(player.snapshotIsValid({width: 128, height: 64, cells: [[8191, 15]], objects: []}), true);
assert.equal(player.snapshotIsValid({width: 129, height: 64, cells: [], objects: []}), false);
assert.equal(player.snapshotIsValid({width: 32, height: 32, cells: [[1023, 15]], objects: []}), true);
assert.equal(player.snapshotIsValid({width: 33, height: 32, cells: [], objects: []}), false);
assert.equal(player.snapshotIsValid({width: 32, height: 33, cells: [], objects: []}), false);
});
test("refresh contract restores only the token and waits for server projection", () => {
@@ -117,7 +118,7 @@ test("player assets are local, Russian, accessible, and responsive", () => {
});
test("observer view fits large screens and bounds zoom", () => {
assert.equal(player.observerFitScale(1024, 600, 128, 64), .96);
assert.equal(player.observerFitScale(1024, 600, 32, 32), 2.25);
assert.equal(player.clampObserverZoom(.01), .25);
assert.equal(player.clampObserverZoom(20), 6);
const html = fs.readFileSync(path.join(project, "web/index.html"), "utf8");