Files
Soul_Game/scripts/SoulProfile.cs
T
mmcghen 3e4e44c623 Run 12: knowledge system, mortality, and the North's generational soul
SPEC §5 built: three skill domains (forage/woodcraft/masonry) that pay
off and grow by practice; proximity diffusion soul-calibrated by
absorption x teaching-drive; and mortality - the piece that makes
knowledge generational. Elders die (~150-230 days), everything unshared
dies with them, a youth comes of age near knowing nothing. North soul
(absorption 1.6, teaching 0.9) vs South (1.0, 0.3); East teaches no one.

Two findings: (1) headless soaks were contaminated by orphaned child
processes writing later runs' CSVs - fixed with StopAfterDays clean
self-terminate; (2) passive diffusion barely helped - the North's real
culture is the young seeking elders on purpose, so added deliberate
teacher-seeking and youths now cradle beside the wisest elder. North
now leads knowledge at every checkpoint, but a stable town approaches
the ceiling regardless, so teaching is a recovery advantage not an
equilibrium one. The crisis-recovery experiment is the real test, noted
in FINDINGS as next.

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

109 lines
4.2 KiB
C#

using System;
namespace WorldSim;
/// <summary>
/// Soul types — the four founding philosophies (SPEC §1).
/// MVP uses Nature only; the others exist so nothing hardcodes a single type.
/// </summary>
public enum SoulType
{
Nature, // South — take only what you need
Generational, // North — reverence for lineage
Materialist, // West — worth measured in visible possessions
Selfish, // East — personal gain, no guilt attached
}
/// <summary>
/// The soul imprint triad (SPEC §2 amendment, DESIGN.md debris model).
/// The soul itself never changes — these are the layers over it.
/// MVP behavior may read only Total, but all three sources are carried
/// so later phases (residual-soul verdicts, awareness thresholds,
/// source-specific clearing) need no data migration.
/// </summary>
public class SoulImprint
{
public float SelfRegard; // internal — how the soul sees itself
public float OthersRegard; // internal — how the soul sees others
public float ExternalPerception; // external — what others' souls pressed onto it
public float Total => (SelfRegard + OthersRegard + ExternalPerception) / 3f;
public float Radiance => 1f - Total;
public void Clamp()
{
SelfRegard = Math.Clamp(SelfRegard, 0f, 1f);
OthersRegard = Math.Clamp(OthersRegard, 0f, 1f);
ExternalPerception = Math.Clamp(ExternalPerception, 0f, 1f);
}
}
/// <summary>
/// Behavior weights per soul type (SPEC §9). Constrained emergence:
/// these weights pick WHICH valid option an NPC takes, never WHETHER
/// a solution exists. Swappable per type — the engine stays agnostic.
/// </summary>
public class SoulProfile
{
public SoulType Type;
public float Generosity; // trade ratios, spontaneous help
public float Sustainability; // harvest caps (South: ~50% of a node)
public float CommunityBias; // communal-first building, socializing pull
public float StatusBias; // West: visible-wealth preference (unused in MVP)
public float Accumulation; // East: hoarding pressure (unused in MVP)
// Knowledge culture (SPEC §5): how readily this soul absorbs from
// others, and how deliberately it passes on what it knows. The North's
// whole identity lives in these two numbers.
public float Absorption = 1f; // learning rate multiplier
public float TeachingDrive = 0f; // how much being near this soul teaches
public static SoulProfile NatureSoul() => new()
{
Type = SoulType.Nature,
Generosity = 0.9f,
Sustainability = 0.9f,
CommunityBias = 0.8f,
StatusBias = 0.1f,
Accumulation = 0.1f,
Absorption = 1.0f,
TeachingDrive = 0.3f, // knowledge passes casually, by living together
};
/// <summary>
/// North-weighted profile: reverence for lineage, strong communal pull,
/// modest material appetite. Their signature system — generational
/// knowledge transfer (SPEC §5) — arrives with the expansion phase;
/// until then they differ from the South in temperament, not verbs.
/// </summary>
public static SoulProfile GenerationalSoul() => new()
{
Type = SoulType.Generational,
Generosity = 0.8f,
Sustainability = 0.8f,
CommunityBias = 0.95f,
StatusBias = 0.15f,
Accumulation = 0.2f,
Absorption = 1.6f, // raised to receive what elders hand down
TeachingDrive = 0.9f, // and to hand it down in turn — the whole culture
};
/// <summary>
/// East-weighted profile — not part of MVP behavior, but defined now for
/// the end-of-MVP contrast test (SPEC §11 amendment): 3 selfish NPCs
/// dropped into the South town to prove weights alone change the society.
/// </summary>
public static SoulProfile SelfishSoul() => new()
{
Type = SoulType.Selfish,
Generosity = 0.1f,
Sustainability = 0.2f,
CommunityBias = 0.1f,
StatusBias = 0.5f,
Accumulation = 0.9f,
Absorption = 0.7f, // they take, but rarely sit still to learn
TeachingDrive = 0.0f, // and teach no one anything, ever
};
}