ACotGK: Quest Order Bug

Found a “neat” bug today, replaying Chapter 1 for testing purposes. Here’s what happens. The party enters the final fortress for Chapter 1, and is presented with a locked door in front of them:

Fortress entrance.

On clicking on the locked door, “You need the Bagduul key to unlock this door.” Not remembering the exact details, I figured I had missed the key somewhere, so I went through the previous few areas looking for the key. Nowhere to be found!

So, I went back to the source code. You are supposed to get the Bagduul key from the big boss of Chapter 1. Then, you can open the treasure room (using the key), where you get your well deserved reward. But, in this case, the treasure room was spawned as the very first room in the fortress, so you couldn’t get to the boss to get the key in the first place. Oops!

My first fix was to make sure the treasure room wouldn’t get spawned as the first room in the dungeon. But then I had a thought, borne out by some testing. The treasure room could still get spawned as the room right _before_ the boss room, again blocking access to the key need to access the treasure room. Oops again!

At least I thought of this before it caused more problems. The fix I settled on was to move the treasure room to an attic, a mini-level upstairs from the main level. The locked door is then on a completely separate level, and can’t possibly block access to the boss.

This does show one of the drawbacks to procedurally generated levels. Just because the level generation code makes a good level once, doesn’t mean it always does. As a coder, I need to make sure to test things in as thorough a manner as possible, and also keep the levels (and quest logic) relatively simple so there aren’t so many ways to screw it up.

Leave a Reply