fix(map-gen/maze): 增加迷宫房间向外生长时的 Levels.txt 全局边界(SizeX/SizeY)硬性约束 #48
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
背景与现状
在
src/game/maze.ts:984中,checkRoomNotOverlapping仅检查候选房间与已有房间两两之间是否重叠,没有任何关于关卡全局尺寸上限的校验。最终在stamp()阶段,仅简单计算所有放置房间的外接矩形(minX..maxX,minY..maxY)并动态构建画布。暗黑2原版逻辑(Oracle / Ground Truth)
Levels.txt中的SizeX与SizeY关卡外接边界约束。差异点与缺陷表现
解决建议与改造方案
linkMazeRooms判定中加入关卡最大包围盒(request.sectionSize * MaxSections或Levels.txt.SizeX/SizeY)约束。修复完成并验证通过
fix/issue-48801afd7checkRoomWithinBounds检查,严格约束迷宫扩张尺寸不超过Levels.txt的SizeX / SizeY;boundsRejected裁剪计数;tests/maze-bounds.test.ts(5/5 单测通过),全量 635 项测试通过,tsc0 报错。