Lingo: Various generation optimizations (#2479)

Almost all of the events have been eradicated, which significantly improves both generation speed and playthrough calculation.

Previously, checking for access to a location involved checking for access to each panel in the location, as well as recursively checking for access to any panels required by those panels. This potentially performed the same check multiple times. The access requirements for locations are now calculated and flattened in generate_early, so that the access function can directly check for the required rooms, doors, and colors.

These flattened access requirements are also used for Entrance checking, and register_indirect_condition is used to make sure that can_reach(Region) is safe to use.

The Mastery and Level 2 rules now just run a bunch of access rules and count the number of them that succeed, instead of relying on event items.

Finally: the Level 2 panel hunt is now enabled even when Level 2 is not the victory condition, as I feel that generation is fast enough now for that to be acceptable.
This commit is contained in:
Star Rauchenberger
2023-11-25 07:09:08 -05:00
committed by GitHub
parent 8a852abdc4
commit 6dccf36f88
7 changed files with 330 additions and 169 deletions

View File

@@ -52,7 +52,10 @@ class ShufflePaintings(Toggle):
class VictoryCondition(Choice):
"""Change the victory condition."""
"""Change the victory condition.
On "the_end", the goal is to solve THE END at the top of the tower.
On "the_master", the goal is to solve THE MASTER at the top of the tower, after getting the number of achievements specified in the Mastery Achievements option.
On "level_2", the goal is to solve LEVEL 2 in the second room, after solving the number of panels specified in the Level 2 Requirement option."""
display_name = "Victory Condition"
option_the_end = 0
option_the_master = 1
@@ -75,9 +78,10 @@ class Level2Requirement(Range):
"""The number of panel solves required to unlock LEVEL 2.
In the base game, 223 are needed.
Note that this count includes ANOTHER TRY.
When set to 1, the panel hunt is disabled, and you can access LEVEL 2 for free.
"""
display_name = "Level 2 Requirement"
range_start = 2
range_start = 1
range_end = 800
default = 223