OpenTPW

Theme Park Inc staff vs Theme Park World staff: static trace#

Executables: the identified English no-CD TPI Game.exe (SHA-256 77ea0c41410aad7c94a5eda658e31cb4ac05f7253aaf6746ad5e8a90afbd967a, file offset = VA − 0x400000) and Theme Park World's tp.exe (whose .data is not at VA − 0x400000, e.g. file 0x35CE78 = VA 0x75EA78). Static reading only; neither game was run, and no listing or byte dump is included here. Balance key addresses follow the settings layout in TPI-CHALLENGE-SYSTEM.md.

Conventions. "member" = a staff thing; TPI member offsets are relative to the thing. X ≙ Y = TPI X is the counterpart of TPW Y (same debug strings / same structure). "lerp(a→b)" = 0x62C900: for x in [lo,hi], t=(x−lo)<<14 / (hi−lo) (signed idiv), result ((0x4000−t)·a + t·b) divided by 16384 rounding toward zero (cltd; and 0x3fff; add; sar 14), x>hi → b, x<lo → a. "MaxExp" = AllStaffConstants.MaxExperience (0xA02260). "unread" = not read in this pass; no guesses.


1. Identity: roles, kinds, lists, states#

TPWTPIEvidence
role enum (pool, wages, strike)0 handyman, 1 mechanic, 2 entertainer, 3 guard, 4 researchersame 0–4 plus 5 gardenerpool switch 0x631C38..0x631D86 compares role 0–5; candidate jump table 0x6306B4 has 6 cases; error string "Trying to generate a non-existent staff type" 0x630635 for > 5; STAFF_TYPES.str (TPI) = Cleaner, Engineer, Entertainer, Guard, Scientist, Gardener
thing kind4 mechanic, 5 handyman, 6 entertainer, 7 guard, 8 researchersame, plus 0x14 gardenerload dispatch cases (ThemeParkIncBodyLayout.Data.cs comments: 0x5d9e40/0x5d4ba0/0x5d1600/0x5d3500/0x61b3c0/0x5d2510); kind→role byte table 0x62D070 = [0,1,2,3,4,…,5] for kinds 4..0x14 (used by wage check 0x62CDC0); HQ message 0x21 filter 0x63253F..0x632553 tests kinds 4,5,6,8,7,0x14
kind 0x14—gardener (GARD), waters plants (mPlantToWater, mTimeStartedWatering, load 0x5D2510); "Gardener found dry plant" 0x5D291E, "Too tired to water plants" 0x5D28DC
per-role list head (world word)+0x1DA73C handy, +0x1DA73E mech, +0x1DA740 ent, +0x1DA742 res, +0x1DA744 guard (0x508ED8..0x508F04)+0x1EAB7C handy, +0x1EAB7E gardener, +0x1EAB80 mech, +0x1EAB82 ent, +0x1EAB84 researcher, +0x1EAB86 guardrole jump tables 0x632CD0 (consideration) and 0x633FC0 (strike test); member link +0x5D0 (0x6337AA) vs TPW +0x210 (0x50942F)
member state word+0x19C+0x1B4 (saved state +0x1B8)0x62B010, 0x5DA283
display states6: Idle, Patrolling, Working, Resting, On strike, Picked up (TPW STAFFSTATES.str); map 0x5064F0: 0→0, 1→1, 2/3→3, 4/5→4, 7→5, else 29: Idle, Looking for work, Working, Resting, On strike, Picked up, (blank), Researching, Training (TPI STAFFSTATES.str); map 0x62B010 (table 0x62B09C): 0→0, 1→1, 2/3→3, 4/5→4, 6→2, 7/8→8, 9→2, 10→5, 11/12→6, 24/25/33/34→7 for a researcher with +0x274≠0 else 0, 37/38→8, others→2; state 11 shows the saved state
role state numbersmechanic walk 12 / repair 13 (OpenTPW ParkStaff) set by 0x4DA370(0xC) 0x4DA6D9mechanic walk 21, repair 22: dispatcher 0x5DA280 table 0x5DA358 (0 idle 0x5DA309, 1 0x5DA2A1, 2 0x629EF0, 3 rest 0x62A1C0, 21 0x5DA650, 22 0x5DA7C0, rest → common 0x6287A0); search sets 21 at 0x5DA519other roles' numbers: unread

2. Settings keys and where they land#

TPI Standard.sam drops every grade-indexed TPW staff key (PerGradeStaffConsts[g].*, <Role>ConstsPerGrade[g].WorkDuration/ PoundsPerTrainingPoint/DetectionRange/ActivationDistance/ResearchAbility; see tpw_keys.txt vs tpi_keys.txt) and adds experience/wage/agency/strike keys. Grades are gone: no grade member exists in the TPI staff save fragment (staff load 0x6267C0) and no absolute reference to any [g≥1] element of the remaining per-grade arrays was found (xrs.py tpi a02340 a0249c).

