Alchemy

field_runtime.h

games/tbs/include/field_runtime.h on GitHub

Structures

SceneRecord

struct SceneRecord

A scene's row in gField_SceneTable: its overlay's resource, its group (the place it belongs to), a variant and its map.

FieldDeclared as
resourceIds16 resourceId
groups8 group
variants8 variantcopied to gGameState.sceneVariant; 2 sets flag 0x123
mapIndexu16 mapIndex
reservedu16 reserved0 in every row; not read

Used by Game_ResetForNewGame, Scene_LoadOverlay, gField_SceneTable.

Line 18

SceneRegion

struct SceneRegion

A scene's exit region: the box that, while its condition holds, takes the party leader out through its exit.

FieldDeclared as
minX, minY, minZs16 minX, minY, minZpixels, inclusive; minX -1 ends the table
maxX, maxY, maxZs16 maxX, maxY, maxZpixels, exclusive
conditions16 condition-1 always, a flag | 0x1000 set, else the flag clear
values16 valuethe exit kind, stored in FieldWork's exit

Used by AltmillerCave_GetRegions, BabiPalace_GetRegions, BilibinCave_GetRegions, BilibinInteriors_GetRegions, Bilibin_GetRegions, ColosseumEntrance_GetRegions, ColossoLog_GetRegions, ColossoRiver_GetRegions, Field_CheckExitRegions, ImilFuchinFalls_GetRegions, Imil_GetRegions, KalayInteriors_GetRegions, KalayTolbiDocks_GetRegions, Kalay_GetRegions, KolimaForestBend_GetRegions, KolimaForestBridge_GetRegions, KolimaForestClearing_GetRegions, KolimaForestRiver_GetRegions, KolimaForestTree_GetRegions, KolimaInteriors_GetRegions, Kolima_GetRegions, LaliveroInteriors_GetRegions, Lalivero_GetRegions, LamakanDesert_GetRegions, LemurianShip_GetRegions, MercuryLighthouseAerie_GetRegions, MercuryLighthouse_GetRegions, MogallForest_GetRegions, SceneData_ReturnZero, Scene_GetRegions, SolSanctumElementalStarRoom_GetRegions, SolSanctumEntrance_GetRegions, SolSanctumEruption_GetRegions, SolSanctumLunaSolRooms_GetRegions, SolSanctumStatue_GetRegions, TolbiInteriors_GetRegions, TolbiShipDeck_GetRegions, TolbiShipInteriors_GetRegions, TolbiShipMast_GetRegions, TolbiSpring_GetRegions and 26 more.

Line 30

SceneEntries

struct SceneEntries

The entry table at the start of each scene overlay: its initialize function and the functions returning its entrances, exits, placements, events and regions, each behind a veneer word.

FieldDeclared as
initializeVeneeru32 initializeVeneer
initializes32 (*initialize)(void)
entrancesVeneeru32 entrancesVeneer
entrancesconst struct SceneEntrance *(*entrances)(void)
exitsVeneeru32 exitsVeneer
exitsconst u32 *(*exits)(void)
placementsVeneeru32 placementsVeneer
placementsconst struct ScenePlacement *(*placements)(void)
eventsVeneeru32 eventsVeneer
eventsconst struct SceneEvent *(*events)(void)
regionsVeneeru32 regionsVeneer
regionsconst struct SceneRegion *(*regions)(void)

Used by gOverlayArea.

Line 42

MarkerSlot

struct MarkerSlot

A map marker placed as an actor: a chest or a Psynergy stone.

FieldDeclared as
objectstruct ObjectRuntime *object
idu8 idthe trigger of its scene event
unk05u8 unk05cleared with the slot; not named by TBS code
columnu8 columnits 16-pixel cell
rowu8 row

Used by Field_PlaceMapMarkers, Marker_FindSlot, Marker_GetActor, Marker_Hide, Marker_LaunchMimic, Marker_MoveLeaderAway, Marker_SetActorPosition, Marker_ShowOpened, SetMarkerAnimationAndPlaySound.

