From 328760853c15c44d1de915d6c88e0dfd7ddc5af6 Mon Sep 17 00:00:00 2001 From: "Somhairle H. Marisol" Date: Tue, 29 Sep 2026 10:38:53 +0800 Subject: p72: 角色行走四向动画帧提升(6 走 + 2 待机) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CharacterArt 运行时点阵图集从 4 走 + 2 待机扩为 6 走(新增左右低过渡步 4/5,由 1/2 镜像)+ 2 待机,格数 *8、图集 5120x48;VillageArt 帧循环 %6、characterSourceRectangle *8、characterAtlasWidth 5120。同步 P45/Prototype 帧断言、新增 P72 帧表完整性回归、脚本与素材重新生成、维护说明动画语义。白天正午村庄行走实跑证据落 docs/evidence/p72-*。Desktop 343/343、Kernel 120/120、digest 与 p70 一致。 --- .../P72CharacterWalkTests.fs | 40 ++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 src/LivingVillage.Desktop.Tests/P72CharacterWalkTests.fs (limited to 'src/LivingVillage.Desktop.Tests/P72CharacterWalkTests.fs') diff --git a/src/LivingVillage.Desktop.Tests/P72CharacterWalkTests.fs b/src/LivingVillage.Desktop.Tests/P72CharacterWalkTests.fs new file mode 100644 index 0000000..781d22c --- /dev/null +++ b/src/LivingVillage.Desktop.Tests/P72CharacterWalkTests.fs @@ -0,0 +1,40 @@ +namespace LivingVillage.Desktop.Tests + +open Microsoft.VisualStudio.TestTools.UnitTesting +open LivingVillage.Desktop + +/// P72 回归:角色行走帧表完整性——四向各 8 格(6 走 + 2 待机), +/// 六张行走帧两两可见区分(含左右过渡步),且与待机帧不同。 +[] +type P72CharacterWalkTests () = + + let letters variant direction frame = CharacterArt.frameLetters variant direction frame + + let cellDiff (a: string list) (b: string list) : int = + List.zip a b + |> List.sumBy (fun (ra, rb) -> Seq.zip ra rb |> Seq.filter (fun (x, y) -> x <> y) |> Seq.length) + + [] + member _.WalkFrameTableHasSixDistinctPosesPerDirection () = + Assert.AreEqual(8, CharacterArt.frameCount) + Assert.AreEqual(6, CharacterArt.walkFrameCount) + Assert.AreEqual(2, CharacterArt.idleFrameCount) + for variant in 0 .. CharacterArt.variantCount - 1 do + for direction in 0 .. CharacterArt.directionCount - 1 do + let walk = [ 0 .. CharacterArt.walkFrameCount - 1 ] |> List.map (letters variant direction) + // 6 张行走帧两两必须有可见差异(不允许重复姿态)。 + for i in 0 .. walk.Length - 1 do + for j in i + 1 .. walk.Length - 1 do + Assert.IsTrue( + cellDiff walk.[i] walk.[j] >= 4, + sprintf "v%d d%d 走帧 %d 与 %d 姿态重复" variant direction i j) + // 行走与待机必须不同。 + let idle = letters variant direction CharacterArt.walkFrameCount + Assert.IsTrue(cellDiff walk.[0] idle >= 4, "行走帧与待机帧相同") + + [] + member _.AtlasStridePlacesSixWalkThenTwoIdleCells () = + Assert.AreEqual(5120, CharacterArt.atlasWidth) + Assert.AreEqual(5120, VillageArt.characterAtlasWidth) + let stride = VillageArt.characterAtlasWidth / 32 / (5 * 4) + Assert.AreEqual(8, stride) -- cgit v1.2.3