Known-structures memory + bigger map: fix the East re-founding loop

Root cause of the homeless East: FoundOwnShelter searched all buildings by
proximity (within 30 units), so a lone selfish builder who wandered off to
gather wood for the walls came back, missed their own foundation, and
founded a NEW one - 5,900+ abandoned foundations per run, none finished.

Fix (per the exploration architecture): structures are known like resource
nodes. NPCs gain a KnownStructures set; a builder registers the home they
lay and returns to it via known-structures memory however far they roamed,
instead of re-founding. Children inherit their family's known buildings.
Result: 5,953 -> 31 founding events, East now houses itself with COMPLETED
homes and is the best-fed town (0.84), still lowest-knowledge/highest-debris
as selfishness should be.

Also expanded the world 768 -> 1152 with towns pushed to wider cardinal
points and resources scaled to area, giving the four cultures more room and
less accidental center overlap. Full 240-day four-town run in 189s.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-21 22:11:59 -04:00
parent 9e8ee1d748
commit 0c0c7088f8
3 changed files with 102 additions and 36 deletions
+8 -4
View File
@@ -29,10 +29,10 @@ public partial class GameManager : Node2D
public IReadOnlyList<TownDef> Towns => _towns;
private readonly List<TownDef> _towns = new()
{
new("North", new Vector2(384f, 130f), SoulType.Generational),
new("South", new Vector2(384f, 638f), SoulType.Nature),
new("West", new Vector2(130f, 384f), SoulType.Materialist),
new("East", new Vector2(638f, 384f), SoulType.Selfish),
new("North", new Vector2(576f, 190f), SoulType.Generational),
new("South", new Vector2(576f, 962f), SoulType.Nature),
new("West", new Vector2(190f, 576f), SoulType.Materialist),
new("East", new Vector2(962f, 576f), SoulType.Selfish),
};
private static SoulProfile ProfileFor(SoulType t) => t switch
@@ -324,6 +324,10 @@ public partial class GameManager : Node2D
// passed down like everything else a generation hands forward.
foreach (var node in a.KnownNodes) child.KnownNodes.Add(node);
foreach (var node in b.KnownNodes) child.KnownNodes.Add(node);
// A child also inherits the family's known buildings — the homes
// and stores of the people who raised them.
foreach (var s in a.KnownStructures) child.KnownStructures.Add(s);
foreach (var s in b.KnownStructures) child.KnownStructures.Add(s);
newborns.Add(child);
BirthsToday++;
pop[a.HomeTown] = (int)townPop + 1; // count the newborn toward capacity