Blood moon: Difference between revisions
imported>Leoetlino No edit summary |
|||
(14 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
The '''Blood Moon''' is a game mechanic that ensures the world stays populated with enemies and weapons. Every time a blood moon occurs, enemies that have been defeated and overworld weapons that have been picked up by the player respawn. | The '''Blood Moon''' is a game mechanic that ensures the world stays populated with enemies and weapons. Every time a blood moon occurs, enemies that have been defeated and overworld weapons that have been picked up by the player respawn. | ||
''Regular'' or ''scheduled blood moons'' (those that occur at midnight) only exist for gameplay reasons: contrary to popular belief, they do ''not'' act as a garbage collection or error repair mechanism. | |||
In some rare circumstances, blood moons are also used to reset internal state when some subsystems are running out of memory or become unresponsive. Such blood moons do not follow any regular schedule and are commonly referred to as ''panic blood moons''. | |||
A common misconception is that blood moons help replenish system memory by resetting enemy kill flags. This is however total nonsense, because enemy kill flags are just GameData flags, and all GameData flags are loaded at bootup and stay in memory forever<ref>Even without any code reverse engineering, anyone who has an idea of what they are talking about knows that the game never loads [[Bootup.pack]] (which holds the GameData configuration) again after init so it cannot possibly be unloading flags. Not to mention that it'd be ridiculously inefficient to unload and reload flags all the time.</ref>. | A common misconception is that blood moons help replenish system memory by resetting enemy kill flags. This is however total nonsense, because enemy kill flags are just GameData flags, and all GameData flags are loaded at bootup and stay in memory forever<ref>Even without any code reverse engineering, anyone who has an idea of what they are talking about knows that the game never loads [[Bootup.pack]] (which holds the GameData configuration) again after init so it cannot possibly be unloading flags. Not to mention that it'd be ridiculously inefficient to unload and reload flags all the time.</ref>. | ||
== Scheduled Blood Moons == | == Scheduled Blood Moons == | ||
{{ | {{link to article|link=Time}} | ||
Scheduled Blood Moons are based on a timer that starts running as soon as the "step out of Shrine of Resurrection" cutscene (Demo103_0) has finished. When the timer reaches 7 in-game days, the WM_BloodyDay flag is set. The next time it is midnight, assuming blood moons are not inhibited, the Blood Moon cutscene will trigger. For more details, read [[Time]] or [[WorldMgr]] (for even more technical details). | |||
== Panic Blood Moons == | == Panic Blood Moons == | ||
Panic Blood Moons occur when the game is running out of memory<ref>0x71007A95B4 (Switch 1.5.0)</ref> or when some tasks are taking too much time. | Panic Blood Moons occur when the game is running out of memory<ref>Debug play reports refer to the event as a "BloodyMoon ForMemory" at 0x71007A95B4 (Switch 1.5.0)</ref> or when some tasks are taking too much time. Unlike regular blood moons, panic moons trigger a full system reset and take longer to execute. | ||
Contrary to a widespread theory, they are not used as a generic error handler or a fallback for "unhandled events". Panic blood moons can only occur in specific cases. | |||
Panic conditions are checked every frame by [[GameScene]], which also keeps track of the panic reason in an unsigned 32-bit integer so that memory issues can be reported to Nintendo via the [[telemetry]] system. | Panic conditions are checked every frame by [[GameScene#precalc]], which also keeps track of the panic reason in an unsigned 32-bit integer so that memory issues can be reported to Nintendo via the [[telemetry]] system. | ||
{|class="wikitable" | {|class="wikitable" | ||
Line 38: | Line 44: | ||
A panic moon causes enemies and other respawnable objects to respawn since it calls [https://eventviewer.zeldamods.org/viewer.html?data=/d/Demo011_0.json¶ms=1&entry=Demo011_0&node=Event3 Demo011_0] just like the regular blood moon code. The demo contains a call to [[AIDef:Action/EventOffWaitRevivalAction]] (OffWaitRevival), which appears to be what actually resets the revival flags. | A panic moon causes enemies and other respawnable objects to respawn since it calls [https://eventviewer.zeldamods.org/viewer.html?data=/d/Demo011_0.json¶ms=1&entry=Demo011_0&node=Event3 Demo011_0] just like the regular blood moon code. The demo contains a call to [[AIDef:Action/EventOffWaitRevivalAction]] (OffWaitRevival), which appears to be what actually resets the revival flags. | ||
== | === Panic blood moon inhibitors === | ||
{{ | Panic blood Moons can only occur if '''all''' of the following conditions are '''false'''<ref>Switch 1.5.0 0x71007ADFB0</ref>: | ||
* the player is in a dungeon, AocField, GameTestField, GameTestField2, or any debug or dev map | |||
* the Fade screen (loading screen) is opened | |||
* some [[EventMgr]] check returns false{{check}} | |||
* there is an active event | |||
* the player actor does not exist | |||
* the player is more than 0.5m away from his save position (game data flag: PlayerSavePos) | |||
== Notes == | == Notes == |
Latest revision as of 21:10, 25 May 2022
The Blood Moon is a game mechanic that ensures the world stays populated with enemies and weapons. Every time a blood moon occurs, enemies that have been defeated and overworld weapons that have been picked up by the player respawn.
Regular or scheduled blood moons (those that occur at midnight) only exist for gameplay reasons: contrary to popular belief, they do not act as a garbage collection or error repair mechanism.
In some rare circumstances, blood moons are also used to reset internal state when some subsystems are running out of memory or become unresponsive. Such blood moons do not follow any regular schedule and are commonly referred to as panic blood moons.
A common misconception is that blood moons help replenish system memory by resetting enemy kill flags. This is however total nonsense, because enemy kill flags are just GameData flags, and all GameData flags are loaded at bootup and stay in memory forever[1].
Scheduled Blood Moons
Full article: Time
Scheduled Blood Moons are based on a timer that starts running as soon as the "step out of Shrine of Resurrection" cutscene (Demo103_0) has finished. When the timer reaches 7 in-game days, the WM_BloodyDay flag is set. The next time it is midnight, assuming blood moons are not inhibited, the Blood Moon cutscene will trigger. For more details, read Time or WorldMgr (for even more technical details).
Panic Blood Moons
Panic Blood Moons occur when the game is running out of memory[2] or when some tasks are taking too much time. Unlike regular blood moons, panic moons trigger a full system reset and take longer to execute.
Contrary to a widespread theory, they are not used as a generic error handler or a fallback for "unhandled events". Panic blood moons can only occur in specific cases.
Panic conditions are checked every frame by GameScene, which also keeps track of the panic reason in an unsigned 32-bit integer so that memory issues can be reported to Nintendo via the telemetry system.
Bit | Description |
---|---|
0 | Resource system[3]: at least one of the following is true:
|
1 | PhysicsMemSys: Havok main heap is running out of memory (less than 5% free)[6] |
2 | PlacementMgr: Actor spawning heap is running out of memory (less than 5% free)[7] |
3 | ResourceSystem/OverlayArena: ForResourceS heap is running out of memory[8] |
4 | ResourceSystem/OverlayArena: ForResourceL heap is running out of memory[9] |
5 | ResourceSystem/OverlayArena: Audio heap is running out of memory[10] |
6 | ResourceSystem/TextureHandleMgr: Last TextureHandleMgr::calc execution took more than 60 seconds[check][11] |
A panic moon causes enemies and other respawnable objects to respawn since it calls Demo011_0 just like the regular blood moon code. The demo contains a call to AIDef:Action/EventOffWaitRevivalAction (OffWaitRevival), which appears to be what actually resets the revival flags.
Panic blood moon inhibitors
Panic blood Moons can only occur if all of the following conditions are false[12]:
- the player is in a dungeon, AocField, GameTestField, GameTestField2, or any debug or dev map
- the Fade screen (loading screen) is opened
- some EventMgr check returns false[check]
- there is an active event
- the player actor does not exist
- the player is more than 0.5m away from his save position (game data flag: PlayerSavePos)
Notes
- ↑ Even without any code reverse engineering, anyone who has an idea of what they are talking about knows that the game never loads Bootup.pack (which holds the GameData configuration) again after init so it cannot possibly be unloading flags. Not to mention that it'd be ridiculously inefficient to unload and reload flags all the time.
- ↑ Debug play reports refer to the event as a "BloodyMoon ForMemory" at 0x71007A95B4 (Switch 1.5.0)
- ↑ 0x7101213144
- ↑ 0x710120C5E4
- ↑ 0x71011FCDE4
- ↑ 0x7101216C08
- ↑ 0x7100D5DC40
- ↑ 0x71011FCFF8
- ↑ 0x71011FD000
- ↑ 0x71011FD008
- ↑ 0x710120C670
- ↑ Switch 1.5.0 0x71007ADFB0