Blood moon: Difference between revisions

From ZeldaMods (Breath of the Wild)
Jump to navigation Jump to search
imported>Leoetlino
No edit summary
imported>Leoetlino
Line 9: Line 9:


== Panic Blood Moons ==
== Panic Blood Moons ==
Panic Blood Moons occur when the game is running out of memory or when some tasks are taking too much time.
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 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]], 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.
Line 17: Line 17:
! Bit !! Description
! Bit !! Description
|-
|-
| 0 || '''[[Resource system]]''': at least one of the following is true:
| 0 || '''[[Resource system]]'''<ref>0x7101213144</ref>: at least one of the following is true:
* Bit 12 is set in the ResourceMgrTask's flags (indicating a problem with a resource load{{check}})
* Bit 12 is set in the ResourceMgrTask's flags (indicating a problem with a resource load{{check}})<ref>0x710120C5E4</ref>
* ''An'' overlay arena's heap free size percentage is ''less than or equal to'' its configured minimum percentage.
* ''An'' overlay arena's heap free size percentage is ''less than or equal to'' its configured minimum percentage.<ref>0x71011FCDE4</ref>
**The limit is 0% for the OverlayArena system itself, "Tera SZS work" (Tera decompressing buffer), Audio and [[StarterPackMgr]]. The default is 0% too.
**The limit is 0% for the OverlayArena system itself, "Tera SZS work" (Tera decompressing buffer), Audio and [[StarterPackMgr]]. The default is 0% too.
**The limit is 5% for the "ForResourceS" (small) and "ForResourceL" (large) heaps, which is where most resources are allocated from.
**The limit is 5% for the "ForResourceS" (small) and "ForResourceL" (large) heaps, which is where most resources are allocated from.
|-
|-
| 1 || '''[[PhysicsMemSys]]''': Havok main heap is running out of memory (''less than'' 5% free)
| 1 || '''[[PhysicsMemSys]]''': Havok main heap is running out of memory (''less than'' 5% free)<ref>0x7101216C08</ref>
|-
|-
| 2 || '''[[PlacementMgr]]''': Actor spawning heap is running out of memory (''less than'' 5% free)
| 2 || '''[[PlacementMgr]]''': Actor spawning heap is running out of memory (''less than'' 5% free)<ref>0x7100D5DC40</ref>
|-
|-
| 3 || '''ResourceSystem/OverlayArena''': ForResourceS heap is running out of memory
| 3 || '''ResourceSystem/OverlayArena''': ForResourceS heap is running out of memory<ref>0x71011FCFF8</ref>
|-
|-
| 4 || '''ResourceSystem/OverlayArena''': ForResourceL heap is running out of memory
| 4 || '''ResourceSystem/OverlayArena''': ForResourceL heap is running out of memory<ref>0x71011FD000</ref>
|-
|-
| 5 || '''ResourceSystem/OverlayArena''': Audio heap is running out of memory
| 5 || '''ResourceSystem/OverlayArena''': Audio heap is running out of memory<ref>0x71011FD008</ref>
|-
|-
| 6 || '''ResourceSystem/TextureHandleMgr''': Last TextureHandleMgr::calc execution took more than 60 seconds
| 6 || '''ResourceSystem/TextureHandleMgr''': Last TextureHandleMgr::calc execution took more than 60 seconds{{check}}<ref>0x710120C670</ref>
|}
|}



Revision as of 15:36, 27 October 2018

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.

Blood moons are also used to reset internal state when some subsystems are running out of memory or become unresponsive. Such blood moons are commonly referred to as "panic" or "emergency 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

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.

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 Blood Moon reasons
Bit Description
0 Resource system[3]: at least one of the following is true:
  • Bit 12 is set in the ResourceMgrTask's flags (indicating a problem with a resource load[check])[4]
  • An overlay arena's heap free size percentage is less than or equal to its configured minimum percentage.[5]
    • The limit is 0% for the OverlayArena system itself, "Tera SZS work" (Tera decompressing buffer), Audio and StarterPackMgr. The default is 0% too.
    • The limit is 5% for the "ForResourceS" (small) and "ForResourceL" (large) heaps, which is where most resources are allocated from.
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 OffWaitRevival, which appears to be what actually resets the revival flags.

Inhibitors

  1. Even without reverse engineering the code, everyone 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.
  2. 0x71007A95B4 (Switch 1.5.0)
  3. 0x7101213144
  4. 0x710120C5E4
  5. 0x71011FCDE4
  6. 0x7101216C08
  7. 0x7100D5DC40
  8. 0x71011FCFF8
  9. 0x71011FD000
  10. 0x71011FD008
  11. 0x710120C670