Applying Logic to Rando Location Assignment


At the core of Rando is randomization, but at the same time there needs to be some logical structure applied to the assignment of items. In Zelda ALttPR if you play a seed with logic applied the generator will consider item locations so that the player never gets soft-locked out of progression. For example, the Bow will never be in a location which is only accessible by having a Bow, the Hammer won't be locked behind a Hammer Peg, Flippers will not be in a chest surrounded by deep water etc. this is the simplest form of the logic pattern, there are many, many layers of this logic.

The prototype currently displays locations marked as chests, which the player can approach and open, obtaining the item inside. The challenge for our game is making sure we recreate the logic pattern to ensure the player can't get stuck. At first this meant giving each location a unique Id and a Boolean flag to say, 'you need the X item to open me'. When we assign an item, we then consider those flags.

The problem with this approach is that it's only surface deep - if a Bow is placed in a Hammer-locked location there's nothing in the current logic structure to stop the Hammer from being placed in a Bow-Locked location, or worse: no progression items are placed in an open location, therefore preventing access to ANY other chests. My problem which I and looking to solve is how to ensure all these flags are updated without closing off options later in the assignment process.

So, this means keeping a trace of all items being placed, and updating the flags depending on what has been placed before it. This introduces a new potential problem: we might get to the end of the assignment list and find that our only options are to place the Bow in a hammer chest, and the hammer in a bow chest since all other options have been taken. So here we need to implement an order of priority: make sure that all critical items are placed before the collectables.

Each item in the game, if we are assuming we're like Zelda, has a different value to the progression of the game. The Bow and Hammer are essential to the progression of the game, you cannot beat the game without them, while 100 Rupees holds no value to the progression of the game, you can find rupees everywhere, even if you need to buy a Hammer from a shop you will be able to farm Rupees to get it as opposed to getting the 100 locked in a Hammer chest. When we place our items, we need to make sure the logic is placing our critical items first. that way if we reach the end of our list, we don't have a situation where we have nowhere to place our last critical item.

To borrow ALttPR's list: Items are classed as 'Critical', 'Nice', and 'Trash' (they also use 'Dungeon-specific' for dungeon keys, that doesn't apply to Rando yet). The randomiser will assign critical items first, considering the locations of other critical items and locations locked by those critical items, it will them give 'Nice' items a location and fill out the rest of the locations with 'Trash'. I've defined Critical and Trash, but what about 'Nice'? This is a pool of items which might include things like Armor and Sword upgrades, the kind of items which are nice to have as a safety but are not critical to the progression of the game.

See 'How to read the seed' for a basic overview of ALttPR logic.

As it is now, my prototype is at paragraph 2. The purpose of this post is simply to dump some thoughts and structure to what I think I need to do next,a dn share that with people reading. It may help others in similar situation or may provide a little insight into the challenges of randomizing a progression-based game. This sort of randomization isn't the same as, say Enter the Gungeon, where weapons and pick-ups have less significant impact on a player's ability to beat the game, in that game whether you get a pistol or a Galaxy Gun on the first floor has no bearing on accessing the rest of the game - instead the player's skill carries the progression. A player might stand more of a chance of winning with a Galaxy Gun, but it their pistol won't prevent them from progressing either.

 

Leave a comment

Log in with itch.io to leave a comment.