Bgdata: Difference between revisions

From ZeldaMods (Breath of the Wild)
Jump to navigation Jump to search
imported>Leoetlino
(Created page with "{{lowercase}} '''bgdata''' (binary game data) files are BYMLs containing lists of GameData flags. They are stored in gamedata.sarc and loaded by GameDataMgr. bgda...")
 
imported>Leoetlino
(→‎Contents: If any key is found, the game will stop parsing the rest of the file.)
Line 4: Line 4:
bgdata files are most likely machine generated.
bgdata files are most likely machine generated.
== Contents ==
== Contents ==
The root node is always a dictionary that contains at least one of the following keys:
The root node is always a dictionary that contains one of the following keys:
* bool_data
* bool_data
* s32_data
* s32_data
Line 66: Line 66:


For vector types (vec2, vec3, vec4), a value is stored as an array which further contains an array of values (e.g. <code>[ [-1.0, 0.0] ]</code> for a vec2).
For vector types (vec2, vec3, vec4), a value is stored as an array which further contains an array of values (e.g. <code>[ [-1.0, 0.0] ]</code> for a vec2).
If any key is found, the game will stop parsing the rest of the file.


== Examples ==
== Examples ==

Revision as of 17:47, 24 March 2019

bgdata (binary game data) files are BYMLs containing lists of GameData flags. They are stored in gamedata.sarc and loaded by GameDataMgr.

bgdata files are most likely machine generated.

Contents

The root node is always a dictionary that contains one of the following keys:

  • bool_data
  • s32_data
  • f32_data
  • string_data
  • string64_data
  • string256_data
  • vector2f_data
  • vector3f_data
  • vector4_data
  • bool_array_data
  • s32_array_data
  • f32_array_data
  • string32_array_data
  • string64_array_data
  • string256_array_data
  • vector2f_array_data
  • vector3f_array_data
  • vector4_array_data

The value for each of these keys is a dictionary:

Key Type Description
Category int [Optional, present for some flags] Category[check]
DataName str Flag name (unused in release builds; only written for debug purposes)
DeleteRev int First game revision where this flag has been deleted[check]. Always -1 in all released versions.
HashValue int Flag name CRC32
InitValue varies Initial flag value

For array types, this is an array that contains a dictionary that in turn contains an array of values, like so:

  InitValue:
  - Values: [0, 0, 0, 0, 0, 0, 0]
IsEventAssociated bool Is associated with an event[check]
IsOneTrigger bool ?[check]
IsProgramReadable bool Whether the flag can be read by the game
IsProgramWritable bool Whether the flag can be written to by the game
IsSave bool Whether the flag should be saved[check]
MaxValue varies Maximum flag value

For array types, this is the maximum value each item in the array can take.

MinValue varies Minimum flag value

For array types, this is the minimum value each item in the array can take.

ResetType int Reset type (see GameDataMgr)

For vector types (vec2, vec3, vec4), a value is stored as an array which further contains an array of values (e.g. [ [-1.0, 0.0] ] for a vec2).

If any key is found, the game will stop parsing the rest of the file.

Examples

s32_data:
- {DataName: dummy, DeleteRev: -1, HashValue: 1000, InitValue: 0, IsEventAssociated: false,
  IsOneTrigger: false, IsProgramReadable: false, IsProgramWritable: false, IsSave: false,
  MaxValue: 0, MinValue: 0, ResetType: 0}
- {DataName: CurrentRupee, DeleteRev: -1, HashValue: 588553208, InitValue: 0, IsEventAssociated: false,
  IsOneTrigger: false, IsProgramReadable: true, IsProgramWritable: true, IsSave: true,
  MaxValue: 999999, MinValue: 0, ResetType: 0}
vector4f_data:
- DataName: dummy_vec4
  DeleteRev: -1
  HashValue: -645927712
  InitValue:
  - [0.0, 0.0, 0.0, 0.0]
  IsEventAssociated: false
  IsOneTrigger: false
  IsProgramReadable: false
  IsProgramWritable: false
  IsSave: false
  MaxValue:
  - [255.0, 255.0, 255.0, 255.0]
  MinValue:
  - [0.0, 0.0, 0.0, 0.0]
  ResetType: 0
bool_array_data:
- DataName: Horse_IsFamiliarityChecked
  DeleteRev: -1
  HashValue: -2025648995
  InitValue:
  - Values: [0, 0, 0, 0, 0, 0]
  IsEventAssociated: false
  IsOneTrigger: false
  IsProgramReadable: true
  IsProgramWritable: true
  IsSave: true
  MaxValue: true
  MinValue: false
  ResetType: 0