WorldMgr: Difference between revisions

Jump to navigation Jump to search
imported>Leoetlino
imported>Leoetlino
(5 intermediate revisions by the same user not shown)
Line 6: Line 6:


== WorldMgr ==
== WorldMgr ==
{{empty section}}
=== Sub-managers ===
=== Sub-managers ===
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.
Line 19: Line 17:
| 1 || CloudPr? Handles cloud procedural generation.
| 1 || CloudPr? Handles cloud procedural generation.
|-
|-
| 2 || ???
| 2 || ?
|-
|-
| 3 || Weather? Handles "rain splash" and climate weathers.
| 3 || Weather? Handles "rain splash" and climate weathers.
Line 25: Line 23:
| 4 || TemperatureMgr? (Reasonably sure about this one.)
| 4 || TemperatureMgr? (Reasonably sure about this one.)
|-
|-
| 5 || ???
| 5 || ?
|-
|-
| 6 || Sky and fog? Holds the configuration for all EnvPalettes, EnvAttributes, WeatherInfluences, Remains palettes, Indoor palettes and dungeon fogs.
| 6 || Sky and fog? Holds the configuration for all EnvPalettes, EnvAttributes, WeatherInfluences, Remains palettes, Indoor palettes and dungeon fogs.
Line 31: Line 29:
| 7 || DofMgr? Holds depth of field related parameters.
| 7 || DofMgr? Holds depth of field related parameters.
|-
|-
| 8 || ??? (contains a BaseProcLink, so it might have something to do with actors.)
| 8 || ?
|}
|}


Line 63: Line 61:
* 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.
* 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.
|-
|-
Line 178: Line 176:
|}
|}
Note: all intervals include the start time and exclude the end time.
Note: all intervals include the start time and exclude the end time.
=== Moon type ===
The moon type is calculated based on the number of in-game days (WM_NumberOfDays). The exact formula is <code>(numberOfDays + x + 1) % 8</code><ref>0x71010E8200</ref>, where x is equal to 1 if the current time is > 180.0 (noon) and % is the modulo operator.
If a moon type was set manually (for instance using [[AIDef:Action/EventSetMoonType]]), that value will be used as the moon type.
The moon type is returned by [[AIDef:Query/WhatMoonName]], which some NPC event flows use to check the current moon phase. However, the moon schedule has nothing to do with the blood moon schedule.


=== Lord of the Mountain ===
=== Lord of the Mountain ===
The Lord of the Mountain appears whenever the AnimalMaster_Appearance flag is set. Its value is managed by a simple state machine in WorldMgr::TimeMgr.
Note that whenever a stage is unloaded, the AnimalMaster_Appearance flag is reset to false.
====State 0 - Wait for conditions====
If the following three conditions are true:
* The [[#Moon type]] must be 5 (waxing crescent)
* The AnimalMaster_Existence flag must be false (the LotM must not already be spawned)
* The current [[map area]] number must not be 64 ("HyruleHill", presumably the Satori Mountain area)
then the game generates a random "appearance hour" in the [0 .. 22] interval and goes into state 1.
====State 1 - Wait for the appearance time====
If the player is in map area 64, the state is reset back to 0.
Otherwise, the game does nothing until the current hour matches the previously generated appearance hour, at which point it sets AnimalMaster_Appearance to true and goes into state 2.
====State 2====
After one hour has elapsed, the current day of the week is stored and the state is set to 3.
====State 3====
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====
The game waits for the moon type to be 5, before going back to state 0.


[[Category:Internals]]
[[Category:Internals]]
[[Category:Subsystems (BotW)]]
[[Category:Subsystems (BotW)]]
Anonymous user

Navigation menu