The City of Gold's door anywhere
Verified against the spelunky.ai port v0.1.12 on .
The City of Gold's door anywhere is a quirk of Spelunky Classic in which level 14's door to the City of Gold can be sealed in rock, or stand on Kali's altar.
Level 14 always has the City of Gold's door, and the roll that places it asks for one thing of the block under it: open space above. It doesn't ask whether the player can reach that space, so the door can be sealed in rock that has to be broken open, and it doesn't skip Kali's altar, so the door can stand on one, and make that half of the altar as hard to break as the door's block always is.
What happens
#Level 14 loads with the gold door on the left half of Kali's altar, at the top of the level. The player walks over and stands on the altar's other half, beside the door [1].
Why
#scrEntityGen goes over the Temple's blocks one by one, and on level 14, until the door is made, each
block outside a shop with open space above it, but for the top few rows, takes the door's roll:
if (y > 32 and not collision_point(x, y-16, oSolid, 0, 0) and global.genGoldEntrance and not global.madeGoldEntrance)
{
if (rand(1,global.goldChance) == 1)
{
instance_create(x, y-16, oGoldDoor);
invincible = true;
global.madeGoldEntrance = true;
}
else global.goldChance -= 1;
}scripts/scrEntityGen.gml:400-409, from spelunky.gmk, Spelunky Classic 1.1's source, © 2008, 2009 Derek Yu and Mossmouth, LLC (Spelunky User License v1.1b).goldChance starts each game at 160 [2], and if no block wins, the
door goes on the first block with open space above it [3]. Either
way, one free tile is all the door needs: the space above the block can be a pocket in the rock, with no way into
it. The Spear Traps' roll, the else beside it, skips trees and the altar (type != "Altar")
[4]; the door's doesn't, and the block under it, an altar half
included, gets invincible = true, which explosions and the Mattock spare
[5] [6]. But the other half's destroy event destroys every
altar half, with oSacAltarLeft, which takes in its child, the right half
[7], and the door's half still crumbles when the floor under it
goes, once it's within the view [8] [9].
Reproducing it
#Reach level 14 and look for the door. Most levels have it in the open; some seal it in a pocket of rock, which
a bomb or the Mattock opens from above or beside. Waiting at level 13's exit before taking it rerolls level 14, and a sweep of
3,757 level 14s rerolled that way put the door on the altar in 15, 1 in 77 of the 1,156 with an altar
[9]. The replay of the clip rerolls level 14 with seed 1: the door stands on the altar's left
half, which is invincible, and the player stands on the right half beside it
[10]. With seed 9 another level 14 puts the
door in a 20-tile pocket under the floor of the room above, and the run blows its way in with two bombs and
carries the Sceptre into the door, which opens
[11]. Reaching the City of Gold walks the rest of
the way in.
In the port
#The spelunky.ai port reproduces it exactly: it's in docs/quirks.md's list of the 1.1 source's bugs
[9], and the oracle's fingerprints of the replays pin the door's place, the altar's invincible
and the sealed door's pocket. No option turns it off.
FAQ
#- Why can't I find the gold door on level 14?
It can be sealed in rock. The roll that places it only asks for a block with open space above it, anywhere in the level, so the door can stand in a pocket that no way leads into, which a Bomb or the Mattock has to break open.
- Can the gold door stand on Kali's altar?
Yes, on about one level 14 in 77 that has an altar. The Spear Traps' roll beside the door's skips the altar, but the door's doesn't, so either half of Kali's altar can be the block under it.
- Can the altar under the gold door be destroyed?
The half under the door survives explosions and the Mattock, as every block under the door does. But the other half's destruction still takes both, and the door's half still crumbles when the floor under it goes.
See also
#References
#- Clip quirks/gold-door-on-altar
scripts/scrClearGlobals.gml:80scripts/scrEntityGen.gml:482-495scripts/scrEntityGen.gml:410-418objects/oExplosion/collision_oSolid.gml:14objects/oMattockHit/other_animation_end.gml:1-22objects/oSacAltarLeft/destroy.gml:62-66objects/oSacAltarLeft/step.gml:1-5- Quirk 1 (docs/quirks.md)
- Replay
fidelity/replays/temple-seed-1-gold-door-on-altar.txt - Replay
fidelity/replays/city-of-gold-seed-9-sealed-door.txt