WorldMgr: Difference between revisions

2,023 bytes added ,  3 years ago
Added Wii U init address
(Marked this version for translation)
(Added Wii U init address)
 
(13 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<translate>
<languages/>
<!--T:1-->
<!--T:1-->
{{Subsystem infobox|name=WorldMgr|init_addr_switch150=00000071010F2920|is_name_official=1|description=Manages world state (time, blood moons, climates, weather, etc.)}}
{{Subsystem infobox|name=WorldMgr|init_addr_switch150=00000071010F2920|init_addr_wiiu150=03672220|is_name_official=1|description=Manages world state (time, blood moons, climates, weather, etc.)}}


<translate>
<!--T:2-->
<!--T:2-->
The '''World Manager''' (WorldMgr) is responsible for managing time, blood moons, climates, weather, fog, wind, lighting, procedural generation of clouds, whether the Lord of the Mountain appears, etc.
The '''World Manager''' (WorldMgr) is responsible for managing time, blood moons, climates, weather, fog, wind, lighting, procedural generation of clouds, whether the Lord of the Mountain appears, etc.
Line 10: Line 11:


== WorldMgr == <!--T:4-->
== WorldMgr == <!--T:4-->
=== Sub-managers ===
 
=== Sub-managers === <!--T:42-->
Sub-managers are created in WorldMgr::init (0x71010F43C0) and inserted into a pointer array (@WorldMgr+0x5c0). All names below are unofficial.
Sub-managers are created in WorldMgr::init (0x71010F43C0) and inserted into a pointer array (@WorldMgr+0x5c0). All names below are unofficial.
</translate>


<!--T:5-->
<!--T:5-->
{|class="wikitable"
{|class="wikitable"
|+ Sub-managers by ID
|+ <translate><!--T:43--> Sub-managers by ID</translate>
! ID !! Description
! <translate><!--T:44--> ID</translate> !! <translate><!--T:45--> Description</translate>
|-
|-
| 0 || TimeMgr: Handles time, blood moons, Lord of the Mountain.
| 0 || <translate><!--T:46--> TimeMgr: Handles time, blood moons, Lord of the Mountain.</translate>
|-
|-
| 1 || CloudPrMgr: Handles cloud procedural generation.
| 1 || <translate><!--T:47--> CloudPrMgr: Handles cloud procedural generation.</translate>
|-
|-
| 2 || ShootingStarMgr: Manages shooting stars and (in 1.3.3+) special shooting stars for the Xenoblade 2 quest.
| 2 || <translate><!--T:48--> ShootingStarMgr: Manages shooting stars and (in 1.3.3+) special shooting stars for the Xenoblade 2 quest.</translate>
|-
|-
| 3 || WeatherMgr: Handles "rain splash" and climate weathers.
| 3 || <translate><!--T:49--> WeatherMgr: Handles "rain splash" and climate weathers.</translate>
|-
|-
| 4 || TempMgr: Handles world temperature{{check}}.
| 4 || <translate><!--T:50--> TempMgr: Handles world temperature{{check}}.</translate>
|-
|-
| 5 || ?
| 5 || ?
|-
|-
| 6 || SkyMgr: Handles sky and fog{{check}}. Holds the configuration for all EnvPalettes, EnvAttributes, WeatherInfluences, Remains palettes, Indoor palettes and dungeon fogs.
| 6 || <translate><!--T:51--> SkyMgr: Handles sky and fog{{check}}. Holds the configuration for all EnvPalettes, EnvAttributes, WeatherInfluences, Remains palettes, Indoor palettes and dungeon fogs.</translate>
|-
|-
| 7 || DofMgr: Handles depth of field{{check}}. Holds depth of field related parameters.
| 7 || <translate><!--T:52--> DofMgr: Handles depth of field{{check}}. Holds depth of field related parameters.</translate>
|-
|-
| 8 || ?
| 8 || ?
|}
|}


<translate>
=== Climate === <!--T:6-->
=== Climate === <!--T:6-->
The main WorldMgr class is responsible for keeping climate related parameters and determining which set of climate settings to use. Strangely enough, WorldMgr uses the position of the Camera actor to figure out which map area the player is in (and thus what climate to use), not the Player actor.
The main WorldMgr class is responsible for keeping climate related parameters and determining which set of climate settings to use. Strangely enough, WorldMgr uses the position of the Camera actor to figure out which map area the player is in (and thus what climate to use), not the Player actor.
Line 45: Line 49:
<!--T:8-->
<!--T:8-->
Internally, time of day is stored as a float in the [0.0, 360.0] range.
Internally, time of day is stored as a float in the [0.0, 360.0] range.
0.0 = midnight = 360.0; 90 ≈ morning; 180.0 = noon; and so on.


=== TimeMgr::init === <!--T:9-->
=== TimeMgr::init === <!--T:9-->
Line 52: Line 57:


=== TimeMgr::reset === <!--T:10-->
=== TimeMgr::reset === <!--T:10-->
This is called whenever a stage is unloaded (essentially every time the loading screen is shown).
This is called whenever a stage is unloaded (essentially every time the loading screen is shown when loading a different kind of stage -- e.g. shrine → overworld, but not shrine → shrine or overworld → overworld).
* Blood Moon checks are delayed.
* Blood Moon checks are delayed.
* The AnimalMaster_Appearance flag is cleared, meaning the Lord of the Mountain will not appear.
* The AnimalMaster_Appearance flag is cleared, meaning the Lord of the Mountain will not appear.
Line 62: Line 67:
* (If field 0x14A is set to 99, WM_BloodyDay is set to true. [[AIDef:Action/SetBloodyMoonEnv]] uses this to force a Blood Moon to be scheduled. This feature appears to be unused.)
* (If field 0x14A is set to 99, WM_BloodyDay is set to true. [[AIDef:Action/SetBloodyMoonEnv]] uses this to force a Blood Moon to be scheduled. This feature appears to be unused.)
* If both [[Demo]]103_0 and Demo997_0 have not been played, time of day is reset to 78.75 (05:15).
* If both [[Demo]]103_0 and Demo997_0 have not been played, time of day is reset to 78.75 (05:15).
** Demo103_0 is the "leaving Shrine of Resurrection" cutscene, and Demo997_0 is a cutscene that doesn't exist anymore.
* If [[AIDef:Action/AdvanceTime]] or anything else that changes time of day was called, the actual time is updated at this moment.
* If [[AIDef:Action/AdvanceTime]] or anything else that changes time of day was called, the actual time is updated at this moment.
* [[#Midnight checks]].
* The game then performs [[#Midnight checks]].


<!--T:13-->
<!--T:13-->
* '''Update time of day''': there are several possible update modes. In most cases, the update mode is 0.
* '''Update time of day''': there are several possible update modes. In most cases, the update mode is 0.
</translate>
{|class="wikitable"
{|class="wikitable"
! Mode !! Description
! <translate><!--T:53--> Mode</translate> !! <translate><!--T:54--> Description</translate>
|-
|-
| 0 || If Demo103_0 or Demo997_0 have been played, and if there is no active event (cutscene):
| 0 || <translate>
<!--T:55-->
If Demo103_0 or Demo997_0 have been played, and if there is no active event (cutscene):
* Add (0.0083333 * elapsed frames) to the Time of Day timer. Effectively, this means that 1 in-game minute = 1 real-life second.
* Add (0.0083333 * elapsed frames) to the Time of Day timer. Effectively, this means that 1 in-game minute = 1 real-life second.
* If the timer is >= 360.0, which means that a day has passed, the game subtracts 360 from the timer and then performs midnight checks.
* If the timer is >= 360.0, which means that a day has passed, the game subtracts 360 from the timer and then performs midnight checks.
* If FindDungeon_Activated is false (if the player hasn't received the ''The Isolated Plateau'' quest) and if the current time is >= 165.0 (11:00), the time is forcefully set to 11:00. Effectively, this means that time will not get past 11:00 until the Great Plateau Tower is activated and the Old Man cutscene is triggered.
* If FindDungeon_Activated is false (if the player hasn't received the ''The Isolated Plateau'' quest) and if the current time is >= 165.0 (11:00), the time is forcefully set to 11:00. Effectively, this means that time will not get past 11:00 until the Great Plateau Tower is activated and the Old Man cutscene is triggered.
* The Blood Moon timer is updated too.
* The Blood Moon timer is updated too.
</translate>
|-
|-
| 1, 13, 35 || Freeze time to 04:00
| 1, 13, 35 || <translate><!--T:56--> Freeze time to 04:00</translate>
|-
|-
| 2, 14 || Freeze time to 05:00
| 2, 14 || <translate><!--T:57--> Freeze time to 05:00</translate>
|-
|-
| 3, 16, 36 || Freeze time to 07:00
| 3, 16, 36 || <translate><!--T:58--> Freeze time to 07:00</translate>
|-
|-
| 4, 19, 37 || Freeze time to 10:00
| 4, 19, 37 || <translate><!--T:59--> Freeze time to 10:00</translate>
|-
|-
| 5, 26, 39 || Freeze time to 17:00
| 5, 26, 39 || <translate><!--T:60--> Freeze time to 17:00</translate>
|-
|-
| 6, 28, 40 || Freeze time to 19:00
| 6, 28, 40 || <translate><!--T:61--> Freeze time to 19:00</translate>
|-
|-
| 7, 30, 41 || Freeze time to 21:00
| 7, 30, 41 || <translate><!--T:62--> Freeze time to 21:00</translate>
|-
|-
| 8, 11 || Freeze time to 02:00
| 8, 11 || <translate><!--T:63--> Freeze time to 02:00</translate>
|-
|-
| 9, 42 || Freeze time to 00:00
| 9, 42 || <translate><!--T:64--> Freeze time to 00:00</translate>
|-
|-
| 10 || Freeze time to 01:00
| 10 || <translate><!--T:65--> Freeze time to 01:00</translate>
|-
|-
| 12 || Freeze time to 03:00
| 12 || <translate><!--T:66--> Freeze time to 03:00</translate>
|-
|-
| 15 || Freeze time to 06:00
| 15 || <translate><!--T:67--> Freeze time to 06:00</translate>
|-
|-
| 17 || Freeze time to 08:00
| 17 || <translate><!--T:68--> Freeze time to 08:00</translate>
|-
|-
| 18 || Freeze time to 09:00
| 18 || <translate><!--T:69--> Freeze time to 09:00</translate>
|-
|-
| 20 || Freeze time to 11:00
| 20 || <translate><!--T:70--> Freeze time to 11:00</translate>
|-
|-
| 21 || Freeze time to 12:00
| 21 || <translate><!--T:71--> Freeze time to 12:00</translate>
|-
|-
| 22, 38 || Freeze time to 13:00
| 22, 38 || <translate><!--T:72--> Freeze time to 13:00</translate>
|-
|-
| 23 || Freeze time to 14:00
| 23 || <translate><!--T:73--> Freeze time to 14:00</translate>
|-
|-
| 24 || Freeze time to 15:00
| 24 || <translate><!--T:74--> Freeze time to 15:00</translate>
|-
|-
| 25 || Freeze time to 16:00
| 25 || <translate><!--T:75--> Freeze time to 16:00</translate>
|-
|-
| 27 || Freeze time to 18:00
| 27 || <translate><!--T:76--> Freeze time to 18:00</translate>
|-
|-
| 29 || Freeze time to 20:00
| 29 || <translate><!--T:77--> Freeze time to 20:00</translate>
|-
|-
| 31 || Freeze time to 22:00
| 31 || <translate><!--T:78--> Freeze time to 22:00</translate>
|-
|-
| 32 || Freeze time to 23:00
| 32 || <translate><!--T:79--> Freeze time to 23:00</translate>
|-
|-
| 34 ||
| 34 ||<translate>
<!--T:80-->
* Add (0.0083333 * elapsed frames) to the Time of Day timer.
* Add (0.0083333 * elapsed frames) to the Time of Day timer.
* If the timer is >= 360.0, which means that a day has passed, the game subtracts 360 from the timer.
* If the timer is >= 360.0, which means that a day has passed, the game subtracts 360 from the timer.
Line 130: Line 141:
<!--T:14-->
<!--T:14-->
'''Note''': In this state, the blood moon timer is never updated and its value is never checked either.  
'''Note''': In this state, the blood moon timer is never updated and its value is never checked either.  
</translate>
|}
|}
 
<translate>
<!--T:15-->
<!--T:15-->
* Update the [[#Day/night time flag]], the [[#Time division, IsMorning, IsNoon, etc.]]
* Update the [[#Day/night time flag]], the [[#Time division, IsMorning, IsNoon, etc.]]
Line 172: Line 184:


<!--T:23-->
<!--T:23-->
Note: Vah Rudania is missing from the list. This is normal and blood moons still cannot happen during the Vah Rudania battle sequence because the BloodyMoonProhibition flag is set during it.
Note: Vah Rudania is missing from the list. This is normal: blood moons cannot happen during the Vah Rudania battle sequence because the BloodyMoonProhibition flag is not set.


=== Day/night time flag === <!--T:24-->
=== Day/night time flag === <!--T:24-->
Line 179: Line 191:
<!--T:25-->
<!--T:25-->
In any other case, WM_DaytimeFlag is set to true and WM_NighttimeFlag to false.
In any other case, WM_DaytimeFlag is set to true and WM_NighttimeFlag to false.
</translate>


=== Time division, IsMorning, IsNoon, etc. === <!--T:26-->
=== Time division, IsMorning, IsNoon, etc. === <!--T:26-->
{|class="wikitable"
{|class="wikitable"
! Start !! End !! Division !! Time type (1) !! Time type (2)
! <translate><!--T:81--> Start</translate> !! <translate><!--T:82--> End</translate> !! Division !! Time type (1) !! Time type (2)
|-
|-
| 04:00 || 05:00 || 0 || MorningA || Morning_A1
| 04:00 || 05:00 || 0 || MorningA || Morning_A1
Line 202: Line 215:
| 00:00 || 04:00 || 7 || NightB || Night_B
| 00:00 || 04:00 || 7 || NightB || Night_B
|}
|}
<translate>
<!--T:83-->
Note: all intervals include the start time and exclude the end time.
Note: all intervals include the start time and exclude the end time.


Line 234: Line 250:
Otherwise, the game does nothing until the current hour matches the previously generated appearance hour, at which point it sets AnimalMaster_Appearance to true (which allows the LotM to spawn) and goes into state 2.
Otherwise, the game does nothing until the current hour matches the previously generated appearance hour, at which point it sets AnimalMaster_Appearance to true (which allows the LotM to spawn) and goes into state 2.


====State 2==== <!--T:36-->
====State 2 - Satori Mountain is glowing==== <!--T:36-->
After one hour has elapsed, the current day of the week is stored and the state is set to 3.
After one hour has elapsed, the current day of the week is stored and the state is set to 3.


====State 3==== <!--T:37-->
====State 3 - Prepare to despawn==== <!--T:37-->
After two week day changes, ''or'' [after the in-game day of the week changes and the current hour is >= the generated appearance hour], the LotM will disappear and the state will be set to 4.
After two week day changes, ''or'' [after the in-game day of the week changes and the current hour is >= the generated appearance hour], the LotM will disappear and the state will be set to 4.


====State 4==== <!--T:38-->
====State 4 - Despawned==== <!--T:38-->
The game waits for the moon type to be 5, before going back to state 0.
The game waits for the moon type to be 5, before going back to state 0.


Line 246: Line 262:
{{expand section}}
{{expand section}}
=== Weather types ===
=== Weather types ===
</translate>
{|class="wikitable"
{|class="wikitable"
! Value !! Name
! <translate><!--T:84--> Value</translate> !! <translate><!--T:85--> Name</translate>
|-
|-
| 0 || Bluesky
| 0 || Bluesky
Line 269: Line 286:


<!--T:40-->
<!--T:40-->
[[Category:Internals]]
[[Category:Internals{{#translation:}}]]
[[Category:Subsystems (BotW)]]
[[Category:Subsystems (BotW){{#translation:}}]]
</translate>
editnews, Administrators
90

edits