Levels in Brogue often have a treasure room protected by a key somewhere else on the same level. There are usually 4 or 5 bits of treasure on altars in the room protected by cages. When you pick up an item from one altar, the rest of the cages close and you cannot pick a different item until you drop the current item back onto the altar where you picked it up. Of course, some of these rooms have multiple items that would help me greatly!

Is there a way to trick the room into opening all the cages or getting multiple items? I've tried dropping a different item onto an empty altar but that didn't work.

  • If this were possible, it'd be very nice. Especially on those occasions where one of the items on an altar is the key to another room of altars. Lots of really nice items, lost to cages just to open a room with less attractive stuff...
    – Grace Note
    Jan 3 '13 at 21:58

It's not possible.

Looking at the source code, we can see that treasure rooms ("libraries" as they're called internally - you can only check out one item at a time) are implemented using ALTAR_CAGE_OPEN features with the MF_GENERATE_ITEM and ITEM_IS_KEY flags - so, at level generation, each altar generates an item on it that is configured to be a key. (This is in Globals.c, although you'll have to read Rogue.h and Architect.c as well, and possibly drink heavily, to fit it all together.)

So, from this, we know that at generation time, the item on each altar is assigned as its key. Can we fake the key? Unfortunately, no. The key check is implemented in keyMatchesLocation() in Items.c, and reveals that each key is defined by three properties: the keyZ coordinate, the keyX and keyY coordinates, and the machine number.

A key only works when its keyZ matches the current level. keyZ is set (in Architect.c) to the current depth when the key is created, so a key will never work when taken off its home level. Assuming the keyZ matches, a key will work if either of the other two properties match: the keyX and keyY match the current location, or the machine at the current location has an ID that matches the key's machine ID. (The machine ID is generated at map generation time and is unique across the entire game.)

While it is in principle possible for multiple "keys" to exist for the same altar - you just need two key items with the same keyZ and machine ID - there's nothing in game that would cause this to happen. Similarly, there's no way to wedge a cage open (it has the DFF_EVACUATE_CREATURES_FIRST flag, so anything in the way gets pushed off it as it closes). It is possible that some sort of area effect that pushes items could be used to knock multiple items off their altars simultaneously, but Brogue has no such effects.

So, no, short of editing your save file to create a fake key item, it can't be done.


There is one class of item you can "trick," though. Wands count as "returned" even if they're empty of charges. So you can use a wand of empowerment on an ally and then return it for a different item.

  • Hi, and welcome to Arqade! This is a nice piece of info, but it feels more supplementary. Typically, these little tidbits are left as "comments" on other answers or questions. When you earn enough rep, please do that in the future.
    – two bugs
    Mar 1 '16 at 15:42
  • Nah, it's niche, but a good answer
    – Atav32
    Oct 8 at 18:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.