summaryrefslogtreecommitdiff
path: root/docs/维护说明.md
diff options
context:
space:
mode:
authorSomhairle H. Marisol <[email protected]>2026-09-28 15:58:43 +0800
committerSomhairle H. Marisol <[email protected]>2026-09-28 15:58:43 +0800
commitceb45d4006426d616aef099aaf16f5c1d827e816 (patch)
treec67af5bc00c9cb3ef143986a292e9f7407d1030f /docs/维护说明.md
parent3460c31b3bce6ee417e1aae95071992ba60fbf63 (diff)
downloadliving-village-ceb45d4006426d616aef099aaf16f5c1d827e816.tar.gz
test(p39): 摆放/光晕/奇偶 spacing 回归 + 运行时证据帧
- P39ArtTests 9 例:桥/船/灯笼/摊位/芦苇地形与确定性、NightLightTilesIncludeRoadLanterns、 StallsAndLanternsDoNotOverlapForOddAndEvenSpacing(奇 {3,5,7,11,13}/偶 {2,4,6,8,12})、 DegenerateSpacingPlacesNothing({0,1,-3} 返回空集) - AssetPackTests 更新为 19 格 + 新索引;fsproj 注册 P39ArtTests - scripts/make-p39-closeups.py:2x NEAREST 特写 - docs/维护说明.md 追加 P39 小节;证据 5 帧白块检查 0 命中,重复运行 byte-identical - Release 全量 Desktop 195/195、Kernel 119/119
Diffstat (limited to 'docs/维护说明.md')
-rw-r--r--docs/维护说明.md45
1 files changed, 45 insertions, 0 deletions
diff --git a/docs/维护说明.md b/docs/维护说明.md
index fb4164f..8ea81ec 100644
--- a/docs/维护说明.md
+++ b/docs/维护说明.md
@@ -1242,3 +1242,48 @@ late pass),故「灯笼光晕 + 水面」以生成器夜帧为准,「炊�
```
- **范围**:本单只做 HUD 图标化(审计选出的最大差距);启动动画与开始界面已达标不再改动;
更细的 HUD 动效/主题换肤留待后续单。
+
+## P39 美术横向扩展切片(cc0 图集补绘中式元素 + 确定性摆放 + 夜间光晕)
+
+在 P33/P34 竖直素材切片之后,为 `LV_ASSET_PACK=cc0` 图集补绘五类中式景观元素,并按确定性规则
+接入真实场景(摆放不写瓦片、不改可达性),让 cc0 模式昼夜帧都有可辨的中式村庄细节。
+
+- **图集扩展**:`scripts/make-cc0-art.py` 由 384x32(12 格)扩到 **608x32(19 格)**;新增 7 个自绘
+ 函数(`draw_bridge_center` / `draw_bridge_end` / `draw_boat` / `draw_stone_lantern` / `draw_stall` /
+ `draw_reeds`)。旧索引 0-11 **逐字节不变**(用 `git show HEAD:...` 校验通过);产物 608x32 / 1523 bytes /
+ sha256 `ef86ced2…6adcb`,二次生成 byte-identical。图集 `NEAREST` 放大 2x 无混色。
+- **新格索引契约**:12 石桥中段 / 13 石桥桥台 / 14 乌篷船左半 / 15 乌篷船右半 / 16 石灯笼 /
+ 17 路摊 / 18 芦苇(见 `docs/素材来源.md` 第 4 节)。
+- **确定性摆放**(`src/LivingVillage.Desktop/VillageArt.fs`,纯函数、仅 cc0 生效):
+ - `cc0BridgeTiles`:每座桥列最上一格铺中段(12),再上一格铺桥台(13)。
+ - `cc0BoatTile`:开阔水面泊 2 格船,优先靠近最近的桥(曼哈顿距离),平局按 `hash2 … 0x39B0A7UL`。
+ - `cc0LanternTiles map spacing`:`x % spacing = 0`,y = `MainRoadCenter.[x]`,避开水面。
+ - `cc0StallTiles map spacing`:`x % spacing = spacing / 2`(与灯笼错开)。
+ - `cc0ReedTiles map spacing`:陆地格且上下邻格为水,`x % spacing = 0`。
+- **奇偶 spacing 边界**(本单自检并修复):灯笼余数类 `{0}`、摊位余数类 `{spacing/2}`,`spacing >= 2`
+ 时两同余类恒不相交(奇偶皆成立);唯一退化点是 `spacing = 1`(`spacing/2 = 0` 与灯笼同余 → 重叠)。
+ 两个摆放函数现**守卫 `spacing < 2` 返回空集**,从源头消除重叠;`spacing = 0`/负值同样返回空集。
+- **夜间光晕接入**:新增 `nightLightTilesWith (includeRoadLanterns: bool) map`;`nightLightTiles map =
+ nightLightTilesWith false map`(保持旧断言不变);`drawNightGlows` 末尾新增 `includeRoadLanterns` 参数,
+ VillageArt 内部三处 offscreen 调用传 `false`,`Game.fs` riverscape 分支传 `artTextures.Cc0TileAtlas.IsSome`。
+ 夜帧石灯笼复用 P29/P32 径向光晕路径,真实可见。fallback 模式不摆放新元素。
+- **回归测试**:`P39ArtTests.fs` 由 7 例增至 **9 例**(新增 `StallsAndLanternsDoNotOverlapForOddAndEvenSpacing`
+ 覆盖奇 `{3,5,7,11,13}`/偶 `{2,4,6,8,12}` 两组,`DegenerateSpacingPlacesNothing` 覆盖 `{0,1,-3}`);
+ `AssetPackTests` 更新为 19 格 + 新索引断言。Release 全量 Desktop **195/195**、Kernel **119/119**。
+- **证据**(`docs/evidence/`,`git add -f`;`check-no-white-blocks.py` 5 帧 0 命中,重复运行 byte-identical):
+ - `p39-day.png` / `p39-night.png`:cc0 模式村庄真实运行昼 / 夜帧(同 seed)。
+ - `p39-lantern-night.png`:夜间石灯笼光晕可见帧。
+ - `p39-closeup-2x.png`(640x480)/ `p39-closeup-lantern-2x.png`(640x360):桥/船与灯笼 2x NEAREST 特写。
+- **复现**:
+
+ ```bash
+ DLL=src/LivingVillage.Desktop/bin/Release/net8.0/LivingVillage.Desktop.dll
+ timeout 90 xvfb-run -a -s "-screen 0 1280x720x24" \
+ env LV_P39_SHOT=1 LV_ASSET_PACK=cc0 LV_RECORD_DIR=docs/evidence dotnet "$DLL"
+ python3 scripts/make-p39-closeups.py docs/evidence docs/evidence
+ python3 scripts/check-no-white-blocks.py docs/evidence/p39-*.png
+ ```
+ `LV_P39_SHOT=1` 在 `Update` 里 `PrepareP39Shot` 设置 hour/camera 并置 `p39Pending`,`Draw` 末尾
+ `CaptureP39Shot` 落盘(避免软件渲染每帧多跑导致缓冲相同),须配合 `LV_ASSET_PACK=cc0`。
+- **范围**:本单只做横向美术扩展与确定性摆放 + 夜光接入;不写瓦片、不改可达性、不动 `Sim.step`
+ (digest 不变),P36/P37/P38 均未受影响。