acdream/tests/AcDream.Content.Tests
Erik 0445004164 feat(content): Campaign CC CC1 — chargen table reader and typed options model
Adds the CC1 data layer for Campaign CC (retail character creation):
a reader for portal.dat's CharGen table (0x0E000002) plus a
presentation-free, Chorizite-free typed options model, and the pure
attribute/skill credit math the later CC3 Runtime owner needs.

Retail oracle (docs/research/named-retail/acclient_2013_pseudo_c.txt):
- ACCharGenData::Serialize @ 0x005C36D0 (table shape: StartingAreas +
  HeritageGroups)
- HeritageGroup_CG::Serialize @ 0x005C2100
- Sex_CG::Serialize @ 0x005C1600
- Template_CG::Serialize @ 0x005C0450
- CharGenState::SetHeritageGroup @ 0x005C67A0 and the six attribute-slider
  setters (~0x005C46CE..0x005C494E): remainingAtrbCredits = totalAtrbCredits
  - (str+end+coord+quick+focus+self) — a heritage's AttributeCredits is the
  budget the six RAW attribute values must fit, not points above the floor.
- CharGenState::Reset @ 0x005C68A0: atrbMin=10, atrbMax=100.
- gmCharGenMainUI::DoFinish @ 0x004E9170: Finish refuses only when
  remainingAtrbCredits > 0 (attributes only — skill credits are never
  gated to zero, confirmed by reading the function body).
- CharGenState::UpdateRemainingSkillCredits @ 0x005C37C0: exactly one of
  NormalCost/PrimaryCost is charged per Trained/Specialized skill.
- gmCGAppearancePage::Update @ 0x0047E8F0: the mHeritageGroup==0xc/0xd
  (Olthoi/OlthoiAcid) camera-offset branch CC6 will need.

Cross-checked against ACE's ACE.DatLoader.FileTypes.CharGen and
ACE.DatLoader.Entity.HeritageGroupCG/SexCG/TemplateCG/SkillCG loaders
(same field order, different byte format) and ACE.Entity.Enum.HeritageGroup
/ SkillAdvancementClass for the two small stable enums the model exposes.

