Zannick / logic-graph

Tools for video game logic representation and analysis, particularly routing and beatability checks for speedruns and randomizers.
MIT License
3 stars 0 forks source link

Allow arbitrary rules settings #143

Closed Zannick closed 6 months ago

Zannick commented 6 months ago

The format would be like:

rules:
    objective:
        default: true
        all_items: [...]
        all_bosses: [...]
    victory:
        default: Victory
        just_these_items: [...]

and any can be defined. In the settings file it would look like

rules:
    objective: all_items

This generalizes #48.

Zannick commented 6 months ago

There are a few additional challenges here of things that we handled directly based on objective:

Unused items can be handled by set-intersection (e.g. an is_item_used function that checks one rule setting at a time).

Progress measuring is trickier, but both are basically derived from a list of required items; either we can provide it separately from the rule (perhaps even as separate lists of 'progress items' to use for bucketing and 'needed items' for estimates), or we require $victory be an itemList that includes $objective so that we can easily figure out all the needed items automatically.

Zannick commented 6 months ago

I'm tempted to require that all rules be itemList.

Zannick commented 6 months ago

Generally, this is what this will look like: required items are the items in the set victory condition, plus the items in the set rules in that victory condition.

For AV2, the victory condition would be written like [Victory, Apocalypse_Bomb, $objective], assuming $objective is a requirement to get Apocalypse_Bomb which is a requirement for Victory. If we needed more flexibility or wanted to shortcut some tests, we could make the victory condition be just Victory but then we have to associate what the required items are separately. The main thing I can think of is that, for any All Items category in AV2, one flask is actually gettable on the escape sequence at the end of the game, which we'd have to write like [Victory, Apocalypse_Bomb, Flask{n}, $objective] where $objective has one less flask than the victory condition (or we'd write a separate rule).