Key (TPI address)Read atUse
StaffPoolInfo.TimeBetweenStaffUpdates 0xA0221C, MaxNumberOfStaffPerUpdate 0xA02220, StaffTimeoutTime 0xA022240x631B97, 0x631BD5, 0x63069Bas TPW (0x508539, 0x508575, 0x5077B9)
Max<Role> 0xA021CC..DC0x631C12..0x631D92pool shortfall; gardener uses MaxHandymen (0x631C12 loads 0xA021CC into esi, role 5 block 0x631C4A and role 0 block 0x631C89 both subtract from it); MaxGardeners 0xA021E0 has no reference
Min<Role>InPool 0xA021E4..F40x631690gardener uses MinHandymenInPool (0x63176A then role 5 at 0x631792); MinGardenersInPool 0xA021F8 no reference; researcher minimum goes through 0x631970 (0x631848, unread)
Max<Role>InPark 0xA021FC..0xA022100x631490 (all six, gardener 0xA02210 at 0x631551), UI 0x720890..0x724E40, researcher also 0x5B3795park cap
BeginningNumberOf<Role> 0xA021B8..C8opening pool 0x631F30gardener uses BeginningNumberOfHandymen (0x631FCE, role 5 at 0x631FFE)
AvgExperienceOf<Role> 0xA021A4..B4, AvgWageDifference 0xA0222Ccandidate 0x6302C0gardener uses AvgExperienceOfHandymen (case role 5 0x630390 reads 0xA021A4)
ChanceToGetGreat*, AvgGradeOf*, BaseCostPerStaff, CostPerQualityLevel, MinExperience (0xA0217C..A0, 0xA02214, 0xA02218, 0xA02228)—no absolute reference found
AllStaffConstants.* 0xA02254..0xA022B8RestLevel 0x62B3BB; HappyHitCosNoRestArea 0x62BD52,0x62CBDE; HappyHitCosRoomInaccessible 0x62A057,0x62A8E1,0x62DD12; MaxExperience (many); UnHappyWageVal/HappyWageVal/LowestWageHappiness 0x62CDA0; Min/Max(Happiness)RecuperationRate 0x62A1C0; MinWage 0x62D160, Min/MaxWage/WageStep UI 0x58A650,0x590650,0x59ACA0; PercentageForBadWageDecision 0x559FA9; MotivationFactor 0x62E4E4; StaffSlackingEnergy 0x62D662; MinDistanceForSlacking 0x62D71E; StaffRoomCapacity 0x58D15B,0x629F42,0x62CAD3,0x724445; MaxStaffPerStaffRoom 0x7248D1; MaxSpeedDifference 0x62C974 and 3 more; TrainingExtraExperience 0x62AAEA; MinExperienceForTraining 0x629BBB; SkillIncrement 0x62AA50; ProgessUpperLimit 0x62AA6A,0x593680,0x62B854see §§4–8; MinStaffPerStaffRoom 0xA022A4 no reference
Strike.* 0xA022BC..CCMinMonthsForStrike 0x633117,0x628E3F; MinStaffOfTypeForStrike / Energy / Happy / Motivation 0x633740; Motivation also 0x62D873§7
<Role>.Min/MaxWorkDuration, Min/MaxDetectionRange, Min/MaxActiveRange, Min/MaxResearchAbility, MaxWage 0xA022D0..0xA0233C§5, §6Researcher.Min/MaxWorkDuration 0xA02320/24 no reference
PerTypeStaffConsts[t].PayMultiplier 0xA02340—no reference (TPW reads it at 0x504C9A)
<Role>ConstsPerGrade[0].ExperiencePerMonth (0xA0235C ent, 0xA02384 handy, 0xA0239C mech, 0xA023B8 res, 0xA023F4 guard)0x629650 only the [0] elements§5
EntertainerConstsPerGrade[g].HappinessEffectOnCell 0xA02358, ResearcherConstsPerGrade[g].NoRRoomHappyHit 0xA023BC, .WorkDuration 0xA023B4—no reference
StaffAgencies[a].* 0xA0240C..0xA0249C (36-byte rows)RequiredPromotionLevel 0x630260,0x6302C0; Motivation Gain/Loss 0x62CF78/0x62CE96; (Happiness)Recuperation 0x62A1EC/0x62A241; InitialWage 0x62CE88,0x630648; InitialExperience 0x6301C4,0x630343..; ExperienceGain 0x62970D; TrainingExperienceGain 0x62AAFDnew mechanism
FixedItemInfo.StrikeArea* 0xA02600..0C0x62BBA0as TPW 0x506A38 (0x7855EC..F8)
PeepInfo.Prank*, WhingeToStaffArea 0xA01AFC..0xA01B14guest code 0x60C3F0, 0x614E4E, 0x616100, 0x6161C0guest side, unread
ParkAward.Training/TrainingMinStaff 0xA028D4/D80x606D0F, 0x606D1Faward, uses staff count 0x5B2F40
LitterBin.Capacity/Dirty/FireRisk 0xA02990..980x5279E0, 0x527BD6, 0x5DB1B0new bins, unread

3. Hiring pool and candidates#

Pool update 0x631B40 ≙ 0x5084F0 (called each world turn: TPI 0x5D65F0 in 0x5D65E0 from world update 0x649868; TPW 0x4D7B30 in 0x4D7B20). Same skeleton: expiry loop over 32 candidates, refill when turns since stamp > 4 × TimeBetweenStaffUpdates (stamp pool+0x418 vs TPW +0x294, elapsed 0x448E10 ≙ 0x41A970), per-update cap min(MaxNumberOfStaffPerUpdate, free slots), per-role shortfall Max<Role> − pool count unless the role flag is set (flags pool+0x41D..+0x422 vs +0x299..+0x29D), draw world RNG % total shortfall picks the role (0x631DC6..0x631DEA ≙ 0x508722..0x50874C), new candidate, then MaxInPark check before (0x631490 ≙ 0x508000) and the minimum top-up after (0x631690 ≙ 0x508170). Differences:

