The Escapists 2 Decompilation

Interactions, Minigames and Audio

The Escapists 2 - Interactions, Minigames and Audio system documentation

Table of Contents

  1. Core Interaction Framework
  2. Animated Interaction System
  3. Item Transfer Interactions
  4. Multi-Stage Construction & Escape Interactions
  5. Specialised Interactions
  6. Carry Systems
  7. Service & Job Interactions
  8. Minigame System
  9. Audio System
  10. Animation & Effects
  11. Appendices

1. Core Interaction Framework

1.1 InteractiveObject (Base Class)

File: Assembly-CSharp/InteractiveObject.cs

All interactive objects in the game derive from InteractiveObject : T17MonoBehaviour. This is the abstract contract that defines how characters (player or AI) discover, reserve, start, and stop interactions.

Enums

EnumValuesDescription
InteractiveTypePrimary, Secondary, Tertiary, PressAndHold, PressAndHoldSecondary, PressAndHoldOnlyDefines which input action triggers the interaction
InteractiveEventTypeReadyStart, Started, ReadyEnd, EndedLifecycle event phases
CharacterResctrictionsAnyoneCanUse, PlayersOnly, AiOnlyWho is allowed to interact
InteractionTypeInteractiveObject, AnimatedInteractiveObject, PortableInteractiveObjectRuntime classification for serialization

Key Serialised Fields

FieldTypePurpose
m_InteractTypeInteractiveTypeInput binding for this interaction
m_AllowedCharacterTypesCharacterResctrictionsAccess restriction
m_bIsEnabledboolGlobal enabled/disabled toggle
m_bInteractionVisibilityboolWhether the interaction shows in the HUD
m_ValidInteractingDirectionsDirection[4]Allowed approach directions (up/down/left/right)
m_AI_InteractionAffinityfloatAI preference weight for this object
m_interactingCharacterCharacterReference to actively interacting character
m_vStartingPositionVector3Snap position for the character
m_bObjectReservedboolReservation flag
m_ReservingCharacterIDbyteWho reserved it
m_NetObjectLockNetObjectLockNetwork lock for multiplayer contention
m_NetViewIDT17NetworkViewIDNetwork identity
m_LocalInteractionIDintLocal index for interaction tracking
m_bLeaveCharacterPositionUnalteredboolSkip position snapping
m_bCanBeUsedOutsideJobTimeboolAllow usage outside scheduled job hours
m_StopInteractionWalkThresholdfloatDistance threshold for auto-stop when walking away

Interaction Lifecycle

Reservation (NetObjectLock)


WalkToTarget (pathfinding)


OnStartInteraction()


InteractionReadyStart()

    ├── InteractionReadyUpdate()  ← loop (every frame while ready)


InteractionReadyEnd()


OnExitInteraction()


RequestStopInteraction()

Core Methods

MethodPurpose
AllowedToInteract(Character, bool)Gate check — can this character start?
InteractionVisibility(GameObject)Should the "press X" prompt show?
CanStartOrContinueInteraction(Character)Runtime check during active interaction
OnStartInteraction(Character)Enter the interaction (walk complete)
OnExitInteraction(Character)Leave the interaction
InteractionReadyStart()Begin ready phase (animation, lerp)
InteractionReadyUpdate()Per-frame during ready phase
InteractionReadyEnd()End ready phase
RequestStopInteraction()Initiates stop (walk-away or immediate)
StartInteractionWithTimeline(TimelineAsset)Play a Timeline sequence as the interaction
OnReservationExpired()Called when NetObjectLock reservation times out
SerialiseInteractionForLoad() / OnInteractionRestored()Save/load support

Reservation System

Uses NetObjectLock for network-synchronised reservations. The lock prevents multiple characters from using the same object. A OnReservationRevoked delegate notifies when a lock is forcibly taken (e.g., by a guard searching a desk).

Delegates

public delegate void OnReservationRevoked();

1.2 NodeCanvas AI Actions

Four NodeCanvas ActionTask<AICharacter> actions drive AI interaction behaviour:

Interact

File: Assembly-CSharp/Interact.cs

FieldTypePurpose
m_interactionTargetGameObjectTarget object to interact with
m_interactionObjTargetInteractiveObjectResolved component
m_SpecificInteractionstringType name for specific interaction class lookup
kickedByCharacterCharacterWho kicked the AI off this interaction
m_bReturnOnStartboolImmediately succeed on start
m_bComplainAboutKickboolPlay complaint speech when kicked

Resolves target component via GetComponentInChildren<InteractiveObject>() or Type.GetType(m_SpecificInteraction). Uses OnInteractResponse / OnInteractionEnded callbacks; polls CheckStatus() in OnUpdate().

StopInteraction

File: Assembly-CSharp/StopInteraction.cs

Simple action that calls RequestStopInteraction() on the character's current interaction. Includes a 3-second give-up timer — if the interaction doesn't stop within that window, the action fails.

RemoteInteract

File: Assembly-CSharp/RemoteInteract.cs

Forces a target character to interact with a target object:

  • Calls RemoteForceInteraction on the target character
  • If the target object is occupied, kicks the occupant via m_NetObjectLock.KickInteractingCharacter()
  • Used for guard-directed interactions (e.g., sending an inmate to clean)

RandomInteraction

File: Assembly-CSharp/RandomInteraction.cs

AI chooses a random nearby interactive object during free time:

FieldTypePurpose
m_bFreeTimeInteractionsboolOnly pick free-time-eligible objects
m_MinInteractionTimefloatMinimum time to spend
m_MaxInteractionTimefloatMaximum time to spend
m_fSameObjectCooldownfloatCooldown before reusing same object (default 15s)

Uses RoomBlob.GetInteractiveObjectsInRoom() to find candidates, tracks cooldown epochs per object, integrates with pathfinding callbacks (find path → walk → interact).


1.3 InteractionItemRequiremetHelper

File: Assembly-CSharp/InteractionItemRequiremetHelper.cs

Simple validator component:

  • m_EquippedItemRequirement — the required item type
  • Checks if the interacting character has the item equipped
  • If not, plays speech dialog "Text.Emote.ItemNotEquipped" with the required item name as token
  • Returns false from CheckRequirement(), preventing interaction start

2. Animated Interaction System

2.1 AnimatedInteraction

File: Assembly-CSharp/AnimatedInteraction.cs

AnimatedInteraction : InteractiveObject, ICullingWrapperListener — extends the base class with animation playback, positional lerping, and direction-aware animation selection. Most gameplay interactions inherit from this rather than directly from InteractiveObject.

Key Serialised Fields

FieldTypePurpose
m_InteractionPositionOffsetVector3Offset from object origin for character placement
bForceFaceInteractionTargetboolForce character to face the object
m_bFindNearestInteractionPositionboolPick the closest valid position from m_ValidAnimationDirections
m_AnimationDataInteractObjAnimDataScriptableObject with animation clips
m_ValidAnimationDirectionsDirection[8]Per-direction animation variants
m_InteractionObjectAnimatorAnimatorThe object's animator (can be external reference)
m_bTransitionToTargetboolLerp character to position on enter
m_bTransitionFromTargetboolLerp character out of position on exit
m_bInteractionReadyboolFlag set when lerp/walk completes
m_ExitPositionsList<Vector3>Candidate exit points
m_vExitPositionVector3Chosen exit position
m_vInteractPositionVector3Chosen interaction position
m_Z_Offset_InteractionfloatZ-layer offset during interaction
m_fTimer / m_fLerpTimer / m_fLerpTimefloatTiming for animation and lerp
m_Transition_Z_OffsetfloatZ offset during transition

Animation State Machine

