mirror of
https://github.com/ArchipelagoMW/Archipelago.git
synced 2026-04-05 08:48:12 -07:00
Update world api.md
This commit is contained in:
@@ -745,9 +745,12 @@ and check whether they were **unlocked**.
|
||||
`get_newly_locked_enemies` should only consider enemies that are *already in the set*
|
||||
and check whether they **became locked**.
|
||||
|
||||
There are a multitude of other ways you can optimise LogicMixin. Some games choose to have a `mygame_state_is_stale`
|
||||
variable that they simply set to True in collect/remove, and then only call the recalculating functions
|
||||
from any relevant access rules by checking `state.mygame_state_is_stale[player]` and setting it back to `False`.
|
||||
There are a multitude of other ways you can optimise LogicMixin. Some games use a `mygame_state_is_stale`
|
||||
variable that they simply set to True in collect/remove, and then call the recalculating functions
|
||||
from the actual relevant access rules only when state.mygame_state_is_stale[player] is True,
|
||||
after which they set it back to False.
|
||||
This can help quite significantly because it is possible for 0 local access rules to be called between two calls to
|
||||
`collect`, so recalculating on every `collect` is very slow.
|
||||
|
||||
Only use LogicMixin if necessary. There are often other ways to achieve what it does, like making clever use of
|
||||
`state.prog_items`, or using event items, pseudo-regions etc.
|
||||
|
||||
Reference in New Issue
Block a user