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

AV2: Attract with Indra and drone at different points #131

Open Zannick opened 11 months ago

Zannick commented 11 months ago

AV2's portal attraction has some unusual behavior when used with the player figures in different places (normally there's only one figure when you have the attractor). Ideally we don't manually include all the valid spots Indra could be where moving the portal would work to a given spot in the drone's area. So either we:

Zannick commented 6 months ago

The algorithm would work like this:

  1. Define the spot of the portal as $P$, Indra as $I$, and the drone as $D$.
  2. We pick a particular angle $A$ to be the width of the conic sector around the vector $V_{PI}$.
  3. With $\hat V$ being the normalized vector of $V$, we know $D$ is within that sector if $\hat V{PI} \cdot \hat V{PD} < cos(A)$. ^1
  4. If $|V{PD}| < |V{PI}|$, then the drone is closer to the portal than Indra.

This should work with a correct value of $A$.

Zannick commented 6 months ago

If we want this to be run by the analyzer, we could create such a check with these builtins:

Transforming this into a precalculated map in the python will be expensive ( $O(S^3)$ ) if it's a global action. In the analyzer it would run a lot, but a lot more lazily (only as each possible triple is visited). I wonder if we should add caching for expensive functions (but this one is just a small amount of math, so probably not worth it).

Zannick commented 5 months ago

While this should work, it certainly won't cover all cases. The angle of the portal attraction used in the main glitchless strat is about 27 degrees from Indra at the final point, and probably works mostly because the attraction begins early (it doesn't work sometimes if you start it too low in the room) and the drone's gravitational pull is stronger enough with Indra's distance. This and others will probably have to be hardcoded actions.

Zannick commented 2 months ago

Renaming to better fit the remaining scope of the problem.