StateValueDescription
IDLE0Not interacting
START1Enter animation playing
PLAY2Main interaction loop
STOP3Exit animation playing
PLAYSTATE_A4Alternate loop A
PLAYSTATE_B5Alternate loop B

Animator parameters:

  • "AnimState" (int) — drives the state machine
  • "SpecialToIdle" (trigger) — transition back to idle
  • "SpecialToStop" (trigger) — transition to stop
  • "HoldSpecialAnim" (bool) — hold the special animation state

Direction Resolution

When m_bFindNearestInteractionPosition is true, GetInteractionPosition() evaluates an array of up to 8 Direction values to find the closest valid approach direction based on character position.

Exit Position Resolution

Uses pathfinding to find the nearest walkable exit tile from m_ExitPositions, favouring the original approach direction. If no exit is valid, the character walks back along their entry path.

Culling Wrapper

Implements ICullingWrapperListener:

  • CullingWrapper_OnBecameVisible() — re-enables the animator
  • CullingWrapper_OnBecameInvisible() — disables the animator for performance

2.2 InteractObjAnimData

File: Assembly-CSharp/InteractObjAnimData.cs

ScriptableObject asset that defines animation parameters for an interaction:

FieldTypePurpose
enterAnimationAnimationClipCharacter enter animation
interactingAnimationAnimationClipLoop while interacting
exitAnimationAnimationClipCharacter exit animation
durationfloatTotal interaction duration
lerpDurationfloatDuration of position lerp
walkWhilstLerpingboolAllow character to walk during lerp

This is the designer-facing asset that plugs into AnimatedInteraction.m_AnimationData.


3. Item Transfer Interactions

3.1 TransferItemsInteraction

File: Assembly-CSharp/TransferItemsInteraction.cs

TransferItemsInteraction : AnimatedInteraction — core item transfer between a character and the object's container.

FieldTypePurpose
m_TransferDirectionTransferDirectionToCharacter, FromCharacter, or Invalid
m_bTransferEquippedItemsOnlyboolOnly operate on equipped slot
m_NoItemsLeftSpeechstringDialog tag when container is empty
m_bCycleThroughTransferItemsboolCycle through items one at a time

TransferDirection enum: Invalid, ToCharacter, FromCharacter

Required component: ItemContainer on the same GameObject.

Delegate: TransferCompleteDelegate() — fires when transfer finishes.

Methods:

  • DoItemTransferAndRequestStop() — executes the transfer and stops
  • OnTransferComplete() — calls the delegate
  • OnTransferFailed() — handles failure (inventory full, no items)

Audio: Plays Events.Play_Interaction_Generic (Wwise event).

3.2 ItemInteraction

File: Assembly-CSharp/ItemInteraction.cs

