Commit Graph

123 Commits

Author SHA1 Message Date
troytt e817ace5ef fix(maze-objects): 删掉 isOpenFloor 里恒真的 `|| true`
`hasFloor` 的内容检测写成 `(f.prop1 !== 0 || f.style !== 0 || f.sequence !== 0
|| true)`,末尾的 `|| true` 让整个条件恒为真:DS1 每个格子的每一层地板都有一条
记录,未绘制处是全零槽位,于是「没有地板美术的空格」也被判定为可放物件的地面。

删除 `|| true` 后,全零地板槽位不再算作地面;新增 6 个回归用例覆盖
painted / 全零 / 仅 style / 仅 sequence / hidden / 多层,以及「整关地板全为空槽
时不生成任何动态物件」。

TAG=agy
CONV=2a1934de-30ef-464e-b3f3-fcbcdbbc49f1
2026-09-17 11:30:47 +00:00
troytt 5b3a9db986 fix(maze): 让 UNIMPLEMENTED_PASSES 反映真实缺口
`UNIMPLEMENTED_PASSES` 此前被硬编码为 `[]`,注释声称 11 个核心地牢 pass 全部
实现,于是 `stats.unimplementedPasses` 在每一关都无条件报告「零缺口」——包括
那些 `specials` 表为空、根本不生成楼梯房间的 level type。

改为从 `MAZE_LEVEL_TYPE_PROFILES` 实测推导:

- 新增 `unimplementedPassesFor(levelTypeName)`,按 level type 返回缺口:
  没有 profile 行,或 `specials` 为空且不是 `singleRoom` 定制关。
- `UNIMPLEMENTED_PASSES` 改为所有 level type 缺口的并集,因此非空。
- `generateMaze` 的 `stats.unimplementedPasses` 改报本关自己的缺口,
  而不是全局常量;`unresolvedRoles` / `notes` 本来就已随 stats 返回。

同时修正两处已经与代码不符的注释:`maze.ts` 里「per-act 装饰 pass 均未复现」
(它们已在 `maze-special-passes.ts` 中实现),以及 `pack-act-assets.ts` 里
「第二幕下水道 / 墓穴 / 第三幕地牢 specials 为空」(这三者现在都有 specials,
真正为空的是 Harem、Basement、Spider、Act 5 Lava)。

测试:原 `UNIMPLEMENTED_PASSES is completely empty` 断言的是被修正的错误行为,
改为断言它恰好列出所有 `specials` 为空的 level type;另加 4 个用例覆盖
按 level type 查询与 `generateMaze` 的 stats 透出。

TAG=agy
CONV=2a1934de-30ef-464e-b3f3-fcbcdbbc49f1
2026-09-17 11:29:06 +00:00
troytt 4ece5aa3c1 feat(scene): acts.html 接入房间级惰性刷怪与休眠/唤醒流式加载
把已合入 main 但从未被生产代码调用的两块能力接到 acts.html 的
act-scene 上,按 D2Game.dll 的做法组织怪物生命周期:

- act-scene:新增 buildStreamingRooms(),把关卡切成房间并把怪物群
  分配给房间,交给 GameEngine 的 roomPacks。房间按「场景像素空间」
  切分而不是格子空间——一块矩形格子投影出来是菱形,相邻矩形的
  AABB 几乎完全重叠,那样切会让全图房间同时「靠近玩家」,流式加载
  就没有意义了。落在菱形外、没有任何可走地面的房间直接丢弃,否则
  分到它头上的怪物群会被静默吞掉。
- monster-streaming:populateRoom 改用 monster-rooms 的
  spawnPacksInRoom,怪物在房间内抱团成营地,而不是沿用旧的全局
  螺旋撒点。这把 feat/monster-streaming 和 feat/monster-room-placement
  两条分支真正合到了一起。落进安全区(传送点/关卡入口)的个体会被
  推到安全区边缘。
- 重新打开怪物仇恨。它当初被关掉是因为全图怪物同时醒着,会被拖成
  一条长队;现在玩家没走近的怪物要么还没实例化、要么在睡眠中。
- swapLevel 过图时重建房间表,而不是在门口一次性刷完整张图。

