Subsystems and GameDataMgr: Difference between pages

From ZeldaMods (Breath of the Wild)
(Difference between pages)
Jump to navigation Jump to search
imported>Leoetlino
No edit summary
 
imported>Leoetlino
 
Line 1: Line 1:
Note: the following list does not include external libraries. Addresses are only correct for Switch 1.5.0.
{{Subsystem infobox|name=GameDataMgr|is_name_official=1|description=Manages game data flags|init_addr_switch150=0000007100DCE964}}
{{stub}}


{| class="wikitable sortable"
GameDataMgr holds the date of all game data flags and provides functions to get, set and reset them. It is also responsible for keeping track of "shop sold out" flags and resetting them regularly.
! Name !! <code>createInstance</code> @ !! Official name !! Description
 
|-
Flag data is loaded from [[bgdata]] files and stored in [[TriggerParam]] objects. Transferring data from and to save files is done by interacting with the [[SaveSystem]] and [[SaveMgr]] subsystems.
| Account || 0000007100D0D958 || Yes || -
 
|-
In debug versions, GameDataMgr is able to sync save data from and to a computer.
| ActorCaptureMgr || 00000071007C0F60 || Yes || Development tool. See [[ActorCapture]]
 
|-
== TriggerParams ==
| [[ActorCreator]] || 00000071011DBAE4 || No || Constructs actors.
There are at least two sets of TriggerParams at all times and up to four (param1, param, ???, GimmickResetBuffer). The exact purpose of each TriggerParam is currently unknown.
|-
 
| ActorDebug || 0000007100D255F0 || Yes || Debug tool.
After all GameData flag info has been loaded into this->triggerParam from the GameData archive ([[gamedata.sarc]]), another TriggerParam instance called param1 (this->triggerParam1) is constructed and data is copied from this->triggerParam. The copy function also builds the lists of flags that need to be reset (with a non-zero ResetType) and of boolean flags with (initialValue >> 1) != 0.
|-
 
| ActorFactory || 00000071006CB940 || No || Holds a function pointer to the function that constructs a C++ actor by name.
== Flags ==
|-
 
| ActorHeapUtil || 0000007100897748 || No ||-
== GameDataMgr::Flags ==
|-
Stored at GameDataMgr+0xC18 on Switch 1.5.0. Most flags are still poorly understood.
| [[ActorInfoData]] || 0000007100D2E16C || Yes || Utilities for querying actor info using [[ActorInfo.product.byml]], without having to load actors
 
|-
Flags are checked in the main update function (GameDataMgr::calc). Some flags are used to request actions such as resetting all flags to their initial value; these are automatically unset after GameDataMgr has processed the request.
| [[ActorParam]] || 000000710116804C || Yes || Loads actor parameter files (such as ActorLink, AIProgram, etc.) Used by ActorCreator.
 
|-
<source lang="c++">
| ActorPreLoadMgr || 0000007100D585C4 || Yes || -
enum GameDataMgr::Flags
|-
{
| ActorSystem || 0000007100D5D144 || Yes || -
  GameDataMgr::Flags_1 = 0x1,
|-
  GameDataMgr::Flags_2 = 0x2,
| ActorTemplate || 000000710108A0A0 || Yes || Utilities for querying data from [[ActorTemplate.byml]]
  /// Causes GameDataMgr to call TriggerParam::resetToInitialValues(this->triggerParam1),
|-
  /// clear some values of this->triggerParam and invoke reset callbacks
| AIClassDef || 00000071011DF82C || Yes || Utilities for querying data from [[AIDef_Game.product.byml]]
  GameDataMgr::Flags_NeedResetAllToInitial = 0x4,
|-
  /// Causes GameDataMgr to call TriggerParam::reset(this->triggerParam1) (see below)
| AmiiboMgr || 00000071006488A8 || Yes || Handles amiibo functionality
  GameDataMgr::Flags_NeedReset = 0x8,
|-
  /// [Debug only] Creates a TriggerParam instance called "GimmickResetBuffer" (if needed)
| AnimSequence || 0000007101163CE8 || Yes || -
  /// and copies data from param1.
|-
  /// A pointer to the instance is stored in GameDataMgr.
| aoc2 || 0000007100D6CDA4 || No || Handles DLC1 additions (such as Master Mode)
  GameDataMgr::Flags_NeedGimmickReset = 0x10,
|-
  /// If this->gimmickResetBufferParam is non-null, copy it to triggerParam and to triggerParam1 (args: 1, 0, 0).
| aoc3 || 000000710067F1C4 || No || Handles DLC2 additions
  GameDataMgr::Flags_NeedCopyGimmickParam = 0x20,
|-
  /// If this->gimmickResetBufferParam is non-null, copy it to triggerParam and to triggerParam1 (args: 1, 1, 0).
| aocManager || 0000007100D69170 || Yes || Manages AoC related flags, add-on content resource loading and packs
  GameDataMgr::Flags_40 = 0x40,
|-
  GameDataMgr::Flags_80 = 0x80,
| ASSetting || 00000071012F33D4 || Yes || -
  GameDataMgr::Flags_100 = 0x100,
|-
  GameDataMgr::Flags_200 = 0x200,
| Attention || 0000007100D73AA0 || Yes || -
  GameDataMgr::Flags_400 = 0x400,
|-
  /// Set from flag setter functions. The name is based on the fact that IsChangedByDebug gets set at the same time.
| AutoDim || 00000071010B6878 || Yes || -
  GameDataMgr::Flags_IsChangedByDebugMaybe = 0x800,
|-
  GameDataMgr::Flags_1000 = 0x1000,
| AutoGenFramework (A) || 000000710127C120 || No || Debug only
  GameDataMgr::Flags_2000 = 0x2000,
|-
  GameDataMgr::Flags_4000 = 0x4000,
| AutoGenFramework (B) || 000000710127C244 || No || Debug only
  GameDataMgr::Flags_ChangeOnlyOnceMode = 0x8000,
|-
  GameDataMgr::Flags_10000 = 0x10000,
| AutoPlacementFlowMgr || 0000007100651F94 || Yes || Runs event flow files to determine which actors to spawn on the map dynamically
  GameDataMgr::Flags_20000 = 0x20000,
|-
  /// If set, GameDataMgr::calc will skip copying param1 to param (args: 0, 0, 0)
| AutoPlacementMgr || 00000071006546FC || Yes || -
  GameDataMgr::Flags_DisableParam1ToParamSync = 0x40000,
|-
  GameDataMgr::Flags_IsRestartFromGameOverMaybe = 0x80000,
| Awareness || 0000007100D79324 || Yes || -
  GameDataMgr::Flags_DoNotResetToInitialFromRadarMgr = 0x100000,
|-
};
| BaseProcMgr || 00000071011BD0CC || Yes || Unknown what this does exactly, but it is a critical part of the actor system
</source>
|-
 
| Camera || 0000007100D8C324 || Yes || -
== Reset flags ==
|-
Stored at GameDataMgr+0xC1C on Switch 1.5.0.
| CameraEditor || 00000071010BA244 || Yes || -
{|class="wikitable"
|-
! Flag !! Description
| Chemical || 0000007100D99240 || Yes || -
|-
| Chmres || 0000007100D97D74 || No || -
|-
| Controller || 0000007100D9E964 || Yes || -
|-
| CookingMgr || 000000710089FFC8 || Yes || Determines which cook item should be returned for a given set of ingredients.
|-
| CreatePlayerEquipActorMgr || 0000007100665E1C || Yes || -
|-
| CreatePlayerTrashActorMgr || 0000007100667494 || Yes || -
|-
| CurrentResNameMgr || 00000071010B77A0 || Yes || Debug tool; unused in release builds.
|-
| DebugFinder || 000000710124A564 || Yes || Debug tool.
|-
|-
| DebugInput || 0000007101266FD8 || Yes || Debug tool.
| 1 || ?
|-
|-
| DragonChallengeMgr || 00000071006F9594 || Yes || [DLC2] -
| 2 || Corresponds to reset type 1.
|-
|-
| DungeonPackMgr || 00000071008A559C || Yes || Handles dungeon pack loading when changing stages.
| 4 || Corresponds to reset type 2.
|-
|-
| E3Mgr || 00000071008A5E04 || Yes || Handles E3 demo mode (time limit). Stubbed in release builds.
| 8 || Corresponds to reset type 3.
|-
|-
| Ecosystem || 0000007100E4174C || Yes || Handles map areas, climates, auto placement parameters, difficulty scaling, etc.
| 0x10 || Corresponds to reset type 4.
|-
| Effect || 00000071011B3FB0 || Yes || -
|-
| EffectInfoData || 0000007101270A54 || Yes || Utilities for querying data from [[EffectInfo.byml]]
|-
| EventInfoData || 0000007100DAEE4C || Yes || Utilities for querying data from [[EventInfo.product.byml]]
|-
| EventMgr1 || 0000007100E48658 || No || -
|-
| EventMgr || 0000007100DAF3D8 || Yes || Manages all in-game events ([[event flow]]s, [[demo]]s, etc.)
|-
| EventMgrMiniGame || 0000007100E493F0 || No || -
|-
| GameConfig || 00000071008BBA94 || Yes || Holds game configuration setting values, which are hardcoded in release builds.
|-
| GameDataMgr || 0000007100DCE964 || Yes || Holds all game data flags and provides functions to get or set values
|-
| GameSceneSubsys1 || 00000071007CBA28 || No || Unknown, initialised from GameScene code
|-
| GameSceneSubsys2 || 00000071007A5CA8 || No || Unknown, initialised from GameScene code
|-
| GameSceneSubsys3 || 00000071007D20A0 || No || Unknown, initialised from GameScene code
|-
| GameSceneSubsys4 || 000000710066A204 || No || Unknown, initialised from GameScene code
|-
| GameSceneSubsys5 || 00000071009052FC || No || Unknown, initialised from GameScene code
|-
| GameSceneSubsys6 || 000000710067170C || No || Unknown, initialised from GameScene code
|-
| GameSceneSubsys7 || 00000071007D32E8 || No || Unknown, initialised from GameScene code
|-
| GameSceneSubsys8 || 0000007100E4D770 || No || Unknown, initialised from GameScene code
|-
| GameSceneSubsys9 || 0000007100674F78 || No || Unknown, initialised from GameScene code
|-
| GameSceneSubsys10 || 000000710067F3A8 || No || Unknown, initialised from GameScene code
|-
| GameSceneSubsys11 || 0000007100D2B7C8 || No || Unknown, initialised from GameScene code
|-
| GameSceneSubsys12 || 00000071006623F0 || No || Unknown, initialised from GameScene code
|-
| GameSceneSubsys13 || 00000071008A52E0 || No || Unknown, initialised from GameScene code
|-
| GameSceneSubsys14 || 0000007100903598 || No || Unknown, initialised from GameScene code
|-
| GameSceneSubsys15 || 000000710089469C || No || Unknown, initialised from GameScene code
|-
| GameTool || 0000007100EDB87C || Yes || Debug tool.
|-
| GlobalMessage || 00000071011F4BF0 || Yes || -
|-
| GlobalParameter || 0000007100E4D064 || Yes || -
|-
| Graphics || 0000007100F2A1D0 || Yes || -
|-
| HavokAI || 0000007100F80B20 || Yes || -
|-
| HavokWorkerMgr || 00000071011F9C78 || Yes || -
|-
| Hio || 000000710121367C || Yes || -
|-
| HorseMgr || 0000007100E81FB0 || No || Handles horse registrations and status (?)
|-
| IceBlockMgr || 000000710066E984 || No || -
|-
| InitResourceReload || 0000007100F3CE9C || Yes || Debug tool.
|-
| KingEditor || 000000710122DD70 || Yes || Debug tool (?)
|-
| LastBossMgr || 00000071006776D4 || No || -
|-
| LayoutResourceMgr || 00000071010A2520 || Yes || Manages layout (= UI) related resources, such as message archives, fonts, etc.
|-
| LODMgr || 000000710125184C || Yes || Level of detail manager?
|-
| LowPrioThreadMgr || 000000710127A524 || Yes || -
|-
| MCMgr || 0000007100DCB390 || Yes || -
|-
| MemoryProfiler || 00000071010B7D18 || Yes || Debug tool.
|-
| MessageCapture || 00000071010B7E74 || Yes || Debug tool.
|-
| ModelCreator || 0000007100F4C63C || Yes || -
|-
| ModelPicker || 00000071010B7F9C || Yes || Debug tool.
|-
| ModelResourceDivide || 0000007100D3C978 || Yes || -
|-
| MoviePlayer || 00000071010B9934 || Yes || -
|-
| NavMeshSystem || 0000007100E8E850 || Yes || -
|-
| NFP || 0000007100F45988 || Yes || NFC services, used by AmiiboMgr
|-
| nxargs || 0000007100901BA4 || Yes || [Switch] Holds launch parameters (retrieved with nn::oe::TryPopLaunchParameter)
|-
| OnUiActorMgr || 00000071009065B0 || Yes || -
|-
| OverlayArenaSystem || 0000007100FDE3E8 || Yes || Memory utilities, used by ResourceMgr.
|-
| Patrol || 00000071010B9EF0 || Yes || Development
|-
| PauseMenuDataMgr || 000000710096B1CC || Yes || -
|-
| PhysicsMemSys || 0000007101213FF0 || No || Manages memory and custom Havok classes for the Havok library.
|-
| PlacementMgr || 00000071011E451C || Yes || Reads [[map unit]] ([[mubin]]) files and spawns actors
|-
| PlayerInfo || 0000007100854298 || No || Holds information about the player (position, heart, stamina, etc.)
|-
| PlayReport || 0000007100FD381C || Yes || Handles play reports, i.e. [[telemetry]] data
|-
| QuestMgr || 0000007100FD5770 || Yes || Holds information about game quests and steps. Interacts with GameDataMgr.
|-
| RadarMgr || 000000710067B9C0 || Yes || -
|-
| Reaction || 0000007100EC0138 || Yes || -
|-
| ResidentActorMgr || 000000710090E0A0 || Yes || Creates and manages actors that are always kept in memory such as GameROMPlayer
|-
| [[res::ResourceMgrTask]] || 0000007100ECA468 || Yes || Manages game resources (loading, unloading, caching, defragmenting, etc.). See also [[Resource system]].
|-
| [[ResourceSystem]] || 0000007100ECA468 || Yes || See also [[Resource system]].
|-
| Revision || 00000071010BA104 || Yes || Holds information about the game version and source revision. Unused in release builds.
|-
| RideMgr || 00000071006783F4 || No || Manages horses (?) and the Master Cycle Zero.
|-
| Rumble || 0000007100897B74 || Yes || -
|-
| SaveMgr || 0000007100E03214 || Yes || Loads game data into GameDataMgr or writes it to saves.
|-
| SaveSystem || 000000710090EE60 || No || -
|-
| SceneMgr || 0000007100896254 || Yes || -
|-
| Sound || 00000071011FA364 || Yes || -
|-
| SoundInfoData || 000000710103D5F8 || Yes || Utilities for querying data from [[SoundInfo.byml]]
|-
| SoundResource || 00000071011FA604 || Yes || -
|-
| StagePreActorCache || 0000007100ED912C || Yes || -
|-
| StarterPackMgr || 0000007100EDAA98 || Yes || Handles pack loading (AocMainField, Bootup, Title, TitleBG, lang packs) during early initialisation or stage changes
|-
| StatisticsMgr || 0000007100E31D1C || Yes || Manages access to precomputed map statistics (stored in Game/Stats)
|-
| TalkSystem || 00000071008AA614 || No || -
|-
| Terminal || 000000710109CC44 || Yes || Debug tool?
|-
| Terrain || 000000710114961C || Yes || -
|-
| TipsMgr || 000000710091DDD4 || Yes || Manages loading screen tips (resources, executing event flows)
|-
| UI || 00000071010A5714 || Yes || -
|-
| uiManager || 0000007100A6E038 || Yes || -
|-
| VFR || 00000071011C0D38 || Yes || -
|-
| Vibration || 00000071010BAEB4 || Yes || -
|-
| VideoRecorder || 00000071010BA7EC || Yes || Leftover development tool that writes screen captures to <code>%s/%04d.tga</code> (?)
|-
| WildHorseMgr || 0000007100E8C1F4 || No || -
|-
| WolfLinkMgr || 00000071006828A8 || No || Handles Wolf Link related tasks
|-
| WorkerSupportThreadMgr || 0000007100DCDFB0 || Yes || -
|-
| WorldMgr || 00000071010F2920 || Yes || Manages world state (time, blood moons, climates, weather, etc.)
|-
| XLink || 000000710123DE44 || Yes || Wrapper around the xlink2 library (EffectLink and SoundLink)
|-
| XLinkInfoData || 0000007101239668 || Yes || Utilities for querying data from [[XLinkInfo.byml]]
|}
|}
[[Category:Internals]]
 