Line 62

FieldWork

struct FieldWork

Full event work allocated by Field_RunScene (heap slot 27). The twelve requests from action to event are handled by the field loop.

FieldDeclared as
tablesstruct ScenePlacement *tables[4]The placement tables placed so far, recorded by Event_SpawnObjectTable.
eventsconst struct SceneEvent *eventsthe scene's event table
actorsstruct FieldActor *actors[66]The actors by id: 0 to 7 the party's characters, 8 on the placed actors.
markersstruct MarkerSlot markers[10]the map's markers (MARKER_MAX)
actions16 actionThe twelve requests: each nonzero value asks the field loop for one thing; Field_ClearRequests clears them and Field_CountRequests sums them. @{ a step event (1 to 239) for Scene_RunTouchOrExit
inputs16 inputa tile code (252 to 254) for Field_RunPushTileEvent
exits16 exitthe exit taken, which ends the scene
menus16 menuopen the main menu
examines16 examinethe A button: examine what is ahead
starts16 startthe Start button: open the pause menu
descriptoru16 descriptoran actor's event, as actor | 0x1000
tiles16 tilea tile's collision code, for Field_SearchTile
battles16 battlethe enemy group of a random encounter
commands16 commanda field Psynergy to use, as owner << 10 | Psynergy
items16 iteman item to use, packed as Field_UseItem reads it
events16 eventA raised event for Scene_RunRaisedEvent, or -1 when characters fell to poison or hazard damage, -888 the world map, -889 a visibility change.
fallenCounts16 fallenCount@} the characters who fell this step
survivorCounts16 survivorCount0 when the whole party fell
fallenOwnerss16 fallenOwners[9]the characters who fell, from the active party
itemArguments16 itemArgumentthe inventory slot Field_UseItem receives
blockedStepss16 blockedStepsFrames the leader has pushed against something, counted by the player controls; touch events and push tiles need more than 12.
modes16 modeMODE_WORLD_MAP (3) on the world map
encounterGroupsu8 encounterGroups[8]encounter zone for each kind of ground
encounterBiass32 encounterBiasrandomized distance adjustment between battles
encounterThresholds32 encounterThresholdencounter steps before a battle; 0x100000
walkingDistanceScales32 walkingDistanceScalescales movement for PP and status updates
walkingDistances32 walkingDistanceaccumulated 16.16 distance awaiting an update
currentTilestruct MapCell *currentTilethe cell the leader last stepped onto
previousTilestruct MapCell *previousTilethe cell before it
transitions32 transitionSCENE_TRANSITION(style, variant); 0x100 on entry
unk1c4u16 unk1c4not named by TBS code
transitionActiveu16 transitionActiveset once the opening transition has started
transitionFramess32 transitionFramesframes; 16 on entry and at each event
fastForwards32 fastForwarddebug: skip timed event waits and actor messages
unk1d0u8 unk1d0[8]not named by TBS code
messages16 messagethe next message, advanced as each window opens
unk1dau16 unk1daset to 0xffff by FieldEvent_Begin; not read by name
unk1dcs16 unk1dcset to -1 by FieldEvent_Begin; not read by name
unk1des16 unk1deset to -1 by FieldEvent_Begin; not read by name
camerastruct ObjectRuntime *camerathe object the map view follows
unk1e4u8 unk1e4[0x10]not named by TBS code
speakers32 speakerthe actor speaking; the leader at each event
messageWindows32 messageWindowthe open message window, 0 for none
sideWindows32 sideWindowthe speaker's portrait window
unk200u8 unk200[0xab6]ObjectTable_ResetForObject builds the leader's two-row placement table at its start; nothing else names it.
busyu16 busySet while a raised or touch event runs; FieldEvent_Begin then resets the effect counter.
revealActives16 revealActivenonzero while Reveal is active
revealFramess16 revealFramesthe frames Reveal has left
revealCenterXs16 revealCenterXwhere Reveal was cast, in pixels
revealCenterYs16 revealCenterY
effectTimerRunnings16 effectTimerRunningNonzero lets the Reveal countdown advance; menus and other effects pause it.
nameMessages16 nameMessagefirst message of the menu's name window (0: none)
nameWidths16 nameWidthwidth of the name window (0: the default)
resolvingActions8 resolvingActionset while Psynergy takes effect
castStarteds8 castStartedset once a cast has been announced
queuedSounds16 queuedSounda sound BattleFx_PlayQueuedSound plays; -1 for none