Candidate 0x6302C0(role, slot) ≙ 0x507600. TPW draws a grade AvgGradeOf + R%3 − 1 after a discarded world draw (0x50762D..0x50764E). TPI instead:

  1. agency +0xC = rand() % n where n = number of leading StaffAgencies rows with RequiredPromotionLevel ≤ [0x42A3B0()+0x1060] (0x6302CB..0x6302F8). rand is the C runtime LCG 0x870D38 (×214013+2531011), not the world generator 0x6493E0.

  2. sprite byte +0x10 = 0x6902F0(cat) with category 9 handyman, 0xA mechanic, 8 entertainer, 0xB guard, 0xC researcher, 0x12 gardener (0x630308, 0x630418, 0x6304A0, 0x630528, 0x6305B0, 0x630390).

  3. experience +0x1C = AvgExperienceOf<Role> + (R % AvgWageDifference − AvgWageDifference/2) (world RNG; /2 = cltd; sub; sar), then += exp × InitialExperienceModifier[agency] / 100 (magic 0x51EB851F, sar 5) when both nonzero, capped at MaxExp (0x630318..0x630375, duplicated in 0x630190).

  4. wage +8 = ExpectedWage(exp, <Role>.MaxWage) (0x62CD30), then += wage × InitialWageModifier[agency] / 100 (0x630642..0x63066B). ExpectedWage(e, M): e > MaxExp → M; e < 0 → 0; else w = ((e<<14)/MaxExp × M) / 16384 (toward zero), w −= w % 20, result max(10, w) (0x62CD30..0x62CD7F).

  5. name 0x6300F0 ≙ 0x507580: world R % 35, redrawn while 0x631A30 finds it taken, at most 15 draws (identical shape).

  6. valid +0x11=1, stamp, timeout StaffTimeoutTime + R % (StaffTimeoutTime>>1) (0x630690..0x6306AC) as TPW.

Opening pool 0x631F30 ≙ 0x5087C9 ("Tried to generate the opening staff pool more than once" 0x6320F2 / 0x508960). Hire: member constructors 0x626190 ("specific") copy salary → +0x214, experience → +0x210, agency → +0x244 (0x6261DA..0x626205); both constructors end in 0x626390, which sets the three meters to 100.0 (0x6263D6..0x6263E7) as TPW. No hire fee: the cost keys are unreferenced (§2), as in TPW. Hire UI / placement path: unread.

4. Wages and payroll#

TPWTPI
amountPayMultiplier[role] × BaseWage[grade] (0x504C9A, 0x504CA4)the member's own mSalary +0x214 (0x6265DE)
whenstaff message type 0x0C in 0x504C70message type 0x0C in 0x6265C0; 0x0C is sent by the clock when the month changes (0x60852C..0x608540 → 0x435900, 0x435920 returns 0xC); 0x0B on a day change (0x608484..0x60849F → 0x435890)
bank0x5195D0 → 0x4D01F0, accumulated at analyser +0x1F7F00x64EBE0(salary) → 0x5C07B0, accumulated at park +0x1FA58 (0x6265EB..0x626617)
after paying—wage review 0x62CDA0

Wage review 0x62CDA0 (also after a salary change 0x62D160, which clamps the new salary to ≥ MinWage): expected = ExpectedWage(exp, MaxWage[role]) inline (0x62CE35..0x62CE7A) plus the raw InitialWageModifier[agency] (added, not a percentage, 0x62CE88). If salary < expected: x = UnHappyWageVal × (MotivationLossModifier+1) (or UnHappyWageVal when either is 0); motivation +0x234 += −(x/2) (toward zero), happiness +0x230 += x × −0.25f, both clamped 0..100; shortfall +0x270 = expected − salary. Else +0x270 = +0x26C = 0; y = HappyWageVal × (MotivationGainModifier+1); +0x234 += y, +0x230 += y. Then if +0x270 ≠ 0 and trunc(+0x234)&0xFF ≤ LowestWageHappiness: wage-demand day +0x26C = rand() % 27 + 1 (CRT 0x870D38, 0x62D016..0x62D046).

Daily routine 0x628CA0 (message 0x0B, 0x626626): experience gain 0x629650 (§5); then when +0x26C > 0, at least 30 days since the last demand (0xAA07F4, 0x628CFE..0x628D0E) and today's day-of-month equals +0x26C: an advisor/UI notice (0x628D61..0x628DAF) and a wage-demand object 0x5CEFB0(t, member, shortfall +0x270) with t = 0xA when the role has a grievance (0x633740) and the park is younger than MinMonthsForStrike months, else t = 0xB (0x628E0A..0x628E9A). Negotiation 0x559E00: offer ≥ demand → result 2; else offer/demand × 100 ≥ 100 − PercentageForBadWageDecision → result 1; else 0 (0x559F74..0x559FF2). Rest of the negotiation and 0x62D1A0: unread.

5. Experience, work durations, ranges, speed, idle#

TPW keys every one of these by grade; TPI by experience:

6. Meters, rest, slacking, training#

Member meters (single floats, start 100.0 0x6263D6): +0x230 happiness, +0x234 motivation, +0x238 energy. Proof: the strike test compares +0x238 with EnergyPercentToStrike ("fatigue"), +0x230 with HappyPercentToStrike ("unhappiness") and +0x234 with MotivationPercentToStrike ("lack of decent wages") (0x63379F/0x6337D0, 0x63381D/0x63384E, 0x63389F→0x633F8D). docs/THEME-PARK-INC.md and ThemeParkIncStaffMeters used to read +0x234 as happiness. Challenge 0x5AFED0 (min of +0x230) is therefore min happiness.

stepTPWTPI
moving0x5066A0: energy −= 0.012·(6−g) (double), happiness −= 0.005·(6−g)0x62B3E0: d = 1 − exp/MaxExp; energy += d × −0.1f; happiness += d × −0.05f; clamped
working0x506760: energy −= 0.025f·(6−g), happiness 0.010x62B4D0: identical to 0x62B3E0
rest0x5061D0: rates 0x785334/38 + 16g0x62A1C0: f = exp/MaxExp; e = MinRecuperationRate + f (x87 add, no Max−Min factor); += e×RecuperationModifier×0.01 if nonzero; min(e, MaxRecuperationRate); h = f × 10 × MinHappinessRecuperationRate, += h×HappinessRecuperationModifier×0.01, min(h, MaxHappinessRecuperationRate); energy += e, happiness and motivation += h; at trunc(energy)&0xFF == 100 end rest (0x62C230) and look for work (0x62D810)
tired test0x5066800x62B3B0: trunc(energy)&0xFF < RestLevel