== Reset process ==
All game data flags for which <code>(1 << resetType) & resetFlags</code> is true are reset to their initial values.
 
TriggerParam::reset processes up to 1024 flags at a time. The function returns the number of remaining flags to reset and flag 0x08 (GameDataMgr::Flags_NeedReset) is only cleared when all flags have been reset.
 
=== bool and s32 flags with reset type 3 ===
bool and s32 flags with reset type 3, and with a flag name hash that is listed in ShopAreaInfo (in [[ShopGameDataInfo.byml]]) receive special treatment.
 
If:
* the player is in none of the shop areas that are associated with the flag (or in the Dealer's area for area-less flags); or if the player is not on MainField
* '''and''', for items with the <code>Arrow</code> tag: if the player has fewer than {itemSaleRevivalCount} arrows in their inventory
Then:
* The flag is reset to its initial value.
* For bool flags: All associated sold out flags are reset to their initial values.
 
[[Category: Internals]]
[[Category: Subsystems (BotW)]]

Revision as of 09:47, 31 December 2018

GameDataMgr
Subsystem
Official name Yes
Description Manages game data flags
Init function Switch 1.5.0: 0000007100DCE964
Wii U 1.5.0: ???
Debug only No


GameDataMgr holds the date of all game data flags and provides functions to get, set and reset them. It is also responsible for keeping track of "shop sold out" flags and resetting them regularly.

Flag data is loaded from bgdata files and stored in TriggerParam objects. Transferring data from and to save files is done by interacting with the SaveSystem and SaveMgr subsystems.

In debug versions, GameDataMgr is able to sync save data from and to a computer.

TriggerParams

There are at least two sets of TriggerParams at all times and up to four (param1, param, ???, GimmickResetBuffer). The exact purpose of each TriggerParam is currently unknown.

After all GameData flag info has been loaded into this->triggerParam from the GameData archive (gamedata.sarc), another TriggerParam instance called param1 (this->triggerParam1) is constructed and data is copied from this->triggerParam. The copy function also builds the lists of flags that need to be reset (with a non-zero ResetType) and of boolean flags with (initialValue >> 1) != 0.

Flags

GameDataMgr::Flags

Stored at GameDataMgr+0xC18 on Switch 1.5.0. Most flags are still poorly understood.

Flags are checked in the main update function (GameDataMgr::calc). Some flags are used to request actions such as resetting all flags to their initial value; these are automatically unset after GameDataMgr has processed the request.

enum GameDataMgr::Flags
{
  GameDataMgr::Flags_1 = 0x1,
  GameDataMgr::Flags_2 = 0x2,
  /// Causes GameDataMgr to call TriggerParam::resetToInitialValues(this->triggerParam1),
  /// clear some values of this->triggerParam and invoke reset callbacks
  GameDataMgr::Flags_NeedResetAllToInitial = 0x4,
  /// Causes GameDataMgr to call TriggerParam::reset(this->triggerParam1) (see below)
  GameDataMgr::Flags_NeedReset = 0x8,
  /// [Debug only] Creates a TriggerParam instance called "GimmickResetBuffer" (if needed)
  /// and copies data from param1.
  /// A pointer to the instance is stored in GameDataMgr.
  GameDataMgr::Flags_NeedGimmickReset = 0x10,
  /// If this->gimmickResetBufferParam is non-null, copy it to triggerParam and to triggerParam1 (args: 1, 0, 0).
  GameDataMgr::Flags_NeedCopyGimmickParam = 0x20,
  /// If this->gimmickResetBufferParam is non-null, copy it to triggerParam and to triggerParam1 (args: 1, 1, 0).
  GameDataMgr::Flags_40 = 0x40,
  GameDataMgr::Flags_80 = 0x80,
  GameDataMgr::Flags_100 = 0x100,
  GameDataMgr::Flags_200 = 0x200,
  GameDataMgr::Flags_400 = 0x400,
  /// Set from flag setter functions. The name is based on the fact that IsChangedByDebug gets set at the same time.
  GameDataMgr::Flags_IsChangedByDebugMaybe = 0x800,
  GameDataMgr::Flags_1000 = 0x1000,
  GameDataMgr::Flags_2000 = 0x2000,
  GameDataMgr::Flags_4000 = 0x4000,
  GameDataMgr::Flags_ChangeOnlyOnceMode = 0x8000,
  GameDataMgr::Flags_10000 = 0x10000,
  GameDataMgr::Flags_20000 = 0x20000,
  /// If set, GameDataMgr::calc will skip copying param1 to param (args: 0, 0, 0)
  GameDataMgr::Flags_DisableParam1ToParamSync = 0x40000,
  GameDataMgr::Flags_IsRestartFromGameOverMaybe = 0x80000,
  GameDataMgr::Flags_DoNotResetToInitialFromRadarMgr = 0x100000,
};

Reset flags

Stored at GameDataMgr+0xC1C on Switch 1.5.0.

Flag Description
1 ?
2 Corresponds to reset type 1.
4 Corresponds to reset type 2.
8 Corresponds to reset type 3.
0x10 Corresponds to reset type 4.

Reset process

All game data flags for which (1 << resetType) & resetFlags is true are reset to their initial values.

TriggerParam::reset processes up to 1024 flags at a time. The function returns the number of remaining flags to reset and flag 0x08 (GameDataMgr::Flags_NeedReset) is only cleared when all flags have been reset.

bool and s32 flags with reset type 3

bool and s32 flags with reset type 3, and with a flag name hash that is listed in ShopAreaInfo (in ShopGameDataInfo.byml) receive special treatment.

If:

  • the player is in none of the shop areas that are associated with the flag (or in the Dealer's area for area-less flags); or if the player is not on MainField
  • and, for items with the Arrow tag: if the player has fewer than {itemSaleRevivalCount} arrows in their inventory

Then:

  • The flag is reset to its initial value.
  • For bool flags: All associated sold out flags are reset to their initial values.