ori-community / wotw-seedgen

Seed Generator for the Ori and the Will of the Wisps randomizer
5 stars 9 forks source link

spawn restriction syntax #118

Closed SiriusAshling closed 5 months ago

SiriusAshling commented 1 year ago

Some spawns only make sense under certain conditions.

An example of this is WestHollow.HollowDrainMiddle, which can only work as a spawn location in unsafe or when a header drains the water on spawn.

One solution to this might be a syntax to restrict when an anchor is considered a valid spawn location, like:

anchor WestHollow.HollowDrainMiddle at -197, -4275:  # At the crystal below the purple eye
  spawnrestriction:
    moki: WestHollow.UpperDrainLeverPulled
    unsafe: free

This would avoid situations where seedgen picks an anchor as spawn that cannot work under the given circumstances and wastes one retry by failing to get anywhere.

Foopyo commented 5 months ago

This was solved by using tprestriction.

SiriusAshling commented 5 months ago

I don't think that's the same thing?

Foopyo commented 5 months ago

Right now, tprestriction is solving the same softlock than spawnrestriction but is less restrictive adding more variety to unsafe seeds.

Taking the WestHollow.HollowDrainMiddle example, you only have access to this pickup WestHollow.HiddenEC. Even if you could collect it without fulfilling tprestriction, then you couldn't keep that pickup when getting it from WestHollow.HollowDrainMiddle because you can't tp to safety. The only possible progression is to get access to another anchor from which you can either use your starting teleporter or start collecting more pickups.

For example, if you spawned at WestHollow.HollowDrainMiddle with WaterDash you can then go to WestHollow.HollowDrainLower

anchor WestHollow.HollowDrainMiddle at -197, -4275: 
  tprestriction:
    moki: WestHollow.UpperDrainLeverPulled OR WestHollow.FullyDrained

  conn WestHollow.HollowDrainLower:
    unsafe:
      Damage=60  # Would be only 40 if you didn't pull the lever but it have to work in either state of the water
      WaterDash, Damage=20 # Can do it damageless if you didn't pull the lever

Since WestHollow.HollowDrainLower doesn't have a tprestriction, you can then either use an hypothetical starting TP or collect new pickups.

In the case of WestHollow.FarLeftRoom (which doesn't have any connection to any other anchor), the only solution for seedgen is to fulfill the tprestriction. If it can't do it, then seedgen just won't be able to generate a beatable seed from that spawn and will roll another spawn instead.

SiriusAshling commented 5 months ago

Hmm not always being able to keep nearby pickups is an interesting point, that might be an oversight in the current tprestriction design (that should go elsewhere though since it's offtopic here). The motivation cited in this issue is preventing wasted retries, which it seems like we agree is not something tprestriction can provide