src/AcDream.Core/CharGen/: ChargenOptions (root: StarterAreas +
HeritagesById), ChargenHeritageOptions, ChargenGenderOptions (BaseObjDesc
+ every appearance-option list: hair styles/colors, eye colors, eye/nose/
mouth strips, headgear/shirt/pants/footwear, clothing colors),
ChargenTemplate, ChargenObjDesc (palette/subpalette/texture/anim-part-swap
shape, mirrors PaletteOverride's presentation-free pattern), and the pure
math: ChargenAttributeMath (RemainingCredits/IsFullySpent/range checks) and
ChargenSkillCreditMath (retail's Trained-xor-Specialized cost sum) plus
ChargenSkillAdvancementSet, a structurally-fixed 55-slot type (reserved
slot 0 + SkillId 1..54) so CC2's future wire builder cannot send anything
but exactly 55 entries.

src/AcDream.Content/CharGen/ChargenTableReader.cs projects the Chorizite
DBObj graph into the Core model (MagicCatalog.Load's shape) — no Chorizite
type crosses into ChargenOptions.

Tests: hand-built-fixture unit tests for the pure math (Core.Tests) and the
Content projector (Content.Tests), plus six installed-DAT gate tests
(ContentConformanceDats pattern) against the real portal.dat: 13 heritage
groups (11 standard + 2 Olthoi), the four named heritages with retail
display names incl. "Gharu'ndim", every heritage has a gender with
non-empty appearance option lists, every template's attributes stay in
10..100 and never exceed its heritage's budget (discovered live: NOT every
template fully spends it — each human heritage's "Adventurer" template
sits at the floor as retail's real-DAT-backed "Custom" starting point),
start-area indices resolve into the shared list, and skill costs key to
valid 1..54 wire ids.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-15 12:53:50 +02:00
..
CharGen feat(content): Campaign CC CC1 — chargen table reader and typed options model 2026-08-15 12:53:50 +02:00
Spells feat(headless): share immutable gameplay content 2026-07-27 09:00:48 +02:00
Vfx fix(tests): replace sleep-race concurrency proofs in RetailDatLoaderTests 2026-07-30 11:03:03 +02:00
AcDream.Content.Tests.csproj test(pipeline): MP1b - live-vs-pak equivalence suite (dat-gated) 2026-07-05 21:33:32 +02:00
Ap155StaticSpherePopulationMeasurementTests.cs fix(physics): S2 — static publication emits authored Spheres as Spheres (AP-155 narrowed) 2026-08-07 08:07:02 +02:00
BoundedDatObjectCacheTests.cs perf(diag): per-frame history export + checkpoint LOH/cache counters + soak capped mode (2026-07-24 audit review) 2026-07-24 12:00:30 +02:00
ContentConformanceDats.cs test(pipeline): MP1b - live-vs-pak equivalence suite (dat-gated) 2026-07-05 21:33:32 +02:00
Crc32Tests.cs fix(pipeline): MP1b review - pak format/reader hardening 2026-07-05 22:08:59 +02:00
DatResolutionPrecedenceTests.cs perf(content): remove exception-driven setup probes 2026-07-24 15:12:21 +02:00
DecodedTextureCacheTests.cs perf(diag): per-frame history export + checkpoint LOH/cache counters + soak capped mode (2026-07-24 audit review) 2026-07-24 12:00:30 +02:00
FlatCollisionAssetSerializerTests.cs feat(content): bake and read flat collision assets 2026-07-25 15:22:08 +02:00
InstalledPreparedCollisionCatalogTests.cs feat(content): bake and read flat collision assets 2026-07-25 15:22:08 +02:00
InstalledSetupBspPrimitiveDispatchTests.cs fix(physics): port retail's find_bbox_cell_list outdoor extent walk (#334) 2026-08-06 19:07:06 +02:00
InstalledSetupCollisionReachabilityTests.cs fix(test): evaluate BOTH deleted guards; correct AP-22's overstated coverage claim 2026-08-06 08:54:31 +02:00
Issue334NeftetFormationCellMembershipTests.cs fix(physics): port retail's find_bbox_cell_list outdoor extent walk (#334) 2026-08-06 19:07:06 +02:00
LandblockPhysicsContentBuilderStaticSphereTests.cs fix(physics): S2 — static publication emits authored Spheres as Spheres (AP-155 narrowed) 2026-08-07 08:07:02 +02:00
ObjectMeshDataEquality.cs perf(render): consume prepared mesh package at runtime 2026-07-24 15:07:25 +02:00
ObjectMeshDataSerializerTests.cs perf(render): consume prepared mesh package at runtime 2026-07-24 15:07:25 +02:00
PakAliasTests.cs feat(content): add physical blob aliases to pak writer 2026-07-24 13:33:53 +02:00
PakEquivalenceTests.cs feat(bake): publish validated pak artifacts atomically 2026-07-24 13:40:58 +02:00
PakFormatTests.cs feat(pipeline): MP1b - pak key + header/TOC primitives 2026-07-05 21:14:10 +02:00
PakKeyTests.cs feat(content): bake and read flat collision assets 2026-07-25 15:22:08 +02:00
PakRoundTripTests.cs feat(bake): publish validated pak artifacts atomically 2026-07-24 13:40:58 +02:00
PreparedAssetSourceTests.cs perf(content): add typed prepared asset source 2026-07-24 14:52:12 +02:00
SharedPreparedCollisionCacheTests.cs feat(headless): share immutable gameplay content 2026-07-27 09:00:48 +02:00
SolidColorTextureCacheTests.cs perf(content): CellStruct clone guard, solid-color texture cache, drop double ToList (2026-07-24 audit review) 2026-07-24 11:49:46 +02:00