Look-for-work 0x62D810 dispatches by kind (entertainer 0x5D1A30, handyman 0x5D52A0, gardener 0x5D28C0, guard 0x5D3C10, mechanic 0x5DA3D0, researcher 0x61B820), then if trunc(motivation) < MotivationPercentToStrike/2 and display state is 2 or 7 it goes to the nearest rest area (state 2) or idles (0x62D866..0x62D94D). Slacking 0x62D650: energy byte < StaffSlackingEnergy and the nearest rest area's dx²+dy² (cell units) ≤ MinDistanceForSlacking (unsquared key) → that rest area (+0x248). Rest areas have a capacity (StaffRoomCapacity, 0x629EF0, 0x62CA90); research rooms (0x62BD8D, 0x62E050, 0x62E0E0, "Looking for Research Room") and the room-inaccessible happiness hit: partly read only.

Training is a different mechanism. TPW 0x505A10 (CStaff::Train) spends a monthly budget per role in points (OpenTPW). TPI: dropping a member on a training cell (0x629B20: 0x639BE0 finds it) with exp ≥ MinExperienceForTraining and 0x639B20 accepting (ability activated 0x5F0370, compatible 0x62B6C0, exp ≥ 10000 hard-coded 0x639B77) sets +0x22C = 2 and state 7 (0x629BC4..0x629BE0). Each training tick 0x62AA50: mSAProgress +0x224 += SkillIncrement; at ≥ ProgessUpperLimit: the learnt ability +0x218 = +0x220, progress and current reset, notice 0x175, 0x62AB90, motivation = 100.0, exp += TrainingExtraExperience, then += exp × TrainingExperienceGainModifier/100, cap MaxExp (0x62AA50..0x62AB3D). Abilities: ABILITIES.str (15 entries: Ride Upgrading, Construction, …, First Aid, …); HQ counts them in mTrainedStaff[15] (message 0x2B, 0x63256F..0x6325AA). The HQ budget object (+0x140, ctor 0x6394A0, serializer 0x6394D0: six budgets, mHaveEverTrained) has no reader found in this pass.

7. Strikes#

TPWTPI
triggerHQ message 0x0C → 0x508E70HQ message 0x0C → 0x632C20 (handler 0x6323C0, table 0x6325E4)
park closed / guestsskipped while closed or 0x4C7FA0 counts guests, unless forced (0x508E7E..0x508EAE)no such test (0x632C20 starts with the role loop)
per role, once per turn+0x24+12r level / +0x28 active / +0x2C turn; active → just cleared (0x508F31)+0x15C+12r / +0x160 / +0x164; active → 0x6342B0(r,0), which clears it and posts message 0x17 kind 5 (0x6342CF..0x634349)
age gatemonths ≥ 24 (cmp $0x18 0x508FD6)months ≥ Strike.MinMonthsForStrike (0x633117); same clock function 0x608C70 ≙ 0x4F8800
grievance test0x509360: forced → 1; handymen first: analyser ratio > 0.2 → 1 (0x5093C2); per role count > 3 and avg energy byte < 15, or happiness the same → 10x633740: forced (+0x1A8) → 1; no analyser test; per role count ≥ MinStaffOfTypeForStrike and avg energy byte ≤ EnergyPercentToStrike → 4, avg happiness ≤ HappyPercentToStrike → 2, avg motivation ≤ MotivationPercentToStrike → 3
escalation0→1 msg kind 0; 1→2, 2→3 kind 2; 3→4, 4→4 kind 2 (0x509028..0x50921D); kind 3 message at 0x5092A3 (no-grievance branch per OpenTPW; branch condition unread here)0→1 warning msg (+0xC=2, +0x10=grievance) 0x63316B; 1→2, 2→3, 3→4 active, msg (2, 0) 0x6331F8, 0x6332C9, 0x63339A; 4→2 active, no strike message (0x63344A); no grievance: level ≥1 → msg (3, 0) and 0x6342B0(r,1) (0x63349B..0x633524)
message 0x170x40F6F0: +8 role, +0xC kind0x435CA0: plus +0x10 reason

Strike walk 0x62BBA0 ≙ 0x506A38 (same four world draws into StrikeArea, same strings). Force strike toggles: 0x634530..0x634558. Receivers of message 0x17 and the advisor cues 0x636B90: unread.

8. Roles#

roleTPW (OpenTPW cites)TPI counterpartDifferences read
mechanic search0x4DA5B00x5DA3D0target +0x5D8 (TPW +0x218); extra check 0x62C6B0(ride) before "found a ride" (0x5DA447); notice text 0x43 vs 0x46; extra branch 0x5E3400(1) on the ride after 0x5E3950/0x5E3B70/0x5E28A0 (0x5DA4EF..0x5DA514); state 21 vs 12. Arrival 0x5DA650 ≙ 0x4DA732, fix anim 0x5DA7C0 ≙ 0x4DA824. Ride wear/breakdown rules (attraction side): see "Mechanics and ride wear" in §11
handyman0x4D73C0 family0x5D4BA0..0x5D6230adds litter bins ("dirty or burning bin" 0x5D553B, mBinToClean); litter/toilet strings match (0x5D5502 ≙ 0x4D730F, 0x5D5B89 ≙ 0x4D7743, 0x5D59FC ≙ 0x4D75B1); range/period §5. Littering 0x5D8C80 ≙ 0x4D93A5, removal 0x5D90D0 ≙ 0x4D961B
entertainer0x4D48100x5D1A30 search, 0x5D1BC0 performanceperformance length from 0x62E4C0 (TPW 0x785398+16g, 0x4D484A); constant search range (§5); new "Ouch! You little git!" 0x5D18DC. HappinessEffectOnCell unreferenced in TPI. Ported (see "Entertainer and guard" in §11)
guard / pranks0x4D6410; HQ prank msg 0x0E 0x508A30HQ msg 0x0E 0x6323F9 (same strings and security-level test), nearest guard 0x6343C0 ≙ 0x5099C0, chase 0x5D3960..new first aid (mPatientId, mFirstAidTimestamp), prosecution stamp, two release points ("can't get to either release point" 0x5D42CC) instead of TPW's ticket-booth keys (absent in TPI data); "Too tired to chase kids" exists only in TPW (0x4D627F). Ported without the chase and first aid (see "Entertainer and guard" in §11)
researcher0x5025F3..0x61AEC0..0x61B94F, 0x62DF50research ability via 0x62E4C0 (§5); research rooms; lab body differs (§9)
gardener—0x5D2480..0x5D2F00new; pool keys borrowed from handymen (§2)

