Files
isaac-port/notes/systems/room_features.md
T

127 lines
9.4 KiB
Markdown

# Room features (rooms_pending pass, 2026-10-24)
Room-file content the isaac-classic room port (tools/rebirth_rooms.py) had left out, read from the exe.
## room spawns (Room::SpawnEntry 0x7ed310)
- A spawn's grid index is `(x + 1) + (y + 1) * gridWidth` (src/rooms README), so a cell past the right wall wraps onto
the next row (Burning Basement 526's fire at (16,3) lands on (1,4)).
- A grid spawn on a cell that already holds a grid entity (a wall) is skipped (`if (room->grid[idx]) goto skip`):
pits the editor left in an L room's notch corner are never made.
- 3000 and 3002 (button rail) are plain pits; 3009 a pit of variant 0x80 (event pit); 3001 (fissure spawner) a pit plus
an effect 1000.192 (Fissure Spawner) spawned on its cell with the spawn's subtype.
- 969 (ENTITY_TRIGGER_OUTPUT): `FUN_00822d20` x4 registers the cells on its four sides (x +- 1, y +- 1; never its
corners) in the room's output set [variant] (variant < 10, sets at room+0x7328). `FUN_00822d60` (after spawning)
turns each entity standing on an output cell (NPCs, bombs, pickups without 0x534) into a Spawner effect 1000.120
holding it (`FUN_00822fd0`: 0x420/0x424 its variant/subtype, 0x450 the output group).
- 6000 (rail): records its variant at room+0x746c[idx]; 6001 (rail pit) the same plus a pit.
## trigger outputs (Room::TriggerOutput 0x823080, misnamed Room::ClearGreedWaveSpawns)
For output group n: each grid entity on its cells reacts (`FUN_00823150`): TNT (0xc, state < 4) explodes, a pressure
plate (0x14) plays Switched, an event rock (2, varData != 0, state 1) breaks, an event pit (7, varData != 0) fills
(smoke 1000.15, sound 0x89, state 2), a teleporter (0x17) toggles TurnOn/TurnOff. Then every Spawner 1000.120 of group
n releases its entity, then group n's callbacks run. Event rocks chain to the next event rock through their varData
countdown (>10 counts down, at 10 breaks itself; GridEntity_Rock::Update 0x718fe0).
## pressure plates (GridEntity_PressurePlate::Update 0x983330, press 0x9833c0, Reward 0x984550)
- Press (0x9833c0): a player (not a hologram) or, outside co-op, entity 0x36d/0x35 within sqrt(900) = 30 of the cell
centre presses it (state 0 -> 3, "Switched"), then Reward. A trap plate (variant 0) unpressed sets room+0x11ec = 10
every tick (the "armed plates" countdown other code reads as `> 8`).
- Reward by variant: 1 reward roll, 2 greed button (update_greed_button), 3 rail plate (0x74eaf0), 9 kill plate
(sounds 0x10b, 0x21, shake 15, a timer), 10-13 Room::TriggerOutput(variant - 10).
## rail plate: Level 0x74eaf0 (raise a mineshaft rail)
Only when Level::HasAbandonedMineshaft (0x74efd0: not Greed, not the backwards path, Mines/Ashpit (stage type 4/5) II, or
I with Curse of the Labyrinth). Walks the level's normal rooms: the first of subtype 10 (the mineshaft entrance, its
3002 button rails) gives the list of its 3002 spawns' grid indices (spawn order); the current room's index among the
rooms of subtype 10 or 1 (the plate rooms) picks list[that index]. In the entrance room itself the pit there becomes
a rail pit at once (state 2, variant |= 0x100, room+0x746c[idx] = 1, shake 20, sound 0x254 RAILROAD_TRACK_RAISE);
otherwise the entrance room's saved grid entry is rewritten (type 7, variant 0x100, state 2) and sound 0x255 (_FAR) pans
toward it. When every button rail is raised, jingle 0x55. The entrance room holds 3 button rails and a plate; each
level has two subtype-1 plate rooms besides it.
## poops (GridEntity_Poop::Update 0x714770, Hurt 0x715330, drops 0x7178c0 misnamed MenuManager::Render)
- Damage a hit: `250 * (damage (+1 one in 3, +1 more one in 3 for variant 0))`, a golden poop 50-124, white (6) 125,
the giga poop's hit holder (9) 20; 1000 breaks it, its frame State(hp / 250 + 1).
- White poop (6): while unbroken, a player within his size + 70 gets 0x1d90 = min(prev + 4, 4) (the holy aura;
EvaluateItems when it turns on).
- Giga poop: four poop grid entities, variants 7, 8, 9, 10 at tiles (0,0), (1,0), (0,1), (1,1) of the 1499 spawn
(table 0xb690f0); `FUN_00718ac0(variant)` finds a part; 9 holds the hits (the others forward Hurt to it) and draws
grid_poop_giant.anm2 at the 2x2's centre (offset table 0xc5d004: +20, -20 for 9); a part missing turns the rest into
plain poops. Its drops: none of the poop drop table (only variants 0/2/3/6 roll).
## pickups 5.380 (Entity_Pickup::HandleCollision 0x6e8ae0)
A bed (Isaac's, subtype 0) sleeps only while some player is hurt or has no hearts; Mom's Bed (subtype 10) always
(revive_player_ghosts, ItemOverlay 0x21 sleep, which refills hearts; at Home (stage 13, type 0) ItemOverlay 0x2c
instead). Entity_Pickup::Init gives 0x172/0x154 and 380.10 flag 0x200000.
## Fissure (NpcAI::ENTITY_FISSURE 0x564f30, type 815)
- Init: V1 = (-6, 10): rise -6, height 10 (PositionOffset.Y), state 6, "Idle".
- Each tick: friction *= 0.9; its push (TargetPosition, or a random launch at 4 and (0.8/sqrt2, 0.8/sqrt2) when none)
takes each axis's sign from its velocity and is added / friction (Boom-Fly-like bounce, terminal 10 x push);
feared (flags 0x1000800) it also flees a player within 120 ((120 - d) * 0.02).
- Height: rise += 0.36 (0.18 once sinking, grid collision class 7), height += rise. Falling past -6: over a pit
(GetGridCollisionAtPos == 1) it sinks (rock particles), gone (Remove) past 30; else under 180 frames old it bounces
(rise -5, height -6, rock particles, sound 0x102 SPLATTER), else it dies (Kill).
- It keeps a 20-point trail (velocity.x, height) for Entity_NPC::Render's tail. Two Fissures meeting bounce off each
other elastically (Entity_NPC::HandleCollision 0x6cd410, asm 0x6ce23a).
## Fissure Spawner (effect 1000.192, Entity_Effect::Update case at 0x5e5ace, asm only)
- period = 150 / (((subtype >> 8) & 15) + 1).
- Every 10 frames (Entity::GetIntervalTicks) a water ripple 1000.133 (0x85) on it.
- Room::GetFrameCount <= 1, or alive enemies > 0, or (Room::HasTriggerPressurePlates and room+0x11ec > 8): it spawns;
otherwise it removes itself.
- Each frame counter 0x450 += 1; at period: counter 0, angle (subtype & 15) * 360 / 16, speed
((subtype >> 4) & 15) * 0.1 + 0.1; Spawn(815) at its position with velocity FromAngle(angle) * speed * 3,
AddEntityFlags(0x400), ClearEntityFlags(4), SetTargetPosition(FromAngle(angle) * speed).
## carpets, dirt patch
1000.74 Isaac's carpet (subtype 1 Mom's, 2 the living room's) and 1000.116 dirt patch (the Grave Rooms) are floor art;
the dirt patch's DugUp/DugUpBones are played in Entity_Effect::Update (asm, strings at 0x605075/0x605098), not read.
## Mother's Shadow (NpcAI::ENTITY_MOTHERS_SHADOW 0x56ffa0, type 867)
- State 0: invincible, persistent (EntityList::AddPersistentEntity: it follows Isaac between rooms), invisible, state
16 at its spawn point. Spawned by code (no grid index): chase at once (state 3, I1 60). Placed (the Knife Piece room,
mines subtype 20): it remembers the room's collectible pedestal (5.100).
- State 16: once that pedestal is gone or empty: music crossfade 0x42 (once), then, no player holding an item up
(0x17c4), state 2 with ProjectileDelay 30.
- State 2: the delay out, "Appear", visible, every fire place (type 33) gets 0x173 (removed) ... and on Appear's Shoot
every fire place is Morph(33, 1) (red fire places) in state 9, sound 0x2ca. Appear done: "Idle", state 3, I1 60,
level state flag 0x400000 (STATE_MINESHAFT_ESCAPE), and each of the level's normal rooms of subtype 30 swaps its
RoomConfig for variant + 1 (the subtype 31 escape layouts), its saved state wiped.
- State 3 (chase): friction *= 0.8 twice; farther than 80 from its player target it accelerates toward
CalcTargetPosition at 6 * clamp(distance / 600, 0, 1) / friction; I1 counts down; I1 out and within 200: "Attack",
state 8 (its target kept, TargetPosition zero).
- State 8: frame 0 sound 715 (MOTHERSHADOW_CHARGE_UP); before Shoot it drifts toward the point 180 from Isaac on their
line (0.01 a tick / friction), past frame 14 it locks TargetPosition = the unit way to Isaac; Shoot -> ShootEnd:
sound 716 (DASH) on Shoot, velocity += TargetPosition * 6 a tick, dust clouds (1000.59) from its null; ShootEnd
done: "Idle", state 3, I1 90.
- With 0xb74 == 1 (the persistent copy in a room it followed into): collision only after the room's 44th frame; every
tick shake 4 and, one in 3, a rock particle (1000.4) falling from 200-280 up at a random spot; back in dimension 0
(out of the mineshaft): state 5 (sounds 0x2cd, 0x242), invisible, and in the entrance room (subtype 10) the doors are
barred; state 5 removes it after 29 frames, shaking 14.
- The mineshaft entrance (subtype 10) is placed as a new end room only when a player owns Knife Piece 1 (0x272),
Level 0x739370 (RoomConfig::GetRandomRoomWithFallbackStage(..., subtype 10, ...)).
## secret Isaac (slot 6.14, Entity_Slot::Update 0x65d950, HandleCollision 0x6627e0)
Touched (no cost: case 0xe) it plays PayPrize: FX spawns a tear poof (1000.12.10) following it, Poof a smoke 1000.15;
the prize done, it removes itself and PlayerManager::unlock_completion_mark(0xf) (the tainted unlock).
## not ported (why)
- Rotgut's maggot (911.1): NpcAI::ENTITY_ROTGUT 0x581730 plays the crawl space phases side-view (Heartbeat* for the
heart, MoveHori/ComeDown for the maggot; maggots let in from the side walls at Isaac's height, x = room left - 80 or
right + 80): needs side-view crawl spaces.
- The Beast (951.0, NpcAI::ENTITY_BEAST 0x596120, 2.8 KB dispatching its parts) and the Ultra Horsemen (951.10-40):
the side-scrolling Home arena; Dogma (950, NpcAI::ENTITY_DOGMA 0x4aafa0, 13.5 KB).