feat: Blender-authored roadside districts that rise per chapter

This commit is contained in:
2026-10-10 18:25:55 +03:00
parent 71959f7541
commit a170abc093
10 changed files with 693 additions and 1 deletions

View File

@@ -62,6 +62,7 @@ describe('release budgets', () => {
expect(classifyArtifact('assets/index-a.js', 'import("./environment-b.js")')).toBe('initial-application-js');
expect(classifyArtifact('assets/environment-b.js', 'three scene')).toBe('first-live-scene');
expect(classifyArtifact('assets/nightdrive-grand-tourer-a.glb', '')).toBe('first-live-scene');
expect(classifyArtifact('assets/nightdrive-districts-a.glb', '')).toBe('first-live-scene');
expect(classifyArtifact('assets/nightdrive-main.opus', '')).toBe('soundtrack-audio');
expect(classifyArtifact('assets/nightdrive-intro.mp3', '')).toBe('soundtrack-audio');
expect(classifyArtifact('assets/nightdrive-afterglow.opus', '')).toBe('soundtrack-audio');

View File

@@ -0,0 +1,32 @@
import { describe, expect, it } from "vitest";
import { readFileSync } from "node:fs";
import { DISTRICT_PRESENCE } from "@/scene/world/districts";
const provenance = JSON.parse(
readFileSync("assets/blender/districts/nightdrive-districts.asset.json", "utf8"),
) as { pieces: string[]; triangles: number };
describe("roadside districts", () => {
it("raises every authored piece in at least one chapter and nothing else", () => {
expect(Object.keys(DISTRICT_PRESENCE).sort()).toEqual(provenance.pieces);
for (const presence of Object.values(DISTRICT_PRESENCE)) {
const strengths = Object.values(presence);
expect(strengths.length).toBeGreaterThan(0);
for (const strength of strengths) {
expect(strength).toBeGreaterThan(0);
expect(strength).toBeLessThanOrEqual(1);
}
}
});
it("keeps the opening and the destination clear of mid-route districts", () => {
for (const [piece, presence] of Object.entries(DISTRICT_PRESENCE)) {
expect(presence.start, piece).toBeUndefined();
if (piece !== "arch") expect(presence.contact, piece).toBeUndefined();
}
});
it("stays a light kit", () => {
expect(provenance.triangles).toBeLessThan(8000);
});
});