9. Staff HQ and save layout#

HQ ctor 0x632270 ≙ 0x5089C0: TPI 0x1AC-byte body (+0x14 20 staff slots × 12, +0x104 15 trained-staff counts, +0x140 training budget, +0x15C six strike records, +0x1A4 picked-up id, +0x1A8 force strike); subscribes to 0x0C, 0x0E, 0x2A, 0x2B, 0x21, 0x23, 0x24 (0x6322C8..0x632333; TPW only 0x0C, 0x0E at 0x5089F7..0x508A17). 0x21/0x2A → 0x634730 (staff slots), 0x23/0x24 → 0x634D20: unread. Member/candidate/HQ save layouts are already parsed by OpenTPW (ThemeParkIncBodyLayout.Data.cs); the only correction is the meter naming (§6). TPW member offsets (happiness +0x1F8, energy +0x1FC, grade +0x1E4) have no TPI equivalent for grade.


10. Port plan (prioritized)#

P0 – data and identity (prerequisite). A ThemeParkIncStaffSettings reading exactly the keys in §2 (no grade arrays); a sixth role Gardener (kind 0x14, role 5, list +0x1EAB7E); reproduce the handyman-key borrowing for gardeners (Max/MinInPool/BeginningNumber/ AvgExperience/ExperiencePerMonth) and the constant entertainer search range as read. Fix the TPI meter naming in docs (§6).

P1 – reuse the TPW port unchanged (structure identical, only offsets/sizes differ): pool update skeleton and timing (0x631B40 ≙ 0x5084F0), candidate timeout and name draw (0x6300F0 ≙ 0x507580), MaxInPark/minimum top-up shape, strike-area walk (0x62BBA0 ≙ 0x506A38), strike month-consideration loop shape and the clock age (0x608C70 ≙ 0x4F8800), prank → nearest guard dispatch (0x6323F9 ≙ 0x508A30), mechanic HQ search skeleton (0x5DA3D0 ≙ 0x4DA5B0), rest-area search and rest end at energy byte 100, patrol rectangle, littering/removal (0x5D8C80/0x5D90D0 ≙ 0x4D93A5/0x4D961B).

P2 – TPI-specific replacements (exact rules above):

  1. Candidate generation 0x6302C0 (experience, agency by CRT rand() 0x870D38, expected wage 0x62CD30, modifiers) and the pool's extra expiry condition (0x631B71). A second RNG stream (CRT) must be modelled for determinism (0x6302ED, 0x62D038).

  2. Payroll: monthly debit of mSalary (0x6265DE), wage review 0x62CDA0, salary setter 0x62D160.

  3. Daily routine 0x628CA0: experience gain 0x629650, wage demands, negotiation 0x559E00.

  4. Meter steps 0x62B3E0/0x62B4D0/0x62A1C0, slacking 0x62D650, low-motivation rest 0x62D866.

  5. Experience-driven work durations 0x62E4C0, ranges and periods (§5), speed 0x62C970, idle 0x62CA10.

  6. Strikes: 0x633740 (3 grievances, data thresholds, no analyser test), 0x6330B0 escalation (4→2, reason field), end message 0x6342B0, no park-closed skip, MinMonthsForStrike.

  7. Training by rooms and abilities (0x629B20, 0x639B20, 0x62AA50), replacing the TPW budget split.

  8. Display states 0–8 and role state renumbering (mechanic 21/22; others unread).

P3 – unread / still open: other roles' state numbers and handlers in detail; ride wear and breakdown rules on the attraction side; 0x62C6B0 and 0x5E3400 in the mechanic search; litter-bin logic (0x5DB1B0, 0x5279E0); gardener plant watering; guard first aid, prosecution and release points; research rooms and the researcher's lab work (0x62DF50, 0x61B820); staff rooms/slots (0x634730, 0x634D20, 0x629EF0, 0x62CA90); HQ training budget readers; 0x62D1A0; wage-demand object 0x5CEFB0 and the rest of 0x559E00; message 0x17 receivers; pool role flags +0x41D..+0x422 and the researcher minimum 0x631970; hire UI and placement; the meaning of 0xA5EA48/0x540E70; agency promotion level source 0x42A3B0()+0x1060.

11. Port status#

Ported as an economy model, without the world simulation, and checked against the executable:

Not ported yet: the guard's chase, carry and first aid (see "Entertainer and guard" below). The wage demands, the negotiation, the dismissal and the strikes in the park are in TPI-WAGES.md. Slacking (0x62D650) and the low-motivation rest (0x62D866) are ported with the rest areas (§13). Training is ported since November 21, 2026 (§12.2).

Since November 21, 2026 the pool runs in a Theme Park Inc park: the opening pool at the new-world init (0x630CB0), the pool update in every world update's tail after the thing loop and before the calendar (0x649868), the career rank 1 for the agencies (0x74BDC7), the pool in the Science continuation save, and a Staff panel in the HUD.

Handymen in the park (WP3, November 21, 2026)#

A separate Theme Park Inc staff world (World/Staff/ThemeParkInc/ThemeParkIncStaffWorld.cs) runs the placed members; Theme Park World's staff code is untouched (the slice refuses its staff capability, so its staff world is not built in a Theme Park Inc park).

