The Character Sheet
The Character type is the largest and most computed file type in GLASS. Understanding where its line between stored and computed runs is the prerequisite for touching any type with derived stats.
The stored side (what a builder edits)
Identity: name, class, level, description, image.
Attributes: bod, ref, coo, int, tec, res, pre — raw Scores 1–16.
Skills: thirty-three fields named skill_<name> — the player's invested Rank, 0–6. That's thirty-three stored numbers, no more.
Worn equipment: slots, not a bag — worn_head, worn_torso, worn_outerwear, worn_feet, worn_left_hand, worn_right_hand, worn_two_handed. These hold references into the Armor / Weapon types, which is where the sheet gets its AR and weapon stats.
Cyberware: two families. Neural implants occupy named regions — neural_cranial_interface, neural_brainstem, neural_cerebellar, neural_cortical, neural_limbic, neural_sensory_integration. Somatic implants occupy body-region slots (somatic_dermal, somatic_muscular, somatic_skeletal, and the arm/leg slots), with somatic_<region>_modules for modular attachments. Slots are a fixed anatomy, not a free list — that's what makes Strain and slot pressure real.
Progress tracking: hp (current), cover_bonus, glass_attention, neural_strain_current, talentMilestones (which talent levels have been spent), inventory_names / inventory_qty, and the earned-point ledgers skill_points_earned / attribute_points_earned against unspent_skill_points / unspent_attribute_points.
The computed side (never write these)
Roughly 130 fields are expressions, recomputed at read. The load-bearing ones:
- Attribute modifiers:
bod_modetc. = floor((Score − 4) / 2), the −2…+6 ladder. hp_max= 4 + 2 × (BOD Score + Level). Currenthpis stored; the max is computed.defense= 10 + REF modifier + Evasion total + cover.ar= sum of worn armor + cyberware AR, capped at 6.neural_strain_max= RES modifier + 4;neuralOverStrainandsomaticOverCapare boolean guards that flag illegal builds.skill_<name>_max= 2 + level-derived gains (the cap a rank can reach at this level);skill_<name>_total= attribute modifier + rank, the actual roll bonus. Every skill has both. A new skill is three fields: the stored rank, and the two computed projections.xp_next= the XP threshold for the next level, and the attack projections (atk_left_weapon,atk_left_dmg,atk_left_range,atk_left_ammo— and_right_,_th_for thrown) that read the equipped weapon files through their slot references.
The pattern to copy: one stored input, two computed projections (a cap and a total). If you add any per-level or per-attribute family, build it this way instead of storing copies.
Conventions when extending
- Classify before adding. Stored state (a choice or mutable fact) vs. computed projection (an expression) vs. nothing (a layout job). Presentation — labels, formatted strings, dot glyphs — is always the layout's business.
- Never store a copy of a computation. A hand-entered HP max goes stale the first time BOD changes. If a value is derivable, it's an expression.
- References, not names. Worn slots point at armor/weapon files by reference; the sheet reads
ar_bonusanddamage_dicefrom the target file. If you add equipment-bearing slots, make them references so the sheet computes through them. - Expressions stay top-level. A computed field reads
$selffields and one level ofload()through reference fields. Progression tables live as real arrays (on the class file) and are picked withfilter(...).at(-1)— never encoded into strings. - Key fields stay few. Only what the game master needs in constant context (identity, the attribute scores) should be marked key; inventories, features and skill lists load on demand.
The validation guards
neuralOverStrain and somaticOverCap exist because the sheet is also the rules referee: a build that exceeds RES-modifier + 4 Strain or 10 somatic slots flags itself instead of being rejected. If you add a resource with a cap, add its boolean guard the same day — silent overflow is how character math rots.