Used by AltmillerCave_SetFadeLevel, BattleEffect_CleanupSceneObjects, BattleEffect_ClearAllObjects, BattleEffect_ClearOutOfBoundsObjects, BattleEffect_InitializeSharedScene, BattleFx_ClearRandomParticles, BattleFx_DispatchRequestKind, BattleFx_FindMatchingEvent, BattleFx_LoadActionEffectResources, BattleFx_PlayQueuedSound, BattleFx_PrepareBufferInterpolation, BattleFx_Run, BattleFx_RunVisibilityTransition, BattleFx_SetQueuedSoundAndPlay, BattleFx_StartRandomParticleEmitter, Battle_ResetEffectCounter, Battle_ShowPairedUnitWorkAndWait, Camera_FollowActor, Camera_FollowObject, Camera_GetEventObject, Camera_MoveWithinMapBounds, Camera_SetSpeedParameters, Camera_WaitForArrival, ColossoWall_RollLogToCell, CrossboneIslePillarRooms_UpdateActorPriority, Djinn_JoinParty, Encounter_RollTerrain, Encounter_SelectEnemyGroup, Encounter_SelectSceneZones, EventObject_Initialize, Event_AskYesNoWithActorAnimation, Event_CloakFades, Event_EnterDoor, Event_FinishScreenTransition, Event_FlipFirstSwitch, Event_FlipSecondSwitch, Event_PushPipeworksBlock, Event_ReadLeftGuardsThoughts, Event_RequestDestination, Event_RollLongLog and 85 more.

Line 77

FieldPosition

struct FieldPosition

A position on the field.

FieldDeclared as
x, y, zs32 x, y, z16.16 fixed-point pixels

Used by AltmillerCave_CheckFrostTargetCollision, AltmillerCave_HopSelectedActor, BabiLighthouse_FindActorAhead, BattleFx_CheckRaisedTargetCollision, BattleFx_SteerPushedTarget, ColossoLog_PushActorAhead, ColossoRiver_PushObjectAhead, ColossoWall_PushAdjacentObstacle, Colosso_FindActorAhead, CrossboneIslePillarRooms_TryJumpAcrossPillar, Event_HopEast, Event_HopNorth, Event_HopSouth, Event_HopSouthOrPushBlocks, Event_HopWest, Event_JumpAcrossGap, Event_JumpAcrossRoofGap, Event_JumpGapWest, Event_JumpToNextPillar, Event_PushActorAhead, Event_PushBlock, Event_PushOrClimbDown, FieldFx_RunForce, FieldObject_CheckMovementCollision, FieldObject_UpdatePlayerControl, FieldVector_AddPolarOffset, Field_ClimbDown, Field_ClimbUp, Field_TryJumpForward, Imil_RunIceSlide, Imil_SlideActorAcrossIce, Kalay_PushTunnelBlock, KolimaForest_HopEast, Map_CheckObjectStep, Map_UpdateWorldMapMarkers, MeetSandMonster, MercuryLighthouseAerie_JumpToPlatform, MercuryLighthouse_HopAcrossPool, MogallForest_FirstArea_JumpNorth, MogallForest_FirstArea_JumpSouth and 23 more.

Line 195

Globals, without a comment: gField_SceneTable, gOverlayArea.

On this page