Labels: the walk step 0x60B440, the route search behind the staff route 0x62EB10 (SetDest 0x63E3A0), the patrol destination 0x609F70 and the speed step 0x60BC90 use Theme Park World's walk, wander and speed smoothing ([EXT:tpi-twp-guest-rules], user-approved 2026-11-21 for the staff's walk; WP0 found D1/D2/D5 differences and read 0x609F70 as a call skeleton only), as do the guests' bin search, bin walk and bin arrival; the loo finder 0x5D6230 and the bin finder 0x5D5F10 find nothing to clean because Theme Park Inc's toilet wear and the bins' fill are unported ([EXT:tpi-no-maintenance-wear], reworded: the handymen ship without loo and bin cleaning); every role is hired since the entertainer and the guard (WP11, WP12).

The rest-area finder 0x62BA20 (in the gate, the slack test 0x62D650 on entering state 1 and the low-motivation check of 0x62D810) tests a thing for the flag +0x42 bit 2 (and +0x7C nonzero), which the thing builder sets only from the type record's +0x1B0 (UsageInfo.ChillsYouOut, 0x5DB6E2). Until the facilities were loaded no object of the catalogue set the key and the finder answered none; the staff rooms of the facilities folders set it, and the rest areas are ported in §13.

Not read or not ported in this package (inert, no stand-in; the strikes and the negotiation came later, TPI-WAGES.md): the drop fallback's scan of a 180 or 270 degree object covers the rectangle 0x5E9320 computes, which is not the turned footprint (ported as the executable has it); the thoughts and voices' presentation (0x638960, 0x60BE90: their draws are taken, the voices queued); TPI litter types 9 to 12 (the pending-item drop 0x613D00, whose gate is unread); the stinkbomb particle's TPI position; the dead stale-claim sweep 0x5D73A0 (no static caller).

Mechanics and ride wear (WP9, November 21, 2026)#

Read from Game.exe (static, with the routines run in tools/ppc-analysis/oracle_x86/tpi_ride_wear_oracle.py, which agrees with the port on 3000 random cases at the 24-bit and the 53-bit control word; --golden prints native wear-amount and wear-tick cases, which ThemeParkIncMechanicTests pins as numbers, a clamped repair, a clamped life and a worn ride among them). Ported in ParkEconomy.ThemeParkIncRides.cs and ThemeParkIncStaffWorld.Mechanics.cs; tested in ThemeParkIncMechanicTests and, for the level's side (the request's close, the repair tail and the relief object's VAR_WORN), ThemeParkIncRepairTailTests.

Type record. The key table at 0x9A2CC0 (60-byte descriptors: type word and name) lays the type record out four bytes a key from Id at +0x10, sections adding nothing and a count word after each array. That puts MaxCapacity at +0x1E4, MaxSpeed at +0x1F4, the Upgrades[n] records (72 bytes) at +0x270 (RedLineCapacity +0x290, RedLineSpeed +0x2A0, WearRate +0x2A4, DurationOfUpgrade +0x2B0, RunningCost +0x2B4), RideBreakDown.Imminent at +0x3C8 and RideBreakDown.WarnPlayer at +0x3CC; the AddOn keys after them land at +0x3D0..+0x3D8, where their readers (0x4D63C0, 0x594E19) take them. Info.IsSpecial is +0x5C and Info.RunsContinuously +0x6C (the thing flag +0x43 bit 1, 0x5DB782); UsageInfo.HoldsLitter +0x1A8 sets +0x42 bit 0x40. Both readers of Info.IsSpecial (0x5E26FB, 0x5E493B) compare it with 1, so only the value 1 makes a type special. Every wearing ride of the three worlds has Imminent 10 and WarnPlayer 5. The constructor starts the life gauge +0x58 at Info.WorkingLife (+0x8C), 100 when it is 0 (0x5DB53A); the prebuilt Science park's rides were saved at exactly that.

Object update 0x5E4790 (kind 3 in the thing pass 0x6375E0, before the state dispatch 0x5E4CB0): state 3 or 4 returns; with the state not 1, the open word +0x7C set and the turn & 7 zero, the wear tick 0x5E25B0 runs, then the breakdown request: a life or repair byte of 0 on an object that is not a relief object and whose VAR_BREAKSTAT is 0 loses 5.0 life (clamped) unless its life byte is 0 or its type is special, and writes VAR_BREAKSTAT = 1 ("Object %d: requested breakdown"); this is the writer research item U1 was missing. The state dispatch's state 0 (0x5E5960) turns the script's VAR_BROKEN into state 1, or 4 at a life byte of 0, as Theme Park World's. A relief object below a repair byte of 25 writes VAR_WORN = 1 on every update (0x5E3990). Two blocks of 0x5E4790 are not part of this port:

The level wires the ride events itself (Level.SetupThemeParkIncRideEvents): a Theme Park Inc park runs no park gate ([EXT:tpi-park-open]), so the Theme Park World wiring in SetupParkGate does not run there. The economy's script writes reach the ride's script, a maintenance request closes the ride, and a finished repair runs the closing tail, whose guard is the reopening guard ParkGate.MayOpen over the level's path grid.

