Files
mmcghen f9e22e872f Run 13: the full world - four towns, resources, bonds, spatial grid
World scaled 3x (768x768) with all four towns at compass points, each
running its own soul culture: North generational, South nature, West
materialist (new profile), East selfish. Two new resources: Ore (metal
tier) and Herb (medicine - mends health, reason to forage, trade good).
Spatial hash grid replaces O(n^2) proximity scans (soul pressure,
neighbor, teacher) - 3.6x headless speedup at ~80 NPCs. First social
verb beyond work: pair-bonds - settled adults who keep warm company pair
up; warmth now accrues from proximity not only gifts; bonds break at
death. Reproduction deferred (bonds-first per plan).

The four-town thesis fully realized on one engine (240-day run):
North know 1.27 clean, South nourish 0.85 clean, West prosperous but
debris 0.23, East hungriest 0.60 and lowest knowledge 1.08. Positive
cultures stay soul-clean, negative ones carry real debris, all from
behavior weights - nothing scripted. 99 bonds, 80 deaths, four living
societies.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-21 17:04:19 -04:00

49 lines
1.8 KiB
C#
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using Godot;
namespace WorldSim;
/// <summary>Domains of practical knowledge (SPEC §5 — deliberately few).</summary>
public enum KnowledgeDomain { Forage, Woodcraft, Masonry }
/// <summary>
/// What a person knows how to do (SPEC §5). Not an object in the world —
/// it lives in people, spreads by proximity, grows by practice, and dies
/// with its holder unless it was passed on. Every death is a small library
/// burning; a teaching culture is a culture of copies.
///
/// Capacity is personal and randomized: some people can hold more than
/// others, and what fills first is what they lived.
/// </summary>
public class Knowledge
{
public const int DomainCount = 3;
/// <summary>01 per domain.</summary>
public float[] Skill = new float[DomainCount];
/// <summary>Total learning this mind can hold, across all domains.</summary>
public float Capacity = 1.5f;
public float Total => Skill[0] + Skill[1] + Skill[2];
public float Headroom => Mathf.Max(0f, Capacity - Total);
public float this[KnowledgeDomain d] => Skill[(int)d];
/// <summary>Learn, limited by personal capacity.</summary>
public void Gain(KnowledgeDomain d, float amount)
{
if (amount <= 0f || Headroom <= 0f) return;
float a = Mathf.Min(amount, Headroom);
Skill[(int)d] = Mathf.Clamp(Skill[(int)d] + a, 0f, 1f);
}
/// <summary>Which domain a material teaches and benefits from.</summary>
public static KnowledgeDomain DomainFor(MaterialKind kind) => kind switch
{
MaterialKind.Food => KnowledgeDomain.Forage,
MaterialKind.Herb => KnowledgeDomain.Forage, // gathering the living land
MaterialKind.Wood => KnowledgeDomain.Woodcraft,
_ => KnowledgeDomain.Masonry, // stone, clay, ore — builder's craft
};
}