diff --git a/scripts/NPC.cs b/scripts/NPC.cs index 887a6e3..84794ad 100644 --- a/scripts/NPC.cs +++ b/scripts/NPC.cs @@ -101,33 +101,21 @@ public class Npc Vector2 fromHome = Position - anchor; float distHome = fromHome.Length(); - // Stay in the home range. A person forages OUT from their village and - // back, they don't march to the horizon — so past a search radius they - // turn homeward. This keeps a strip-happy town (the East) from slowly - // migrating into its neighbors instead of settling its own ground. - const float SearchRadius = 140f; + // Venture outward, unbounded — a town that must range far to eat + // genuinely relocates over time (the South drifting inland after a + // hard winter, an East scout wandering into a neighbor). Direction is + // outward from home, or — when right at the anchor — a per-soul angle + // from identity (NOT a fixed vector; the old default leaned hard +Y, + // i.e. south, which funnelled every town's explorers into one corner). Vector2 dir; - if (distHome > SearchRadius) - { - dir = (-fromHome).Normalized(); // head back toward home - dir = dir.Rotated(PersonalityModifier * 0.6f); // slight veer, still homeward - } + if (distHome > 1f) + dir = fromHome.Normalized(); else { - // Outward from home in a per-soul direction. When right at the - // anchor there's no outward vector, so pick an angle from the - // soul's identity — NOT a fixed vector (the old default leaned - // hard +Y, i.e. south, quietly funnelling every town's explorers - // into the southern corner). - if (distHome > 1f) - dir = fromHome.Normalized(); - else - { - float ang = (Name.GetHashCode() & 0xFFFF) / 65535f * Mathf.Tau; - dir = new Vector2(Mathf.Cos(ang), Mathf.Sin(ang)); - } - dir = dir.Rotated(PersonalityModifier * 1.4f + 0.6f); // circle the home range + float ang = (Name.GetHashCode() & 0xFFFF) / 65535f * Mathf.Tau; + dir = new Vector2(Mathf.Cos(ang), Mathf.Sin(ang)); } + dir = dir.Rotated(PersonalityModifier * 1.2f); // personality veer, so explorers fan out Position += dir * MoveSpeed; SenseNodes(gm.World); } @@ -745,14 +733,11 @@ public class Npc Enter(NpcState.Gathering); // no stone yet — go get it return; } - // Homestead on your OWN town's land — selfish souls sprawl (a - // wide range, no clustering to the shared center) but they build - // in the east if they're an East soul, not wherever they drifted - // into a neighbor's territory. - Vector2 anchor = gm.TownAnchor(HomeTown); + // Homestead where you actually live — no snapping back to the + // town anchor. If a people have migrated (following food inland + // after a hard winter), their homes rise where they now are; the + // town genuinely moves. Vector2 spot = _hasHomeSpot ? _homeSpot : Position; - Vector2 off = spot - anchor; - if (off.Length() > 120f) spot = anchor + off.Normalized() * 120f; mine = Building.NewShelter(spot); mine.Town = HomeTown; gm.Buildings.Add(mine);