ItemInteraction : TransferItemsInteraction — adds m_bUniqueItemsOnly (only accept items that aren't already in the container). Hooks into GlobalStart to ensure the ItemManager has initialised before becoming active.

3.3 CellBars_ItemInteraction

File: Assembly-CSharp/CellBars_ItemInteraction.cs

Manages covering cell bars with a bedsheet:

FieldTypePurpose
m_BedSheetItemThe bedsheet item reference

Behaviour:

  1. Accepts a bedsheet item via transfer
  2. Toggles the cell bars physics layer between "Fence" (solid) and "BlockVision" (permeable but blocks sight)
  3. Updates BarEventManager with the new state
  4. Toggles NetObjectLock proximity visibility (inmates can't see covered bars)
  5. Sets animator parameter "Covered" (bool)
  6. Plays state "On State On Horizontal" (full-screen blocking animation)

3.4 CellBed_ItemInteraction

File: Assembly-CSharp/CellBed_ItemInteraction.cs

Manages three items on the cell bed:

FieldTypePurpose
m_BedSheetItemBedsheet for rope/dummy
m_PillowItemPillow
m_BedDummyItemDecoy dummy in bed

Animator parameters: "Dummy", "Pillow", "Sheet" (all bools).

Rules:

  • Cannot remove sheet when pillow is on the bed
  • AllowedToInteract returns false if the bed has no items available to give (all slots empty)
  • Integrates with BedEventManager for AI awareness

3.5 MultiStageTransferInteraction

File: Assembly-CSharp/MultiStageTransferInteraction.cs

MultiStageTransferInteraction : TransferItemsInteraction — delegates transfer logic to an IMultistageTransferInteractionResponder (one-child limit).

The responder interface defines:

  • OnItemTransfered(Item, Character) — called when an item is transferred
  • GetValidInteractionItems() — returns the list of items valid for the current stage

4. Multi-stage Construction & Escape Interactions

4.1 MultistageInputInteraction

File: Assembly-CSharp/MultistageInputInteraction.cs

MultistageInputInteraction : T17MonoBehaviour, IMultistageTransferInteractionResponder, Saveable, INetworkLoadable — the core multi-stage construction system used for escape methods, job stations, and other progressive interactions.

Stage Class

FieldTypePurpose
m_ItemRequiredItemItem needed for this stage
m_CharacterSucceedDialogstringSpeech on correct item
m_CharacterWrongDialogstringSpeech on wrong item
m_SignDialogstringSpeech to bystanders
m_StageCompleteSoundstringAudio event on completion
m_StageObjectA / m_StageObjectBGameObjectVisual state objects (toggle on/off)
m_IntellectRequiredintMinimum intellect stat
m_StaminaRequiredintMinimum stamina stat
m_StrengthRequiredintMinimum strength stat
m_bIsProgressedViaExternalboolProgress comes from another interaction

Core Fields

FieldTypePurpose
m_StagesStage[]Ordered array of construction stages
m_CurrentStageintCurrent stage index
ModeSupportedTypesenumSinglePlayer, MultiPlayer, Dynamic

Network Sync

Stage progression uses RPC_SetStage(int stage) for network synchronisation. Supports save/restore via SaveData_MultistageInputInteraction_V1 data structure.

Key Methods

MethodPurpose
ProgressToNextStage(Character)Advance one stage, validate stat requirements
OnInteractedWithFinalStage(Character)Hook for escape/job completion
CheckCorrectAmountOfPlayers()Multiplayer player count validation
SetStage(int stage)Set current stage (RPC)

Required components: ItemContainer, NetObjectLock, MultiStageTransferInteraction, T17NetView

4.2 MultistageInputProgressorInteraction

File: Assembly-CSharp/MultistageInputProgressorInteraction.cs

MultistageInputProgressorInteraction : MultistageInputInteraction — forwards progress to another interaction:

FieldTypePurpose
m_InteractionToProgressMultistageInputInteractionThe target interaction to progress
m_InteractionMinRequiredStageintMinimum stage on target before this can progress

On item transfer, instead of advancing its own stage, it calls ProgressToNextStage() on the target interaction.

4.3 ConstructEndgameInteraction

File: Assembly-CSharp/ConstructEndgameInteraction.cs

ConstructEndgameInteraction : MultistageInputInteraction — base class for all escape method interactions.

FieldTypePurpose
m_EscapeMethodEscapeMethodThe escape method identifier
m_EscapeCutsceneCutsceneCutscene to play on escape
m_EscapeNameplateTextstringText on escape nameplate
m_TrackedItemsToSpawnTrackedItemSpawnEntry[]"Hot" items to spawn in random desks

Player validation:

  • m_TooManyPlayersDialog — speech when too many players present
  • m_TooFewPlayersDialog — speech when too few players present
  • m_InvalidMultiplayerProximityDialog — speech when players aren't nearby

On final stage, spawns tracked items into random desks and triggers the escape cutscene.

4.4 GliderEscapeInteraction

File: Assembly-CSharp/GliderEscapeInteraction.cs

GliderEscapeInteraction : ConstructEndgameInteraction — requires all tiles in m_TilesToDestroy (list of DamagableTile) to be fully damaged before the final stage becomes available. Overrides Child_CanInteract().

4.5 CivilianClothesEscapeInteraction

File: Assembly-CSharp/CivilianClothesEscapeInteraction.cs

CivilianClothesEscapeInteraction : ConstructEndgameInteraction — requires the character to be wearing m_RequiredOutfit (OutfitType) at the final stage. Overrides Child_CanInteract().

4.6 TransportEscapeInteraction

File: Assembly-CSharp/TransportEscapeInteraction.cs

TransportEscapeInteraction : ConstructEndgameInteraction — requires all m_ProtectingGuards (Guard list) in the same room to be knocked out before the final stage. Overrides Child_CanInteract().

4.7 RepeatProcessEscapeInteraction

File: Assembly-CSharp/RepeatProcessEscapeInteraction.cs

RepeatProcessEscapeInteraction : ConstructEndgameInteraction — requires repeated completions before final stage:

FieldTypePurpose
m_CountintNumber of completions required
m_MoreNeededDialogstringSpeech when more reps needed
m_CompletedDialogstringSpeech when done

Tracked via m_CurrentProgressCount; final stage progression only allowed when m_CurrentProgressCount >= m_Count.


5. Specialised Interactions

5.1 Desk System

DeskInteraction

File: Assembly-CSharp/DeskInteraction.cs

DeskInteraction : AnimatedInteraction, IControlledUpdate — full desk mechanic with opening, closing, contraband detection, and inventory management.

FieldTypePurpose
m_DeskOpeningTextTagstringSpeech when opening
m_DeskOpeningTimefloatHow long to hold to open
m_DeskOwnerCharacterAssigned inmate owner
m_LinkedItemContainerItemContainerThe desk's inventory

Static lists:

  • m_InmateDesks — all desks assigned to inmates
  • m_PlayerInmateDesks — desks assigned to player inmates

Behaviour:

  • Timed opening animation with radial progress visual
  • Contraband detection — flags items that shouldn't be in the desk
  • Opens container UI for search/placement
  • Integrates with climbable system (desks can be climbed over)
  • Extensive AI event integration via DeskEventManager

DeskEventManager

File: Assembly-CSharp/DeskEventManager.cs

DeskEventManager : EventManager — manages two AI events:

  • m_InvestigateObject — guard investigates a suspicious desk
  • m_ContrabandInDesk — guard finds contraband in a desk

Uses AIEventManager delegates and implements config overrides for investigation behaviour.

DeskTutorialHandler

File: Assembly-CSharp/DeskTutorialHandler.cs

DeskTutorialHandler : IGMTutorialArrowHandler — tutorial arrow system for DeskMenu. Tracks m_TrackedTargets (items) and m_ContainerToRegister for the tutorial arrow to follow.


5.2 Toilet System

ToiletInteraction

File: Assembly-CSharp/ToiletInteraction.cs

ToiletInteraction : AnimatedInteraction, IControlledUpdate — the most complex single interactive object in the game, managing flushing, flooding, draining, and item hiding.

FieldTypePurpose
m_ToiletFlushTimefloatDuration of flush animation
m_FloodingChancefloatProbability that flushing causes flooding
m_FloodWaterPrefabGameObjectWater visual prefab for flooding
m_FloodSpreadTimefloatTime for flood to spread

FloodingStatus enum: None, Flooding, Flooded, Draining

TPData struct: Pathfinding distance data to nearest flood points.

Behaviour:

  1. Player flushes toilet
  2. Random chance (m_FloodingChance) triggers a flood
  3. Flood spawns water prefab, spreads over time
  4. Water must be mopped up (draining phase)
  5. Integrated ItemContainer for hiding contraband in the cistern

Audio: Events.Play_Env_Toilet_Flush, Events.Play_Env_Toilet_Flood

Serialization: Uses ToiletInteractionDeserializer bridge to NetPrisonViewDetails.Instance.ToiletInteractionData.

ToiletEventManager

File: Assembly-CSharp/ToiletEventManager.cs

ToiletEventManager : EventManager — AI events for toilet:

  • m_ToiletFlood — guard responds to flooding
  • m_ContrabandInToilet — guard finds contraband

Floor-aware (handles multi-storey toilet positioning). Integrates with plumbing job system.

ToiletMenu

File: Assembly-CSharp/ToiletMenu.cs

ToiletMenu : GameMenuBehaviour — UI for the toilet interaction:

  • Shows inventory (hidden contraband)
  • Flush button
  • Clog probability system (DEBUG_ALWAYS_CLOG for testing)

ToiletInteractionDeserializer

File: Assembly-CSharp/ToiletInteractionDeserializer.cs

ToiletInteractionDeserializer : IDeserializable — serialization bridge that reads/writes ToiletInteractionData from NetPrisonViewDetails.Instance.


5.3 Comfort & Recovery Interactions

ChairInteraction

File: Assembly-CSharp/ChairInteraction.cs

ChairInteraction : AnimatedInteraction — sitting interaction.

FieldTypePurpose
m_EnergyIncreaseWithTrayfloatExtra energy gain multiplier when holding a tray
  • Periodically restores health and energy
  • Energy gain doubled when character has a tray
  • Tracks occupancy (one chair, one person)
  • Drops tray on exit (instantiates tray item world object)
  • Audio: Events.Play_Player_Rest

BedInteraction

File: Assembly-CSharp/BedInteraction.cs

BedInteraction : AnimatedInteraction — sleeping interaction.

  • Restores health and energy over time
  • Links to m_CellBedInteraction (the cell bed item system)
  • Shows save game menu when sleeping in a bed
  • Recalculates stats on awake (daily routine processing)
  • Plays Events.Play_Player_Rest

SolitaryBedInteraction

File: Assembly-CSharp/SolitaryBedInteraction.cs

SolitaryBedInteraction : BedInteraction — forces RegainConsciousness() on start (used when the AI is knocked out and wakes up in solitary). Also plays Events.Play_Solitary_Sting.

MedicBedInteraction

File: Assembly-CSharp/MedicBedInteraction.cs

MedicBedInteraction : BedInteraction — medical ward bed:

FieldTypePurpose
m_ConvalescenceMinimumTimefloatMinimum stay (default 5s)
m_ConvalescenceMaximumTimefloatMaximum stay (default 20s)
  • Fully restores health over the convalescence period
  • Sets StatModifierEnum.MedicalSleeping
  • Pauses AI movement during treatment

ShowerInteraction

File: Assembly-CSharp/ShowerInteraction.cs

ShowerInteraction : AnimatedInteraction — shower block.

  • Applies StatModifierEnum.Shower state
  • Periodically increases health and energy
  • Tracks shower duration for the "Crikey" steam achievement
  • Audio: Events.Play_Env_Shower_Loop

KennelInteraction

File: Assembly-CSharp/KennelInteraction.cs

KennelInteraction : AnimatedInteraction — hides non-dog characters (dogs can't use kennels). Plays Events.Play_Player_Rest on start and exit.

LockerInteraction

File: Assembly-CSharp/LockerInteraction.cs

LockerInteraction : AnimatedInteraction — hide in a locker.

  • Sets character visibility to false (hides inside)
  • Toggles NPC pin visibility in Versus mode
  • Audio: Events.Play_Player_Locker_Enter, Events.Play_Player_Locker_Exit

ChargingPodInteraction

File: Assembly-CSharp/ChargingPodInteraction.cs

ChargingPodInteraction : AnimatedInteraction — robotic charging station.

  • Hides character during charging
  • Applies StatModifierEnum.Sitting
  • Restores health/energy
  • Uses locker enter/exit audio events

5.4 Study & Reading

StudyInteraction

File: Assembly-CSharp/StudyInteraction.cs

StudyInteraction : AnimatedInteraction — reading minigame for stat development.

FieldTypePurpose
m_ReadingMasherSettingsReadingMasher.MasherSettingsMasher configuration
m_IntellectRewardintIntellect XP per completion
m_StaminaLossintStamina drain per completion
  • Uses ReadingMasher minigame (see Minigame System section)
  • Applies config modifier from m_Reading_RewardModifier
  • CanStartOrContinueInteraction() checks minimum energy threshold
  • Applies StatModifierEnum.Sitting during reading
  • Plays Events.Play_Player_Rest

5.5 Gym Equipment

GymInteraction

File: Assembly-CSharp/GymInteraction.cs

GymInteraction : AnimatedInteraction — complete gym equipment system supporting 7 equipment types.

GymInteractionType enum:

TypeMasherStat Rewarded
WeightLiftingAlternateButtonMasherStrength
PullUpGymMasher_PullupStrength
KettlebellsGymMasher_KettleBeltsFitness
ThreadmillGymMasher_Threadmill_ExerciseBikeCardio
ExerciseBikeGymMasher_Threadmill_ExerciseBikeCardio
PommelHorseGymMasher_Pommel_FootbagFitness
FootbagGymMasher_Pommel_FootbagFitness

Rep System:

  • Two-stage animation per rep: m_RepFirstStage / m_RepSecondStage (GameObject visual states)
  • Stat changes: m_StrengthChange, m_EnergyChange, m_CardioChange
  • m_StaminaDrainPerRep — stamina cost per rep
  • m_RepTime — time per rep

Reward Mapping: Uses MinigameCompletionHelper with m_NumRepsForCompletion (players) and m_TimeForAiAutoCompletion (AI). Configurable via MinigameConfig.

GymMasherBase

File: Assembly-CSharp/GymMasherBase.cs

GymMasherBase : MasherBase, IMinigameMasher — base class for all gym minigame mashers.

FieldTypePurpose
m_CharacterOffsetfloatY-offset for HUD positioning
WorldSpaceHudScalePODO(struct)Positioning data
m_IsRepACompleted / m_IsRepBCompletedboolPer-rep completion flags

Methods:

  • ConsumeIsRepACompleted() / ConsumeIsRepBCompleted() — check and clear completion flags
  • PositionForPlayer(Player) — per-frame HUD position update
  • Reset() — reset masher state
  • SetPlayerToCheck(Player) — set which player's input to read

Holds AlternateButtonMasher.MasherState field for sub-types to use.

GymMasher_WeightLifting

File: Assembly-CSharp/GymMasher_WeightLifting.cs

Alternating-button weightlifting minigame:

  • Rising slider bar with a threshold zone
  • Two alternating button presses fill a gain value
  • When gain passes threshold: success; otherwise: fail
  • Three-light indicator progression
  • Stamina cost per attempt

GymMasher_KettleBelts

File: Assembly-CSharp/GymMasher_KettleBelts.cs

Kettlebells holding minigame:

  • Slider with a safezone window
  • Gain fills while slider is in safezone
  • Gain decays outside safezone
  • Threshold increases over time (gets harder)
  • Three-light indicator for progress

GymMasher_Pullup

File: Assembly-CSharp/GymMasher_Pullup.cs

Pullup timing minigame:

  • Moving slider indicator
  • Shrinking threshold zone (tightens over time)
  • Two alternating button presses when indicator is within zone
  • Stamina drain at set intervals

GymMasher_Threadmill_ExerciseBike

File: Assembly-CSharp/GymMasher_Threadmill_ExerciseBike.cs

Treadmill/exercise bike endurance minigame:

  • Alternating-button fill bar with continuous decay
  • Decay rate increases over time
  • Optional single-button mode (accessibility)

GymMasher_Pommel_Footbag

File: Assembly-CSharp/GymMasher_Pommel_Footbag.cs

Pommel horse/footbag dexterity minigame:

  • Two moving markers on a single slider (left/right)
  • Shrinking safezone
  • Alternating button presses required
  • Distance counter tracks total "reps"

5.6 Information & UI Interactions

GuardBoardInteraction

File: Assembly-CSharp/GuardBoardInteraction.cs

GuardBoardInteraction : InteractiveObject — opens guard job board:

InGameMenuFlow.Instance.OpenGuardBoard();

Plays Events.Play_UI_JobBoard_In.

GuardComputerInteraction

File: Assembly-CSharp/GuardComputerInteraction.cs

GuardComputerInteraction : AnimatedInteraction — immediately stops interaction on InteractionReadyUpdate(). Clears the remote interactive object reference on OnExitInteraction.

GuardOutfitCrateInteraction

File: Assembly-CSharp/GuardOutfitCrateInteraction.cs

GuardOutfitCrateInteraction : AnimatedInteraction — only guards can interact (CharacterRole.Guard checks in both AllowedToInteract and InteractionVisibility). Disallows other players from seeing the HUD prompt.

InformationBoardInteraction

File: Assembly-CSharp/InformationBoardInteraction.cs

InformationBoardInteraction : InteractiveObject — opens the information board:

FieldTypePurpose
m_BoardTitleTagstringLocalisation tag for title
m_BoardBodyTagstringLocalisation tag for body text
m_AnalyticsRefstringOptional analytics event name

Plays Events.Play_UI_JobBoard_In.

SignPostInteraction

File: Assembly-CSharp/SignPostInteraction.cs

SignPostInteraction : InteractiveObject — opens sign post UI:

InGameMenuFlow.Instance.OpenSignPost(m_TitleText, m_BodyText, m_Sprite);

Plays Events.Play_UI_JobBoard_In.

SignPost (UI)

File: Assembly-CSharp/SignPost.cs

SignPost : GameMenuBehaviour — UI class for displaying sign post content:

  • Displays localised title text, body text, and a sprite
  • Close() method calls RequestStopInteraction() on the current player character
  • Integrates with T17Close for close button/back input

5.7 Other Interactions

FishingInteraction

File: Assembly-CSharp/FishingInteraction.cs

FishingInteraction : AnimatedInteraction — fishing minigame.

FieldTypePurpose
m_BaitedFishingRodItemItemRequired baited rod
m_FishRewardItemItemFish given on success

Flow:

  1. Check character has baited fishing rod → dialog if missing ("Text.Emote.NeedFishingRod" / "Text.Emote.NeedFishBait")
  2. Check inventory space for fish → dialog if full ("Text.Emote.InventoryFull")
  3. Show/hide fishing rod visual on character
  4. Start ReadingMasher minigame
  5. On completion, give fish reward (tracked per character via m_FishRewardMap)

GeneratorInteraction

File: Assembly-CSharp/GeneratorInteraction.cs

GeneratorInteraction : AnimatedInteraction — disables the Generator component on interaction start. Sets animator "On" bool to false. Object visibility linked to generator active state (invisible when generator is off).

IdleHoldInteraction

File: Assembly-CSharp/IdleHoldInteraction.cs

IdleHoldInteraction : AnimatedInteraction — toggleable interaction via RPC_SetCanInteract(bool). Both InteractionVisibility() and AllowedToInteract() check m_InteractionAllowed flag.

TalkInteraction

File: Assembly-CSharp/TalkInteraction.cs

TalkInteraction : InteractiveObject — character conversation interaction.

Checks:

  • Quest delivery (player's TryDeliverItem delegates)
  • Quest availability on the target character
  • Robinson Crusoe quest flag (unique NPC quest)

Behaviour:

  • Opens character's ItemContainer for quest/favour view
  • Plays "Text.Player.ThanksForThat" speech on successful item delivery
  • Links to the Character's quest FSM

6. Carry Systems

6.1 CarryInteraction

File: Assembly-CSharp/CarryInteraction.cs

CarryInteraction : InteractiveObject — pickup and carry knocked-out characters.

FieldTypePurpose
m_KOCharacterCharacterThe character being carried
m_CarrierCharacterThe character doing the carrying
m_KOCharacterAnimatorAnimatorAnimator of the carried character
m_CarrierCharacterAnimatorAnimatorAnimator of the carrier

Animation: Sets AnimState.IdleCarry on both characters.

Network sync:

  • RPC_PickUpCharacter(CharacterID) — sync pick-up across network
  • RPC_DropCharacter() — sync drop

Audio: Events.Play_Player_Pickup_Item (pickup), Events.Play_Player_Combat_Hit_Generic (when dropping a KO'd character forcefully)

Visibility: Only visible when a KO character is knocked out nearby. Uses NetObjectLock to prevent multiple carriers on the same KO character.

6.2 CarryObjectInteraction

File: Assembly-CSharp/CarryObjectInteraction.cs

CarryObjectInteraction : InteractiveObject — pickup and carry physics objects (furniture, props).

FieldTypePurpose
m_CarryOffsetVector3Position offset while carrying
m_DecorationAIDecorationAI decoration placement data

Decoration system: Objects can be placed in predefined Desk or Job decoration positions. Uses GetDecorationPosition() to find valid placement.

Pickup/Drop:

  • Toggles box collider and rigidbody on/off
  • Updates climbable tag (can't climb a carried object)
  • Tracks room assignment for object-placement logic
  • m_MovedObjects dictionary tracks moved object coordinates for save serialization

Network sync:

  • RPC_PickUp(NetworkViewID) — sync pickup
  • RPC_Drop(Vector3 position) — sync drop

Audio: Events.Play_Player_Pickup_Item, Events.Play_Jobs_JusticeTable_PickUp

Serialization: Uses NetSaveData dictionary for persisting moved object state.

6.3 CarryObjectInteractionDeserialiser

File: Assembly-CSharp/CarryObjectInteractionDeserialiser.cs

CarryObjectInteractionDeserialiser : IDeserializable — deserialization bridge that reads carried object data from save state and repositions objects accordingly.


7. Service & Job Interactions

7.1 TrayInteraction

File: Assembly-CSharp/TrayInteraction.cs

TrayInteraction : AnimatedInteraction — meal tray pickup.

FieldTypePurpose
m_TrayMaterialsMaterial[]Random material selection for visual variety

Behaviour:

  • Only visible and allowed during Routines.MealTime
  • On start: selects random tray material, calls SetHasTray(true) on character, plays Events.Play_Player_Pickup_Item
  • One-shot: immediately calls RequestStopInteraction() in InteractionReadyUpdate()

7.2 BeckonAndMinigameServeCustomerInteraction

File: Assembly-CSharp/BeckonAndMinigameServeCustomerInteraction.cs

Abstract class for job interactions that require:

  1. Beckoning a customer to the service point
  2. Playing a minigame to serve them
FieldTypePurpose
m_BeckonCustomerComponentBeckonCustomerCustomer slot manager
m_HasWaitingCustomerAnimstringAnimator trigger for "customer waiting"

Flow:

  1. Link to ServiceItemJob for job context
  2. Subscribe to CustomerWaitingForServiceChangedEvent
  3. Check m_BeckonCustomerComponent.IsAllowedToBeckonNewCustomer() for beckon permission
  4. On minigame completion, serve customer and beckon next

NodeCanvas integration: CanServiceInteractionBeckonNextCustomer (condition task) checks if AI can beckon.

7.3 BeckonCustomer

File: Assembly-CSharp/BeckonCustomer.cs

BeckonCustomer : T17MonoBehaviour — manages a single waiting customer slot.

MethodPurpose
CallForNextCustomer()Signal that a new customer can approach
CancelRequestForCustomer()Clear the waiting slot
IsAllowedToBeckonNewCustomer()Check if slot is free

RPCs:

  • RPC_Master_SyncWaitingCustomer(int characterID) — network sync
  • RPC_CLIENT_RecieveWaitingCustomer(int characterID) — client notification
  • RPC_ALL_SetBeckoningCustomer(int characterID) — set the beckoning customer

8. Minigame System

8.1 MasherBase

File: Assembly-CSharp/MasherBase.cs

MasherBase : MonoBehaviour — common base for all minigame masher UI elements.

FieldTypePurpose
m_StatLabelTextMeshProUGUIStat name label
m_StatSpriteImageStat icon sprite
m_ProgressSpriteImageProgress bar fill
m_ProgressSliderSliderProgress bar slider

Methods:

  • SetStyle(StylePreset) — Apply visual style preset
  • UpdateProgress(float value, float min, float max) — Update progress bar
  • SetPlayerToCheck(Player) — Set which player this masher responds to

8.2 StylePreset

File: Assembly-CSharp/MinigameMashers/StylePreset.cs

ValueDescription
InvalidNo style
StengthStrength-themed (note: typo in original)
FitnessFitness-themed
IntelligenceIntelligence-themed

8.3 MinigameMap

File: Assembly-CSharp/MinigameMap.cs

MinigameMap : MonoBehaviour — central router and factory for minigame types.

MinigameTypes enum:

ValueMasher Type
ST_FireBreathing(settings only)
ST_HulaHoops(settings only)
ST_Juggling(settings only)
ST_Unicycle(settings only)
Job_Stonemason(settings only)

Masher Settings structs held:

  • AlternateMasherSettings
  • HoldingMasherSettings
  • PullupMasherSettings
  • ThreadMillMasherSettings
  • PommelHorseMasherSettings
  • SolitaryPotatoMasher.MasherSettings
  • ReadingMasher.MasherSettings

Key method: SetupButtonMasher(MinigameTypes, Action<bool>, Action) — creates the correct IMiniGameMasher instance via PerPlayerTrackedUIElements.CreateMasherForPlayer().

Completion helper: MinigameCompletionHelper — tracks rep count for completion.

8.4 MinigameInteraction

File: Assembly-CSharp/MinigameInteraction.cs

MinigameInteraction : AnimatedInteraction — generic wrapper for playing a minigame during an interaction.

FieldTypePurpose
m_bShouldStopWithNoInputboolAuto-stop when player stops inputting
m_bRequireInputAtStartboolRequire immediate input to start
m_NoRepsStopIntervalfloatTimeout if no reps completed
m_NoRepsStatestringAnimator state for no-reps timeout
m_bShouldDrainStaminaboolDrain stamina during minigame
m_StaminaDrainPerMomentfloatStamina drain rate

Lifecycle:

  1. On start, sets up the minigame via MinigameMap.SetupButtonMasher()
  2. Manages idle timeout with m_NoRepsStopInterval
  3. On completion, fires completion echoes
  4. On stop or timeout, transitions to exit animation

8.5 MinigameCompletionHelper

File: Assembly-CSharp/MinigameCompletionHelper.cs

Helper component for tracking minigame completion:

FieldTypePurpose
m_NumRepsForCompletionintReps required for player completion
m_TimeForAiAutoCompletionfloatTime after which AI auto-completes

Players must complete the specified number of reps; AI auto-completes after the timer expires (simulating successful play).

8.6 MinigameConfig

File: Assembly-CSharp/MinigameConfig.cs

ScriptableObject configuration asset:

FieldTypePurpose
m_WeightLiftingRewardModifierfloatReward multiplier
m_PullUpRewardModifierfloatReward multiplier
m_KettlebellRewardModifierfloatReward multiplier
m_ThreadmillRewardModifierfloatReward multiplier
m_ExerciseBikeRewardModifierfloatReward multiplier
m_PommelHorseRewardModifierfloatReward multiplier
m_FootbagRewardModifierfloatReward multiplier
m_ReadingRewardModifierfloatReward multiplier (not in file but referenced by StudyInteraction)
m_Solitary_RewardModifierfloatReward multiplier (referenced by AchievementManager)

8.7 MasherItemProcessorInteraction (Abstract)

File: Assembly-CSharp/MasherItemProcessorInteraction.cs

Abstract class for job interactions that process items via minigame:

FieldTypePurpose
m_MinigameInteractionMinigameInteractionThe minigame wrapper
m_ItemToProcessItemThe input item
m_ItemToOutputSuccessItemOutput on success
m_ItemToOutputFailItemOutput on failure (damaged item)
m_SuccessChancefloatBase success rate

Behaviour:

  1. Character approaches with input item
  2. On start: plays minigame
  3. On minigame completion: roll m_SuccessChance
  4. Success → output m_ItemToOutputSuccess, fail → output m_ItemToOutputFail
  5. Destroy input item, spawn output item

9. Audio System

9.1 Architecture Overview

The audio system is the Audiokinetic Wwise middleware integrated via the standard Unity Wwise SDK. All audio is routed through a central AudioController singleton which wraps AkSoundEngine.PostEvent().

Game Code


AudioController.SendEvent(SOUND_AREA, eventName, gameObject)


AkSoundEngine.PostEvent(eventID, gameObject)


libAkSoundEngine (native)


Audio Hardware

9.2 AudioController

File: Assembly-CSharp/AudioController.cs

AudioController : MonoBehaviour — central audio hub singleton.

SOUND_AREA enum:

ValuePurpose
SA_FRONTENDMain menu, front-end UI
SA_UIIn-game UI sounds
SA_INGAMEAll gameplay audio

MusicState enum: Playing, Resumed, Stopped, Paused

Singleton access: AudioController.Instance

Key methods:

MethodSignaturePurpose
SendEventstatic void(SOUND_AREA, string, GameObject)Post a Wwise event
SetParameterstatic void(Game_Parameter, float)Set an RTPC value
PlayMusicEventvoid(Events)Play a music event
StopMusicvoid()Stop all music

Initialisation:

  • Creates GlobalSoundObject and GlobalMusicObject for ambience/music
  • Creates UIObject for UI sounds
  • Sets up audio mixer groups (Music, SFX) with volume control

Music system:

  • Manages music state based on prison routine schedule
  • Transitions music between routine phases (Play_Music_Prison_01_Routine_A through G)
  • Supports lockdown music, escape music, and threat-level based transitions
  • Music unlocking via achievement system

Volume control:

  • m_MusicVolume / m_SFXVolume — configurable sliders
  • Applies volume via SetRTPCValue on mixer groups

9.3 AudioProximityDetector

File: Assembly-CSharp/AudioProximityDetector.cs

AudioProximityDetector : MonoBehaviour — spatial audio handler for electric fences.

FieldTypePurpose
Detection methodSphereColliderTrigger volume

Behaviour:

  • Checks for nearby electric fences every 0.5s
  • Tracks count of nearby fences
  • Starts Events.Play_Electric_Fence when near, stops when far
  • Sets Game_Parameter.Distance_From_Fence RTPC for distance-based audio mixing

9.4 Wwise Integration

AkInitializer

File: Assembly-CSharp/AkInitializer.cs

AkInitializer : MonoBehaviour — initialises the Wwise sound engine.

FieldTypePurpose
basePathstringBank path (default: Audio/GeneratedSoundBanks)
memoryPoolSize / memoryPoolSize64 / memoryPoolSize256intMemory pool sizes (4096/2048/1024/0)
languagestringLanguage for localised banks

Calls AkSoundEngine.Initialize() and decodes banks on first run. Creates AkSoundEngineInitialization sub-object.

AkBank

File: Assembly-CSharp/AkBank.cs

AkBank : AkUnityEventHandler — loads/unloads soundbanks.

FieldTypePurpose
dataAkBankManager.BankHandleThe loaded bank handle

Supports:

  • Synchronous and asynchronous loading
  • Decode-on-load option (for streaming audio)
  • Trigger-based activation (Start, Enable, etc.)

AkBankManager

File: Assembly-CSharp/AkBankManager.cs

Static manager with dictionary-based bank handle tracking. Thread-safe via Mutex. Deferred unload list supports safe unloading. GlobalBankCallback for async bank load results.

AkEvent

File: Assembly-CSharp/AkEvent.cs

AkEvent : AkUnityEventHandler — posts Wwise events.

FieldTypePurpose
eventIDintEvent short ID from autogen enum
soundEmitterObjectGameObjectEmitter override
enableActionOnEvent / actionOnEventTypeAkActionOnEventTypeAction on event (stop, pause, etc.)
m_callbackDataAkEventCallbackDataCallback configuration
playingIdintCurrently playing instance ID

AkAmbient

File: Assembly-CSharp/AkAmbient.cs

AkAmbient : AkEvent — environmental ambience with multi-position support.

MultiPositionType: Simple, Large, MultiPosition

Supports multi-position event trees (single sound emitted from multiple locations).

AkGameObj

File: Assembly-CSharp/AkGameObj.cs

AkGameObj : MonoBehaviour — Wwise game object registration and position tracking.

  • Registers via AkSoundEngine.RegisterGameObj(GameObject, name)
  • Updates position per-frame via AkSoundEngine.SetObjectPosition()
  • Environment-aware for player objects (reverb zones)
  • Listener mask support
  • Position update scheduler: spreads updates across 30 frames to reduce CPU spikes

AkState

File: Assembly-CSharp/AkState.cs

Sets Wwise state groups via AkSoundEngine.SetState(StateGroupID, StateID).

AkSwitch

File: Assembly-CSharp/AkSwitch.cs

Sets Wwise switch groups via AkSoundEngine.SetSwitch(SwitchGroupID, SwitchID, GameObject).

AkSoundEngine

File: Assembly-CSharp/AkSoundEngine.cs

Massive P/Invoke wrapper to the native libAkSoundEngine library. Key static methods:

MethodPurpose
RegisterGameObj(GameObject, string)Register a game object with Wwise
UnregisterGameObj(GameObject)Unregister
PostEvent(int, GameObject, ...)Post an event
SetState(int, int)Set a state group
SetSwitch(int, int, GameObject)Set a switch
SetRTPCValue(int, float, GameObject)Set an RTPC parameter
SetObjectPosition(GameObject, Vector3, Vector3, Vector3)Set 3D position
LoadBank(string, ...) / UnloadBank(...)Bank management
PrepareBank(...)Prepare future-use banks
ExecuteActionOnEvent(...)Stop/pause/resume events
SetMultiplePositions(GameObject, AkPositionArray, ushort, ...)Multi-position support
GetSourcePlayPosition(int)Get playback position
Init(...) / Term()Engine lifecycle
GetIDFromString(string)String-to-ID conversion (FNV-1a)
GetMaxRadius(GameObject)Get max attenuation radius

Uses AkSoundEnginePINVOKE for C#→C++ interop.

AkUtilities

File: Assembly-CSharp/AkUtilities.cs

ShortIDGeneratorComputeHash32(string) using FNV-1a hash algorithm for generating Wwise short IDs from string names.

9.5 AUTOGEN Wwise Enums

Directory: Assembly-CSharp/AUTOGEN_T17Wwise_Enums/

Auto-generated enum files that mirror the Wwise project structure:

Events.cs

Class: Events — string constants for every Wwise event in the project.

Key categories:

CategoryExample Events
AmbiencePlay_Prison_01_Ambience_General, Play_Amb_PSO_BBQ, Play_Amb_PSO_ComputerRoom, Play_Amb_PSO_Fountain, Play_Amb_PSO_Pond
CharacterPlay_Dog_Bark, Play_Dog_Pant, Play_Dog_Dig, Play_Dog_Snarl, Play_Dog_Whimper
CombatPlay_Player_Combat_Hit, Play_Player_Combat_Swing, Play_Player_Combat_Block, Play_Player_Combat_Charge, Play_Player_Combat_KO, Play_Player_Combat_LockOn
RoutinePlay_Routine_Bell_Classic, Play_Routine_Alarm_Beep
EnvironmentPlay_Env_Shower_Loop, Play_Env_Toilet_Flush, Play_Env_Toilet_Flood
MusicPlay_Music_Prison_01_Routine_A through G, Play_Music_Lockdown
UIPlay_UI_JobBoard_In, Play_UI_Lift
PlayerPlay_Player_Locker_Enter, Play_Player_Locker_Exit, Play_Player_Rest, Play_Player_Pickup_Item
InteractionPlay_Interaction_Generic
FencePlay_Electric_Fence
SolitaryPlay_Solitary_Sting
JobsPlay_Jobs_Stonemason_Cut, Play_Jobs_Laundry, Play_Jobs_Kitchen, Play_Jobs_Blacksmith, Play_Jobs_ShoePress, Play_Jobs_WoodBuffer, Play_Jobs_JusticeTable_PickUp, etc.
Stop variantsStop events for all looping sounds

Game_Parameter.cs

Class: Game_Parameter — Wwise RTPC parameter constants (e.g., Distance_From_Fence).

Switch_Group.cs / State_Group.cs

Classes: Switch_Group, State_Group — Wwise switch and state group constants.

Specialised enum files:

FileContent
Player_Footsteps.csFootstep surface switch values
Player_Hit.csHit type switch values
Player_Musical_Instruments.csMusical instrument switch values
Player_Amb_Position.csAmbience position switch values
Music_Threat_Level.csThreat level state values
Music_Player_Position.csPlayer position state values
Sfx_Mix.csSFX mix state values
Pause_Menu.csPause menu state values
Round_Results_Mix.csRound results mix state values
Master_Volume.csMaster volume state values
Big_Top_Crowd.csBig Top crowd state values
Cutscene.csCutscene state values
Music_Lute_DLC_05.csLute DLC music state values

10. Animation & Effects

10.1 AnimationEffectHandler

File: Assembly-CSharp/AnimationEffectHandler.cs

AnimationEffectHandler : MonoBehaviour — timed effect that auto-removes after playing.

FieldTypePurpose
m_AnimationLengthfloatDuration before auto-return to pool

On start, begins counting down; when timer expires, resets state and returns to CullingObjectCollector pool.

10.2 EffectManager

File: Assembly-CSharp/EffectManager.cs

EffectManager : T17MonoBehaviour — object pool for visual effects.

effectType enum:

TypePurpose
AnimatedPunchEffectPunch impact visual
StrengthIncreaseStat increase VFX
IntelligenceIncreaseStat increase VFX
CardioIncreaseStat increase VFX
StaminaIncrease / StaminaDecreaseStamina change VFX
LandedJumpLanded jump puff
OpinionIncrease / OpinionDecreaseOpinion change VFX
HealthRestoredHeal VFX
EnergyRestoredEnergy restore VFX
FistChargeFist charge-up VFX
FeetChargeDashDash charge VFX
PlayerLeaveDustDust puff on movement
MoneyIncreasedMoney gain VFX
HeatIncreasedHeat/alert level VFX
ChargeAttackImpactCharge attack impact VFX
DiggingUp / DiggingDownDigging VFX

Key methods:

  • SpawnEffect(effectType, Vector3 position, Quaternion rotation) — get from pool or instantiate
  • ReturnEffect(EffectHandler) — return to pool
  • Network-aware for multiplayer effect spawning

10.3 EffectHandler

File: Assembly-CSharp/EffectHandler.cs

EffectHandler : MonoBehaviour — per-instance effect behaviour.

Features:

  • Lifetime tracking (m_LifeTime)
  • Optional animation curve: m_AnimCurveTransparency, m_AnimCurveScale
  • UV scrolling (m_UVScrollSpeed)
  • Animated sprite sheets (m_SpriteSheetColumns, m_SpriteSheetRows, m_FrameRate)
  • Auto-returns to EffectManager pool on lifetime expiry

10.4 AnimationEffectCompletdEchoer

File: Assembly-CSharp/AnimationEffectCompletdEchoer.cs

AnimationEffectCompletdEchoer : MonoBehaviour — broadcasts an AnimationFinishedEvent (UnityEvent) when an animation completes. Triggered from an Animation Event in the Animation window.

10.5 AnimationPlayer

File: Assembly-CSharp/AnimationPlayer.cs

AnimationPlayer : MonoBehaviour — invokes Animator.SetTrigger("Play") from Unity Events. Used for simple animation triggers (e.g., in Timeline or UI button callbacks).

10.6 CharacterAudioEvents

File: Assembly-CSharp/CharacterAudioEvents.cs

CharacterAudioEvents : MonoBehaviour — holds an array of audio event name strings (string[]). Accessible via m_Instance singleton per character. Used by animation events to look up sound names dynamically.

10.7 CaptureAnimatorSoundEvent

File: Assembly-CSharp/CaptureAnimatorSoundEvent.cs

CaptureAnimatorSoundEvent : MonoBehaviour — catches Animation Events with the function name "SoundEvent". Takes the string parameter, looks it up (potentially via CharacterAudioEvents), and forwards to AudioController.SendEvent(). Unregisters the game object from Wwise on level end.


11. Appendices

A. Class Hierarchy

T17MonoBehaviour
├── InteractiveObject
│   ├── AnimatedInteraction
│   │   ├── TransferItemsInteraction
│   │   │   ├── ItemInteraction
│   │   │   │   ├── CellBars_ItemInteraction
│   │   │   │   └── CellBed_ItemInteraction
│   │   │   └── MultiStageTransferInteraction
│   │   ├── DeskInteraction
│   │   ├── ToiletInteraction
│   │   ├── ChairInteraction
│   │   ├── BedInteraction
│   │   │   ├── SolitaryBedInteraction
│   │   │   └── MedicBedInteraction
│   │   ├── ShowerInteraction
│   │   ├── LockerInteraction
│   │   ├── KennelInteraction
│   │   ├── ChargingPodInteraction
│   │   ├── StudyInteraction
│   │   ├── GymInteraction
│   │   ├── FishingInteraction
│   │   ├── TrayInteraction
│   │   ├── GuardComputerInteraction
│   │   ├── GuardOutfitCrateInteraction
│   │   ├── GeneratorInteraction
│   │   ├── IdleHoldInteraction
│   │   └── MinigameInteraction
│   ├── GuardBoardInteraction
│   ├── InformationBoardInteraction
│   ├── SignPostInteraction
│   ├── CarryInteraction
│   ├── CarryObjectInteraction
│   └── TalkInteraction

└── MultistageInputInteraction (IMultistageTransferInteractionResponder)
    ├── ConstructEndgameInteraction
    │   ├── GliderEscapeInteraction
    │   ├── CivilianClothesEscapeInteraction
    │   ├── TransportEscapeInteraction
    │   └── RepeatProcessEscapeInteraction
    └── MultistageInputProgressorInteraction

B. Wwise Event Flow

Animation Event ("SoundEvent", stringParam)


CaptureAnimatorSoundEvent.OnAnimationEvent()


AudioController.SendEvent(SA_INGAME, stringParam, gameObject)


AkSoundEngine.PostEvent(eventID, gameObject)


Wwise Audio Pipeline (native)

C. Minigame Masher Interface

IMinigameMasher
    ├── GymMasherBase
    │   ├── GymMasher_WeightLifting  (AlternateButtonMasher)
    │   ├── GymMasher_KettleBelts    (HoldingMasher)
    │   ├── GymMasher_Pullup         (PullupMasher)
    │   ├── GymMasher_Threadmill_ExerciseBike (ThreadMillMasher)
    │   └── GymMasher_Pommel_Footbag (PommelHorseMasher)
    ├── ReadingMasher
    └── AlternateButtonMasher

Created by PerPlayerTrackedUIElements.CreateMasherForPlayer() with settings from MinigameMap.

D. Interaction Lifecycle Sequence

Character                    InteractiveObject              NetObjectLock
    │                              │                             │
    ├─── CanStartOrContinue ──────►│                             │
    │◄───────── true/false ────────┤                             │
    │                              │                             │
    ├─── RequestReservation ───────┼────────────────────────────►│
    │                              │◄─────── Lock Acquired ─────┤
    │                              │                             │
    ├─── WalkToTarget ────────────►│                             │
    │                              │                             │
    ├─── OnStartInteraction ──────►│                             │
    │                              │                             │
    ├─── InteractionReadyStart ───►│                             │
    │                              │   (animation, lerp)        │
    ├─── InteractionReadyUpdate ──►│  (loop)                    │
    │                              │                             │
    ├─── InteractionReadyEnd ─────►│                             │
    │                              │                             │
    ├─── OnExitInteraction ───────►│                             │
    │                              │                             │
    │                              ├── RequestStop ────────────►│
    │                              │◄────── Lock Released ──────┤
    ▼                              ▼                             ▼

E. Save/Load Serialization

Interactive objects that need persistence implement ISaveable (or INetworkLoadable) and provide a serialization data class:

InteractionData ClassBridge
ToiletInteractionToiletInteractionDataToiletInteractionDeserializer via NetPrisonViewDetails.Instance
MultistageInputInteractionSaveData_MultistageInputInteraction_V1Inline via ISaveable.WriteToSaveData()/LoadFromSaveData()
CarryObjectInteractionNetSaveData.MovedObjects dictionaryCarryObjectInteractionDeserialiser

F. AI Event Integration

InteractionEventManagerEvents
DeskInteractionDeskEventManagerm_InvestigateObject, m_ContrabandInDesk
ToiletInteractionToiletEventManagerm_ToiletFlood, m_ContrabandInToilet
CellBars_ItemInteractionBarEventManager(bar state changes)
CellBed_ItemInteractionBedEventManager(bed state changes)

G. Audio Events Referenced in Code

InteractionAudio Event
TransferItemsInteractionEvents.Play_Interaction_Generic
ChairInteraction, BedInteraction, StudyInteraction, KennelInteractionEvents.Play_Player_Rest
LockerInteraction, ChargingPodInteractionEvents.Play_Player_Locker_Enter, Events.Play_Player_Locker_Exit
ShowerInteractionEvents.Play_Env_Shower_Loop
ToiletInteractionEvents.Play_Env_Toilet_Flush, Events.Play_Env_Toilet_Flood
GuardBoardInteraction, InformationBoardInteraction, SignPostInteractionEvents.Play_UI_JobBoard_In
CarryInteraction, CarryObjectInteraction, TrayInteractionEvents.Play_Player_Pickup_Item
AudioProximityDetectorEvents.Play_Electric_Fence, Events.Stop_Electric_Fence

On this page

Table of Contents1. Core Interaction Framework1.1 InteractiveObject (Base Class)EnumsKey Serialised FieldsInteraction LifecycleCore MethodsReservation SystemDelegates1.2 NodeCanvas AI ActionsInteractStopInteractionRemoteInteractRandomInteraction1.3 InteractionItemRequiremetHelper2. Animated Interaction System2.1 AnimatedInteractionKey Serialised FieldsAnimation State MachineDirection ResolutionExit Position ResolutionCulling Wrapper2.2 InteractObjAnimData3. Item Transfer Interactions3.1 TransferItemsInteraction3.2 ItemInteraction3.3 CellBars_ItemInteraction3.4 CellBed_ItemInteraction3.5 MultiStageTransferInteraction4. Multi-stage Construction & Escape Interactions4.1 MultistageInputInteractionStage ClassCore FieldsNetwork SyncKey Methods4.2 MultistageInputProgressorInteraction4.3 ConstructEndgameInteraction4.4 GliderEscapeInteraction4.5 CivilianClothesEscapeInteraction4.6 TransportEscapeInteraction4.7 RepeatProcessEscapeInteraction5. Specialised Interactions5.1 Desk SystemDeskInteractionDeskEventManagerDeskTutorialHandler5.2 Toilet SystemToiletInteractionToiletEventManagerToiletMenuToiletInteractionDeserializer5.3 Comfort & Recovery InteractionsChairInteractionBedInteractionSolitaryBedInteractionMedicBedInteractionShowerInteractionKennelInteractionLockerInteractionChargingPodInteraction5.4 Study & ReadingStudyInteraction5.5 Gym EquipmentGymInteractionGymMasherBaseGymMasher_WeightLiftingGymMasher_KettleBeltsGymMasher_PullupGymMasher_Threadmill_ExerciseBikeGymMasher_Pommel_Footbag5.6 Information & UI InteractionsGuardBoardInteractionGuardComputerInteractionGuardOutfitCrateInteractionInformationBoardInteractionSignPostInteractionSignPost (UI)5.7 Other InteractionsFishingInteractionGeneratorInteractionIdleHoldInteractionTalkInteraction6. Carry Systems6.1 CarryInteraction6.2 CarryObjectInteraction6.3 CarryObjectInteractionDeserialiser7. Service & Job Interactions7.1 TrayInteraction7.2 BeckonAndMinigameServeCustomerInteraction7.3 BeckonCustomer8. Minigame System8.1 MasherBase8.2 StylePreset8.3 MinigameMap8.4 MinigameInteraction8.5 MinigameCompletionHelper8.6 MinigameConfig8.7 MasherItemProcessorInteraction (Abstract)9. Audio System9.1 Architecture Overview9.2 AudioController9.3 AudioProximityDetector9.4 Wwise IntegrationAkInitializerAkBankAkBankManagerAkEventAkAmbientAkGameObjAkStateAkSwitchAkSoundEngineAkUtilities9.5 AUTOGEN Wwise EnumsEvents.csGame_Parameter.csSwitch_Group.cs / State_Group.csSpecialised enum files:10. Animation & Effects10.1 AnimationEffectHandler10.2 EffectManager10.3 EffectHandler10.4 AnimationEffectCompletdEchoer10.5 AnimationPlayer10.6 CharacterAudioEvents10.7 CaptureAnimatorSoundEvent11. AppendicesA. Class HierarchyB. Wwise Event FlowC. Minigame Masher InterfaceD. Interaction Lifecycle SequenceE. Save/Load SerializationF. AI Event IntegrationG. Audio Events Referenced in Code