Chapter 31 — Character Profiles
Part VII — Systems
Persistent character identity with progression, injuries, milestones, and save/load.
Package
Section titled “Package”@ai-rpg-engine/character-profile — depends on character-creation and equipment.
npm install @ai-rpg-engine/character-profileArchitecture
Section titled “Architecture”CharacterBuild + Stats + Resources + Tags ↓ createProfile() ↓ CharacterProfile ├── build (original choices) ├── stats/resources/tags (live state) ├── loadout (equipment) ├── progression (XP, level, ranks) ├── injuries (active + healed) ├── milestones (history) ├── reputation (factions) └── portraitRef (asset hash)Progression
Section titled “Progression”XP thresholds follow a curved scale from level 1 (0 XP) to level 10 (16,000 XP).
grantXp(profile, amount)— add XP with auto-levelingadvanceArchetypeRank(profile)— rank up archetype (max 5)advanceDisciplineRank(profile)— rank up discipline (max 3)evolveTrait(profile, original, evolved, at)— record trait upgrade
Injuries
Section titled “Injuries”Injuries apply stat/resource penalties and grant tags while active.
addInjury(profile, injury)— sustain an injuryhealInjury(profile, injuryId)— heal by IDgetActiveInjuries(profile)— unhealed injuriescomputeInjuryPenalties(profile)— aggregate active penalties
Milestones
Section titled “Milestones”Record notable events in the character’s history.
recordMilestone(profile, milestone)— add eventgetMilestonesByTag(profile, tag)— filter by tag
Reputation
Section titled “Reputation”Track faction standing with clamped [-100, 100] values.
adjustReputation(profile, factionId, delta)— change reputationgetReputation(profile, factionId)— get current value
Serialization
Section titled “Serialization”serializeProfile(profile)— JSON stringdeserializeProfile(json)— parse with validationvalidateSerializedProfile(json)— check without parsing
Profile Summary
Section titled “Profile Summary”getProfileSummary(profile) returns a display-ready object with name, level, XP, archetype, background, discipline, active injuries, milestone count, and total turns.