tests/wilderness-roads:角落断言改为按槽位号统计。这条断言早于
6b9c3d3(Act 1 北/西/三个角改用岩壁边界),岩壁族还带字母后缀
(Wild Cliff Border 6A),按全名查表就落空了。

Verified: typecheck + 923 tests pass;另用真实烘焙数据回放,
冰冷之原 45 群 57 只怪 → 45 个房间,出生点只实例化 18 房 26 只,
走遍全图后恰好 45 房 57 只,无遗漏、无重复。
2026-09-17 11:14:26 +00:00
troytt 374bf2fff6 docs: 记录本机原版 MPQ / DLL 的持久存放位置与 /tmp 丢失教训
把原版数据的权威路径固定为 /usr/local/google/home/taodao/d2-data,
由各工作树的 samples/d2 软链引用,避免十几个 worktree 各存一份 1.9 GB。

同时记下 2026-09-16 那次事故:数据原先放在 tmpfs 的 /tmp 下,机器重启后
被清空,samples/d2 变死链,角色与怪物立绘全部退化为占位方块。

顺带留档 22 个原版 DLL 的逆向参考价值,其中 D2Common.dll(DRLG 地图生成)
与 D2Game.dll(怪物惰性填充 / 视距休眠唤醒)是后续修野外悬崖拼接和接入
流式刷怪时的对照基准。
2026-09-17 10:51:10 +00:00
troytt 4c2e399e1d test(loop): expand timeout tolerance to 120ms to prevent jitter in concurrent runs 2026-09-17 09:16:48 +00:00
troytt 274ffae71e Merge branch 'feat/monster-room-placement' 2026-09-17 09:11:24 +00:00
troytt 5aba7487f3 Merge branch 'fix/issue-16' into main 2026-09-17 09:10:59 +00:00
troytt 3951e70ef4 Merge branch 'fix/issue-20' 2026-09-17 09:09:01 +00:00
troytt 6f01c8de89 Merge branch 'fix/issue-19' into main 2026-09-17 09:08:46 +00:00
troytt db3d6ffa84 Merge branch 'fix/issue-57' into main 2026-09-17 09:07:38 +00:00
troytt 12718ebcd6 Merge branch 'fix/issue-56' into main 2026-09-17 09:03:15 +00:00
troytt 74d2d1e36f test(wilderness): reconcile caravan and avenue floor style check with act topography passes 2026-09-17 09:02:05 +00:00
troytt dfce2f6cef Merge branch 'fix/issue-55' 2026-09-17 08:58:45 +00:00
troytt a6ab21881d Merge branch 'fix/issue-54'
# Conflicts:
#	src/game/wilderness.ts
2026-09-17 08:58:22 +00:00
troytt 2de9835b34 Merge branch 'fix/issue-53'
# Conflicts:
#	src/game/wilderness.ts
2026-09-17 08:56:41 +00:00
troytt 3ab024d12f Merge branch 'fix/issue-52' 2026-09-17 08:51:58 +00:00
troytt 334b957ab6 Merge branch 'fix/issue-51'
# Conflicts:
#	src/game/wilderness.ts
2026-09-17 08:51:55 +00:00
troytt 4f8e077bbb Merge branch 'fix/issue-50'
# Conflicts:
#	src/game/maze.ts
2026-09-17 08:50:47 +00:00
troytt 4c584db273 Merge branch 'fix/issue-49'
# Conflicts:
#	src/game/maze.ts
2026-09-17 08:49:32 +00:00
troytt 893e9b8550 Merge branch 'fix/issue-48'
# Conflicts:
#	src/game/maze.ts
2026-09-17 08:41:40 +00:00
troytt e1163b1253 Merge branch 'fix/issue-47'
# Conflicts:
#	src/game/maze.ts
2026-09-17 08:40:55 +00:00
troytt c310119ed2 Merge branch 'fix/issue-46' 2026-09-17 08:40:20 +00:00
troytt 80b2fd0f71 Merge branch 'fix/issue-45' 2026-09-17 08:40:15 +00:00
troytt c83499c591 Merge branch 'fix/issue-44'
# Conflicts:
#	src/scene/act-scene.ts
2026-09-17 08:40:10 +00:00
troytt 9af2c07c38 Merge branch 'fix/issue-43' 2026-09-17 08:39:26 +00:00
troytt c2bda29211 Merge remote-tracking branch 'origin/feat/monster-streaming' into feat/monster-room-placement 2026-09-17 08:36:02 +00:00
troytt 8e46b64156 feat(monsters): room-local pack allocation and clustering placement 2026-09-17 08:35:11 +00:00
troytt 71fdaaefe3 feat(sim/monsters): lazy room population with bPopulated and active/sleeping streaming 2026-09-17 08:33:19 +00:00
troytt 11e2e42731 perf(render): optimize GL state with immutable texStorage2D, uniform caching, and configurable discard (fixes #20) 2026-09-17 08:16:05 +00:00
troytt 33585afe8d test(render/perf): comprehensive lifecycle verification and performance regression suite (fixes #16) 2026-09-17 08:15:13 +00:00
troytt 167928a31f feat(sim/loop): decouple simulation from rAF with independent timer and separate TPS/FPS metrics (fixes #19) 2026-09-17 08:12:57 +00:00
troytt 92d6731dae feat(map-gen/wilderness): data-driven wilderness SuperUniques and landmark entities from SuperUniques.txt (fixes #57) 2026-09-17 07:49:31 +00:00
troytt 46b7166f22 feat(map-gen/wilderness): thematic clustering and dispersed distribution for waypoints and shrines (fixes #56) 2026-09-17 07:36:39 +00:00
troytt 2fe5f4d892 feat(map-gen/wilderness): dynamic siege trench and fortification generation for Bloody Foothills (fixes #54) 2026-09-17 07:30:54 +00:00
troytt 3f463ba777 feat(map-gen/wilderness): extend road and stone divider networks to Acts 2, 3, and 5 (fixes #55) 2026-09-17 07:28:07 +00:00
troytt 81d2172cca feat(map-gen/maze): implement 11 official dungeon special passes (fixes #49) 2026-09-17 07:27:47 +00:00
troytt 723f5dce27 feat(map-gen/wilderness): implement Act 3 jungle river network and branch topology (fixes #53) 2026-09-17 07:25:07 +00:00
troytt 8baf91c51f feat(map-gen/wilderness): implement outdoor level initializers for acts 2-5 (fixes #51) 2026-09-17 07:11:19 +00:00
troytt ffc2b297f6 feat(map-gen/maze): implement dynamic dungeon object spawning pipeline (fixes #50) 2026-09-17 07:08:47 +00:00
troytt 12588ea948 feat(map-gen/wilderness): support multi-DT1 weighted ground tile blending (fixes #52) 2026-09-17 07:08:24 +00:00
troytt 801afd7ddb fix(map-gen/maze): enforce Levels.txt global bounds SizeX/SizeY on room growth (fixes #48) 2026-09-17 06:59:31 +00:00
troytt c56b808d7a feat(renderer/map): support animated tiles loop playback (fixes #43) 2026-09-17 06:34:02 +00:00
troytt 776e2d3c20 feat(map-gen/maze): integrate waypoint room into maze preset replacement pass (fixes #47) 2026-09-17 06:33:16 +00:00
troytt 8bb99ded7e refactor(map-gen/maze): align special room placement with D2 scanning rules (fixes #46) 2026-09-17 06:20:59 +00:00
troytt 72aa835260 refactor(map-gen/preset): move Chaos Sanctuary (Level 108) into preset pipeline (fixes #45) 2026-09-17 06:20:35 +00:00
troytt 57c13bdc26 feat(renderer/roofs): implement dynamic roof fade when player enters shelter (fixes #44) 2026-09-17 06:19:01 +00:00
troytt a01cffa0b5 refactor(map-gen/preset): fix variant selection and seam orientation alignment (fixes #42) 2026-09-17 06:18:42 +00:00
troytt 1fa3f8b7a2 chore(git): ignore node_modules symlinks in worktrees 2026-09-17 05:50:28 +00:00
troytt 87a575f4e8 chore(tooling): add git worktree helper script for multi-session development 2026-09-17 05:49:58 +00:00
troytt 80c74a6b95 test(cull): add unit test for bounds rebuild on level switch 2026-09-17 05:48:51 +00:00