feat(nav): 17.4 - a mesh has eight filters (a cost per kind of ground each) and every path, straight line and random point names the one it walks by, so a deer, a marmot and a person each take their own way over the same mesh; tested with a band of thicket walked round by the filter that dislikes it

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Orkun ÇAKILKAYA 2026-09-27 21:34:23 +03:00
parent f0485a20a8
commit d4b6979426
10 changed files with 82 additions and 57 deletions

View file

@ -1,5 +1,6 @@
# fakes/meadow.ludic - ground built by hand for ludic.nav's tests: n metre squares a side, flat at
# y = 0; river 1 crosses x 18..22 with a ford at z 30..34, river 2 without one, river 0 is none
# y = 0; river 1 crosses x 18..22 with a ford at z 30..34, river 2 without one, river 0 is none;
# 3 is no river but a band of area 2 (thicket) over the same x for z under 30
function ground(n: int, river: int) -> NavGround {
let g = new NavGround
g.nv = (n + 1) * (n + 1)
@ -24,7 +25,8 @@ function ground(n: int, river: int) -> NavGround {
push(g.t, a + n + 1)
push(g.t, a + n + 2)
var k = 1
if river > 0 and i >= 18 and i < 22 and not (river == 1 and j >= 30 and j < 34) { k = 0 }
if river > 0 and river < 3 and i >= 18 and i < 22 and not (river == 1 and j >= 30 and j < 34) { k = 0 }
if river == 3 and i >= 18 and i < 22 and j < 30 { k = 2 }
g.area[(j * n + i) * 2] = k
g.area[(j * n + i) * 2 + 1] = k
}