The request's cancel 0x5E3400(0) (0x5E3509): "has cancelled its request for maintenance"; nothing when +0x78 is 0; else +0x78 = 0 and, unless the object is a bin or a plant (+0x42 bits 0x40 and 0x1000), the open 0x5E1DC0, whose guard only logs "Opening non-openable ride": the open word, VAR_RIDECLOSED = 0 and SetState(0) (0x5E5160 stores the state at once, so a broken ride's state goes to 0 until its script's VAR_BROKEN turns it into state 1 again); then a claim (+0x72) ends: the claimant's common setter 0x628180(0), which keeps his target +0x5D8, and +0x72 = +0x74 = 0. Its callers are the native ride panel's cancel button 0x5563F0 (it pushes 0; the call 0x5562E0 beside it pushes 1, both on the panel's object 0xA60384, through the thunk 0x4089E0) and the toggle 0x50FCD0 (sete on its flag). The text HUD replaces that panel and has no call or cancel control ([EXT:tpi-text-hud]), but the shared RequestMaintenanceCommand (the co-op guest's call button, ParkHud.GuestAttractions) has no edition gate, so a park with Theme Park Inc's staff runs it as Theme Park Inc's request and cancel (ParkEconomy.RequestMaintenance → RequestThemeParkIncMaintenance, CancelThemeParkIncMaintenance), and the level opens the ride on MaintenanceCancelled whatever its guard, as 0x5E1DC0 does. The command's call follows the ride panel's button state 0x5511B0 (case 0x13, 0x5511FB): it is enabled while the staff HQ (world +0x1EAB54) counts a thing of the mechanics' kind 4 (0x5B2DB0(4): things of that kind whose byte +3 is 0), that is a placed mechanic, and no strike is tested; the cancel needs no mechanic. (0x556300, the enabled test beside the cancel 0x5563F0, counts kind 20, the gardeners, for its panel.) Two corners are left as they are: in state 2 the original's SetState(0) would end an upgrade, which the port refuses because Theme Park Inc's upgrades are not sold; and the store would overwrite a state 3, which no request reaches.

Wear tick 0x5E25B0. Upgrades[level].WearRate 0 returns; the script's VAR_RUNNING (variable 9) above 0 or Info.RunsContinuously; the turn & 0x3F zero. VAR_ONRIDE (variable 5) 0 gives the wear 0, else 0x5E21A0: riders clamped to 0..MaxCapacity; s = 0.9 × speed / MaxSpeed (the script's speed +0xC0, 0x6B0C30), then s + 0.1, or (s + 1.1) × 0.5 at or above RedLineSpeed; c = 0.9 × riders / MaxCapacity, then c + 0.1, or (c + 1.1) × 0.5 when RedLineCapacity <= riders × 0.1; the wear is (c + s) × WearRate × 0.5. Repair loses the wear and life 0.02 × the wear unless the type is special, each clamped to 0..100; a repair byte below WarnPlayer writes VAR_WORN = 1; below Imminent with the byte plus the wear not below it posts advice 0x40 (not posted: the advisor queue takes only the forecasts and the letters so far). No random number is drawn. The world update runs at the 24-bit x87 precision the Direct3D device sets ([EXT:hardware-d3d-path]); the port rounds every step to a single.

