3f2c5e2f18
Runs 5-6 logged in FINDINGS.md (soul layer validated: nature debris 0.000 vs selfish 0.225 after two years; the ledger works). Towns are now real spatial structure: TownDef seeds (South at the bottom of the map, North at the top), NPCs affiliate with a home town, communal duty serves your own settlement (buildings are town-tagged, founding uses the town centroid and per-town shelter caps), and each town raises its own shelters and granary. Generational (North) soul profile added — temperament only until the knowledge system lands. Map shows town labels; rosters and CSVs carry town columns. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
97 lines
3.5 KiB
C#
97 lines
3.5 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)
|
|
|
|
public static SoulProfile NatureSoul() => new()
|
|
{
|
|
Type = SoulType.Nature,
|
|
Generosity = 0.9f,
|
|
Sustainability = 0.9f,
|
|
CommunityBias = 0.8f,
|
|
StatusBias = 0.1f,
|
|
Accumulation = 0.1f,
|
|
};
|
|
|
|
/// <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,
|
|
};
|
|
|
|
/// <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,
|
|
};
|
|
}
|