FiendsOfTheElements / FF1Randomizer

A randomizer for Final Fantasy 1 on the NES.
http://finalfantasyrandomizer.com
GNU General Public License v3.0
82 stars 46 forks source link

Seed Generation Failures with Custom Flags Plus the Mystery of an Unsolvable Seed #1093

Open kagerato opened 3 weeks ago

kagerato commented 3 weeks ago

Test Date : 2024 August 18 Test Version : 4.8.3 Flag Set : Custom (see examples below)

It seems some custom flag sets with AirBoat, few shuffled key items, and pregenerated shuffled-access overworlds run into some weird edge cases. Trying various seed values and map-gen seed selections fairly easily runs into combinations which will fail to generate with error :

"Item placement could not meet incentivization requirements"

Only key items in chests are being shuffled, NPC related shuffles are off. There in theory should always be enough location slots to fit all items, but in practice I guess there are not ? When I look through the flags carefully, the only parts that really stand out are AirBoat enabled and the use of the pregenerated but shuffled access overworld.

Here's the first three examples I found which fail to generate this way :

https://4-8-3.finalfantasyrandomizer.com/?s=C603D50E&f=9Dv8VHGZHxDkHt7YvCNL0KhL4nxAmiCRdU.-PpprgtPTISSdEyHbt-a7H3KZHSLMOrfEAgsDDZSwIO-i8jVRzMVqrOrNVQNvzZwmVBmdMj8jsoRF0enjl2lQnBZY9q2C9w58a92ewodS4wu5LRx9Xk.i.EqX6owEasonFV3cuZWeSOE

https://4-8-3.finalfantasyrandomizer.com/?s=0CCE1E12&f=9Dv8VHGZHxDkHt7YvukhjtKSyd10.F.Uk9JHvc3h1CwzEL8G7M6NHQUhDeUEEFuIBqDhUIPZrTlvrta71jVRzMVqrOrNVQNvzZwmVBmdMj8jsoRF0enjl2lQnBZY9q2C9w58a92ewodS4wu5LRx9Xk.i.EqX6owEasonFV3cuZWeSOE

https://4-8-3.finalfantasyrandomizer.com/?s=AF4799BC&f=9Dv8VHGZHxDkHt7YvucLGR9aMdgZzNEXTVr1KLl-ecL.jv3jqsKOMy27EeF0WR9GqqrbZTA9zlLidqs85jVRzMVqrOrNVQNvzZwmVBmdMj8jsoRF0enjl2lQnBZY9q2C9w58a92ewodS4wu5LRx9Xk.i.EqX6owEasonFV3cuZWeSOE

Perhaps even more interestingly, I played a seed today with value 61326A50 on these same flags, but I foolishly discarded/lost the mapgen seed (and thus don't know which of the pregenerated maps it was, other than having the minimap image of it below) . That seed generated fine of course, but ultimately looked to be impossible to complete. Under these flags, Bikke in Pravoka should always have the Ship (as I understand it, anyway) . However, Pravoka, Temple of Fiends, Ice Cave, and Gaia were all air-or-sea locked isles. It appears the logic was assuming it was possible to acquire and use Airship, which it would have been except for the AirBoat flag blocking it from being raised from the airship desert. At one point, I also considered whether it was simply a shipless seed, but that didn't appear possible either (and AFAIK the generator never fully-isolates key items even if they're not actually required to complete the current seed) .

Here's what the pregenerated shuffled-access overworld looked like in seed 61326A50 with the unknown mapgen sub-seed value :

world-minimap-tiny

world-minimap-scaled

It was not possible to confirm in-game, but it looks like the ship/airship locked locations were :

Titan's Tunnel led to the eastern-most subcontinent, where only Bahamut and the Oasis were present.

The desert cross where the airship is normally raised was on the main continent (north-central region), but as mentioned AirBoat flag prevented it from being used. Floater was discovered in a western Cardia cave. So it might be an odd flags interaction without a specific cross-check led to an unsolvable seed ?

I definitely understand how with the absurd number of combinatorial possibilities that custom flags produce, something could slip through here.

In any event, thanks to everyone who's worked on FFR. Always a good time (even when I discover our quest is soft-locked three hours in -- lol).

wildham0 commented 3 weeks ago

Contrarily to standard procgen ow maps, shuffled access maps don't guarantee early access to pravoka so if you don't shuffle npcs the ship can be simply inaccessible and more often than not you can't beat the seed without it (sometime the airship desert might be on the starting continent and you can raise the airship, but obviously airboat would prevent that from working).

As for the mystery map, logic does account for the airboat setting so it should be beatable, unfortunately i can't do much troubleshooting without the actual map. If you still have the rom, you can run it here and post the info from the textbox: https://4-8-3.finalfantasyrandomizer.com/rominfo

tetron commented 3 weeks ago

Most "shuffled access" maps are probably not beatable without shuffling NPCs, e.g. if Crescent lake could be canoe locked or ice cave could be airship locked. What you'd expect to see in those situations is to get "Item placement could not meet incentivization requirements" 100% of the time, so it seems like this is probably a logic checker bug.

If you don't want to shuffle NPCs, then the "standard" procgen maps are the way to go.

kagerato commented 2 weeks ago

@wildham0 Yeah, I actually kept the ROM in case there was some tool to extract the relevant data. The reported results are :

FFRInfo
Seed: 61326A50
OW Seed: none
Res. Pack Hash: none
Flags: 9Dv8VHGZHxDkHt7YveocNsrk3FDPn-W4knQ84Oquo1o9X7-Pyb4S5kw.FxI4J58ttZCUK6SlpZ8cvLiz3jVRzMVqrOrNVQNvzZwmVBmdMj8jsoRF0enjl2lQnBZY9q2C9w58a92ewodS4wu5LRx9Xk.i.EqX6owEasonFV3cuZWeSOE
Version: 4-8-3

Version and Seed values match what I'd expect, but I have no idea why OW Seed reports "none" . Is the overworld seed value ignored in some circumstances ? (I named the ROM file XFFR_2024_Aug_18_61326A50.nes , which is why I knew the general seed but not the OW seed value.)

@tetron A logic checker bug does make sense, as there clearly "should" be many cases where this combination of flags fails to align properly and the overall generator result failure rate seems to at least roughly correlate, just not in every single scenario.

Since a perfect logic checker is a pretty big ask, maybe it makes sense at the moment to simply document on the wiki that partial key item shuffles are ill-advised with shuffled overworld. Perhaps in Chapter 4 of the FFR Guide, a blurb something like "NOTE: Take care to align the key item shuffle configuration with your procedurally generated overworld settings. With shuffled access overworlds in particular, you will most likely want to either shuffle all key items into the pool, or none of them." I imagine there's a few other combinations of feature flags that also tend to have a high failure rate or cause other oddness that the community has found, so perhaps those would warrant their own notes in relevant sections.

Thanks for the replies !

wildham0 commented 2 weeks ago

when you use the pregen option, there's no map seed so it's fine i was able to extract the map with that info and you're right it isn't completable with airboat, there was in fact a logic bug

as for the wiki, it's managed by the community discord, so you can suggest changes and improvement over there thanks for the bug report!

kagerato commented 2 weeks ago

Thanks for the investigation and confirmation. Now that I have a strong idea of what's going on, should be easy to avoid this weird scenario by tweaking the flag set.

Good to know about the wiki.

You're most welcome!