Mechanic. Kind 4, constructor 0x5D9B50 (the person and member start 0x626190, sprite category 0xA in template 3, +0x5D8 and +0x5D4 0, the setter's state 0, the removal message 10 subscribed, the search). The update is the common pre-update (0x5DA3B0 jumps to 0x628050) and the dispatch 0x5DA280: 0 idle (voice 0xA3, the idle end 0x62CA10), 1 patrol (voice 0xA2, the walk, the search on arrival or stuck), 21 to the ride 0x5DA650, 22 repairing 0x5DA7C0; 2 and 3 are the rest area's (0x629EF0, 0x62A1C0, the handyman's entries; with the staff rooms built a tired mechanic runs them, §13), and 0x23 goes through the common handler 0x6287A0 to 0x62CA90.

Gated: the upgrade job (the economy sells no upgrade, so no ride reaches state 2; a mechanic does learn Ride Upgrading, +0x218 = 1, in the training room, see above); the advisor's ride messages 0x40, 0x43 and the clearing of the ride's queued notices 6..9 (0x636D10) ([EXT:tpi-capability-gates], the advisor's other messages; they draw nothing); the patrol area 0x6256A0 (WP15). The loo and bin finders and the toilet wear stay under [EXT:tpi-no-maintenance-wear], which no longer covers the rides. No rand() call is reached: the paths above draw only the world generator, in the gate and the patrol, as the handyman's.

Gardener and plants (WP10, November 22, 2026)#

Read from Game.exe (static; the plant update and the chooser run natively in tools/ppc-analysis/oracle_x86/tpi_gardener_oracle.py, which agrees with the port on 3000 random cases at the 24-bit and the 53-bit control word). Ported in ThemeParkIncStaffWorld.Gardeners.cs and ParkEconomy.ThemeParkIncPlants.cs; tested in ThemeParkIncGardenerTests and ThemeParkIncPlantTests. research/tpi-staff/gardener.md (in the notes) was the starting point; every address below was read again.

Plants. A type with UsageInfo.RequiresWatering (+0x1AC) gives its thing the flag +0x42 bit 0x1000 and the RegionFX row 10 at the thing's cell (0x5DB63F..0x5DB675). The thing's script loader 0x5DE610 tests that flag first and loads data\levels\vegetation.rse (0x9CEE9C with .rse) instead of the type's own script (0x5DE61A); the constructor then writes VAR_TIMEOUT (2) = Vegetation.TimeBetweenWaterings, VAR_TEST (5) = TestAnimation and VAR_SCALE (14) = 1000 (0x5DB850..0x5DB88A). The script waits VAR_TIMEOUT × VAR_SCALE (SETTIMER after MULT) and then moves VAR_CONDITION from 0 (healthy) through 1 and 2 to 3 (dead, VAR_DEAD = 1), noting the old condition in VAR_OLDSTATE; VAR_WATER = 1 brings 1 or 2 back to 0 (2 through 1) and restarts the timer, but not 3; VAR_SETFIRE and VAR_ONFIRE run the fire objects. A plant is not choosable (Info.IsChoosable 0), so its object state is 3, and the attraction update (kind 3: 0x5E4790, then the state dispatch 0x5E4CB0, 0x63760B) runs the plant block 0x5E4CDE on every turn:

Gardener. Kind 0x14 (SaveThingModel.Gardener, 20), dropped through 0x4D4FB5 into the constructor 0x5D2230: the person and member start 0x626190, +0x5D0 = 0 and the gardener list (0x64F510: world +0x1EAB7E, the members' gardeners newest first), the sprite category 0x12 (+0x34, 0x5D1000(3, 0x12, variant): esprites.wad's Generic\Gardeners, Spr_gd), +0x5D8 and +0x5D4 = 0, the removal message 10 subscribed, then the search. The thing update 0x63763E runs the pre-update 0x5D2820 and the dispatch 0x5D2A60.

Training: the gardener learns abilities 10 to 14 (0x62B6C0) through §12.2 and fills a staff HQ slot that asks for one (the rebuild's staff type 5, the finder 0x6348C0).

Not ported (inert, no stand-in): the facing 0x609E60 (the heading word +0x2C from the queue link of his cell, in the 2048 units of 0x91E074: presentation; he keeps his walk's last heading under [EXT:tpi-twp-guest-rules], D1); the destructor's claim release 0x5D2430 → 0x5E37B0 (Theme Park Inc staff cannot be fired yet); the advisor's notices ([EXT:tpi-capability-gates], the advisor's other messages); the patrol area 0x6256A0 (WP15); the guests' fire prank on plants (0x618F30, VAR_SETFIRE, with the guests' Theme Park Inc pranks); the plant counts of the statistics (0x5B4470, 0x5B8960); the handyman's bin finder's plant branch for ability 7 (0x5D5FAC, with the bins, whose fill is unported: [EXT:tpi-no-maintenance-wear]). No rand() call is reached: the gardener draws only the world generator, in the gate, the walking voice and the patrol.

x87 precision. 0x5D2820 runs at the game thread's 24-bit control word (0x007F, [EXT:hardware-d3d-path]), and so do the handyman's shared helper SearchPeriod, the idle term IdleTerm and the step member.Step (the moving step 0x62B3E0 and the working step 0x62B4D0, which are identical) since November 22, 2026 (§12.4): each x87 step rounds to a single. With MaxExperience 100000, experience 34000 gives a search every 33rd turn (33.0); at 53 bits it would be 32 (32.99999999999999).

Entertainer and guard (WP11, WP12, November 22, 2026)#

Both are hired and dropped like the other roles (thing models 6 and 7 of the pool; the type codes follow the role order, §12.2). Static reading of Game.exe; the routines named were read at the addresses given and the entertainer's and guard's machines run natively in tools/ppc-analysis/oracle_x86/tpi_performer_oracle.py.

Not ported, with the reason:

12. Staff HQ obstacle slots, training and research (November 21, 2026)#

12.1 The staff HQ's obstacle slots#

ThemeParkIncStaffHeadquarters (held by ThemeParkIncStaff.Hq, saved in its snapshot) is the slot part of the HQ thing (class 9, park+0x1EAB4C, constructor 0x632270):

Message delivery: the queue 0xA09728 reaches its listeners in ascending handle order; OpenTPW calls the listeners at the post (ParkEconomy.ThemeParkIncObstacleResearched, ThemeParkIncObstacleRemoved), the HQ before the mission controller.

12.2 Training and abilities#

ThemeParkIncTraining (rules) and ThemeParkIncStaffWorld.Training.cs (states 7 and 8 of a placed member) port Theme Park Inc's training, which replaces Theme Park World's budget split:

12.3 Research and the researchers#

ThemeParkIncResearch (the lab thing, class 14, and the object controls' researched words) and ThemeParkIncStaffWorld.Researchers.cs port Theme Park Inc's research, which replaces Theme Park World's effort split:

12.4 The game thread's x87 precision (November 22, 2026)#

Every Theme Park Inc routine that runs on the game thread is read at the x87 control word 0x007F (24-bit significand, round to nearest even), as tp.exe's are ([EXT:hardware-d3d-path]); the earlier convention "[BIN:TPI-EXE:0x5BCD60 precision] 53 bits" is withdrawn. Static reading of Game.exe:

13. Rest areas (November 22, 2026)#

The facilities folders (docs/THEME-PARK-INC.md, "Facilities") bring one staff room per zone (Science 1400, Water 2420, Arabian 3418) with UsageInfo.ChillsYouOut 1. The thing builder sets the thing word +0x42 bit 2 from the type record's +0x1B0 (0x5DB6E2), so the staff rooms are the only rest areas (ThemeParkIncRestTests.TheStaffRoomsAreTheOnlyRestAreasOfTheThreeZones). ThemeParkIncStaffWorld.Rest.cs ports the rest for every role: the handyman's table (0x5D58C4), the mechanic's (0x5DA358), the researcher's (0x61B774), the gardener's (0x5D2B68: the bytes 00 01 02 03 for states 0 to 3, the jump table 0x5D2B4C entries 2 and 3 calling 0x629EF0 and 0x62A1C0), the entertainer's (0x5D1F70, jump table 0x5D1F58: entries 2 and 3 at 0x5D1F05 and 0x5D1F11) and the guard's (0x5D3DD8, jump table 0x5D3DB4: entries 2 and 3 at 0x5D3D67 and 0x5D3D71) send states 2 and 3 to 0x629EF0 and 0x62A1C0, and the common handler (0x6287A0, reached by every role's dispatch for 0x23: above the handyman's 0x14, the researcher's 3, the mechanic's 0x16, the gardener's 0x20, the entertainer's 0x17 and the guard's 0x1E) sends 0x23 to 0x62CA90 (state − 4 = 0x1F in its byte table 0x628B10 is entry 10, 0x62897B). The member's rest area (+0x248) is saved with him (RestArea). Read in this package (the WP4 notes, research/tpi-staff/wp4-rest.md, verified and corrected):

The rest formula ThemeParkIncStaffMember.Rest, the moving step and the daily gain run at the game thread's control word 0x7F (24-bit significand, §12.4, tpi_staff_formula_oracle.py). The removal's walk in state 0 and the debug notices (0x4D15A0, 0x4D15C0) are as read; the notices are not shown.

The finder 0x62BA20 walks the object list (park +0x1EAB88, ParkEconomy.ThemeParkIncObjectList), newest first, not the thing list; ThemeParkIncRooms.RestAreas and First walk the same list.

Source: docs/reverse/TPI-STAFF.md in the project repository.