ludic.wildlife (18.2): a walker a crowd moves
wildlife_set_crowd(a, true) hands a walker to a crowd. Its step no longer moves it, and its want is two fields on it: goal_x / goal_z (the point it heads for or faces) and goal_speed (0 when it stands). A route reads those and hands back where the crowd put it through wildlife_moved(a, x, z, vx, vz). That sets its place, its ground, its heading from its velocity and its prints, and updates its row's columns so the spatial index finds it there. Nothing allocates per animal per frame: the want is the animal's own fields, and moved writes in place. The prints and the turn counters moved to walked.ludic (steer.ludic was at the 100-line limit). crowd_test holds it; with crowd off every old test is unchanged. wildlife 26/26. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
521efe67db
commit
81b6782c9d
7 changed files with 140 additions and 10 deletions
|
|
@ -44,6 +44,10 @@ export property WildAnimal {
|
|||
wx: float = 0.0 # the corner of its way it is walking to now (WildlifeWorld.way)
|
||||
wz: float = 0.0
|
||||
way_t: float = 0.0 # seconds until it asks the way again; 0 asks at once
|
||||
crowd: bool = false # walked by the world's crowd (phase 18): it decides, the crowd moves it
|
||||
goal_x: float = 0.0 # where it walks this tick and how fast: what a crowd is handed
|
||||
goal_z: float = 0.0
|
||||
goal_speed: float = 0.0
|
||||
thirst: float = 0.0 # 0..100: over 60 it goes looking for water
|
||||
hunger: float = 0.0
|
||||
scat_t: float = 0.0 # game minutes until it might leave sign
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue