From 00dacd9193b2cb35869c7b498acfef8d11f89305 Mon Sep 17 00:00:00 2001 From: shweet Date: Sun, 25 Oct 2026 20:53:57 -0400 Subject: [PATCH] notes: side view (room type 16) and Rotgut's crawl space chain --- notes/README.md | 1 + notes/entities/rotgut.md | 27 +++++++++++++ notes/systems/side_view.md | 77 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 105 insertions(+) create mode 100644 notes/systems/side_view.md diff --git a/notes/README.md b/notes/README.md index d8f5904..ef18278 100644 --- a/notes/README.md +++ b/notes/README.md @@ -10,6 +10,7 @@ stored here: `./decompile.sh 0xADDR` prints it from the dump, with the current n | `systems/greed_mode.md` | Greed waves' coins and music, Ultra Greed/coins/doors states, donation machine spawn, Greed doors/button, Mega Satan door | | `systems/alt_path.md` | Repentance's path: secret exit kinds and doors, Level::SetNextStage's routing, the mirror world and mineshaft dimensions, quest doors, the white fire's Lost Curse, minecarts | | `entities/rotgut.md` | Rotgut's maggot (911.1) attacks, its crawl space rooms and what the side view needs | +| `systems/side_view.md` | Room type 16's side view: gravity cells (Room::Init, GridEntity_Gravity, FLAG_APPLY_GRAVITY), the player's 0.225 fall, ladders (decorations 10-30), make_wall's openings, tiles, exits and enter positions, tears/projectiles/pickups/bombs, We Need To Go Deeper's crawl space, Room::Init's random decorations | | `systems/ascent.md` | Repentance's Ascent: pre-ascent (flag 0x2f, the photo door), Dad's Note's drop (the Mausoleum's subtype 89 boss room), its white-out (Game+0x67788) and StageTransition mode 5, Game::SaveBackwardsStage, Level::generate_backwards / place_rooms_backwards, the heaven door, SetNextStage on the Ascent | | `systems/use_dispatch.md` | id -> case of UseActiveItem / UseCard / UsePill from the exe's jump tables (`use_dispatch.tsv`, `find.sh active/card/pill`), the slot-labelled second active switch, the common tail (TemporaryEffect), actives without a case | | `systems/room_features.md` | Room spawns (grid index wrap, trigger outputs 969 / Room::TriggerOutput, held Spawners), pressure plates and the mineshaft rail plate, white and giga poops, Mom's bed, Fissure and its spawner, Mother's Shadow, secret Isaac; why Rotgut's maggot, the Beast, Ultra Horsemen and Dogma wait | diff --git a/notes/entities/rotgut.md b/notes/entities/rotgut.md index 3f21a25..6fd6301 100644 --- a/notes/entities/rotgut.md +++ b/notes/entities/rotgut.md @@ -32,3 +32,30 @@ spaces: spawn entries 0.10 / 0.20 / 0.30 along their ladders (not read). isaac-classic: rotgut_maggot as a scripted boss between the face and the heart in the boss room (the face's death spawns it, its death the heart); the side view (gravity, ladders) is not ported. + +## The crawl space chain (rif/side-view, 2026-10-25) + +- Face death (NpcAI::ENTITY_ROTGUT_face 0x57bec0, its end): health <= 0 -> flags |= 0x11, state 0x10, _dead cleared, + health 0.001, collision 0, invincible, projectileDelay -1, stateFrame -1, renderZOffset -500, sounds 0x70 and 0x1c, + "Transition", a green blood explosion, BloodExplode. State 0x10: "TransitionLoop" once Transition ends; its Shoot + (Transition frame 40) plays 0x133 (growl) and sets projectileDelay 0; then each tick: 1000.151 subtype 0 every 2nd, + subtype 1 every 4th; strength 1, or (pd - 90) / 30 + 1 up to 8 past 90 ticks; every player, active enemy, tear and + projectile: f = 2 / (d^2 1e-4 + 1) (players min(f 1.4, .8) / min(mass, 1); tears f .7), velocity += f * strength * + speedMult * dir / friction. Within 20 (d^2 < 400): tears and projectiles removed, NPCs killed, a player plays + "FallIn", controls off, pitfall state 4, stateFrame 0. stateFrame > 19: enterDoor -1, Level+0x18320 = its position, + 0x57be90 saves the current room at Level+0x18328, StartRoomTransition(-14, -1, 2). +- Level::init_rotgut_dungeon_room (0x74beb0): descriptors -14 / -15 get RoomConfig::GetRandomRoom(stage 0, type 16, + subtype 2 / 3). +- Maggot room exit: rotgut_death_spawn_effects (0x581200) on the maggot's kill spawns three 1000.119 timers with + callback 0x580360 after 1, 6 and 11 ticks at the right wall's grid indices (w + 2) * 7, 6w + 14, 5w + 14 (rows 7, 6, + 5): each removes the wall there for a GridEntity_Gravity, re-PostInits the cells above and below and spawns rock + particles; the right edge then leads to -15 (Room::update_door_transitions). Its child (+0x3c0, the detail) dies. +- Head or butt (state 3): `above` = player not flying and y < maggot.y - 80; 1 in 30 a tick: (!above and rand % 3 < 2) + or a coin flip -> head (rand % 3 + 3), else butt. +- HeadAttack3's volleys (every even projectileCooldown < 30): 3 shots velocity (-10 - 11r, 0) turned 10-25 degrees, + FallingAccel .72, scale ((5..7) - 3) / 3, from ShootPos; then 1 in 6 spawn_small_maggot velocity (-6 - 4r, -4 - 4r), + else 1 in 6 an attack fly (18) at (-10 - 10r, 0) turned 0-30 degrees. +- The heart room (subtype 3) returns on clear after roomClearDelay 20 to Level+0x18328 (Room::Update). + +isaac-classic now: the face's death leaves rotgut_mouth (aura square/ramp/swallow), the maggot and heart are fought in +their crawl spaces (crawlspace1010 / crawlspace1020, side view); see systems/side_view.md. diff --git a/notes/systems/side_view.md b/notes/systems/side_view.md new file mode 100644 index 0000000..ff06e0a --- /dev/null +++ b/notes/systems/side_view.md @@ -0,0 +1,77 @@ +# Side view: crawl spaces and the Beast room (room type 16, Room::is_type_16 0x7ea190) + +Read for isaac-classic's side view (rif/side-view, 2026-10-25). Addresses, not copies; `./decompile.sh 0xADDR`. + +## Gravity cells (Room::Init 0x7f2800, its tail at 0x7f448b..0x7f46bf; GridEntity_Gravity 0x99b520/0x99b980) + +Room::Init, for a type-16 room: every 5.100 collectible (Room entities query 5,100,-1) is moved by (10, 30) +(0xbaa81c 10.0, 0xbaa8d0 30.0); then every grid cell holding no grid entity with gridPath <= 900 gets a +GridEntity_Gravity (grid type 0x13 = GRID_GRAVITY, Isaac::CreateGridEntity). Rooms of any other type instead get the +random floor decorations (0x7f40a0..0x7f4486, skipped for backdrops 0x12, 0x10, 0x23, a backdrop without props, +and stage 1 with flag): count = (r & 3) + r % 5, + r % 9 when the RoomConfig room is wider than 13 xor taller than 7, ++ r % 9 + r % 18 when both (bytes +0x46, +0x47), seeded from the descriptor (+0x58 & 0x7fffffff) + its first field; +2 * count tries, each Room::GetRandomTileIndex (0x81ecc0), kept as GRID_DECORATION variant 0 where no grid entity +stands and gridPath <= 900. + +GridEntity_Gravity::Update: a player whose grid index is its own gets EntityFlag 0x8000 (FLAG_APPLY_GRAVITY); +Entity_Player::Update clears it. PostInit plays Tiles_Itemdungeon "Floor%u" (seed xorshift % 3 + 1), Rotgut's +(backdrop 0x38) Tiles_Rotgut "Floor" at a random frame, Gideon's (0x37) Tiles_Itemdungeon_Gideon, only when the cell +below is a block (3) or a wall (0xf). + +## Player movement (Entity_Player::update_body_animations 0x779b40, the movement/velocity update) + +With FLAG_APPLY_GRAVITY and not _canFly: the joystick's y is zeroed, the turn-toward-input lerp is skipped and, where +other rooms do velocity.y *= friction (0.775 base), velocity.y += 0.225 (no friction on y). Called once per +Entity_Player::Update. NPCAI_Pathfinder::SimulatePlayerMovement (0x7e8010) mirrors it in two half steps. So ladders +are simply cells without a gravity entity (their decoration holds the cell): free top-down movement there. + +## Walls, ladders and exits + +- Room::make_wall (0x7ee7e0), type 16 and subtype not 2/3 (Rotgut's): the top wall's cell (2, 0) becomes a + GRID_DECORATION variant 10 (the ladder out); on a one-screen room (shape 1) the right wall's cells (14, 3) and (14, 4) + become GRID_GRAVITY. make_walls (0x81ee20) skips the Beast room entirely. +- Room spawns of entity type 0 (0.10, 0.20, 0.30) become GRID_DECORATION of that variant (Room::SpawnEntry's default + case); GridEntity_Decoration::BeginBatches (0x99acc0) in type 16 draws them "Ladder1/2/3" (Rotgut: "Ladder" frame + 0/1/2). +- GridEntity_Wall::PostInit (0x721310), type 16: Tiles_Itemdungeon "Brick%d" (rand % 3 + 1) when the cell above is + empty, a decoration or gravity, else "LowBrick%d" (rand % 2 + 1); Rotgut's: "Brick" if above open, else "LowBrick" + if below open, else "MiddleBrick". Blocks (1900) are ordinary GridEntity_Rock (grid_rock.anm2), collision class 4 in + type 16 (GridEntity_Rock::update_collision 0x718f80). +- Entity::PlayerCollideWithGrid (0x6ab440): in type 16 the room-bounds clamp is skipped (walls hold the player); the + Beast room clamps with its +20 y offset instead. +- Room::update_door_transitions (0x7f01c0), type 16: player y < 120 -> StartRoomTransition(Level+0x18328 the saved room, + enterDoor, 2); x > BR.x + 20 -> room -15 from -14 (Rotgut), else -6 (Black Market) when the room config's door mask has + bit 2, else -2; x < 0 or y > BR.y + 20 -> -2. +- Level::GetEnterPosition (0x74a090): -4/-11 from a map room (120, 160), from the Black Market (560, 280), else + (480, 280); -13 (440, 168); -14 (320, 160); -15 (80, 400); back in the dungeon return room after a type-16 room (or + -13, -18), the position saved at Level+0x18320. +- Room::Update (0x802980): a cleared type-16 room of subtype 3 transitions back to Level+0x18328 (roomClearDelay 20); + subtype 2 does nothing (no TriggerClear); others clear as usual. +- Room::LoadBackdropGraphics (0x7f1380), type 16 backdrop by subtype: 1 -> 0x37 (Gideon), 2/3 -> 0x38 (Rotgut), 4 -> + 0x39 (Beast), else 0x1d (29, reserved: nothing drawn); FXLayers cleared. + +## Tears, projectiles, pickups, bombs + +- Entity_Tear::Init (0x6660a0) / Entity_Player::FireTear (0x790af0): posOffset.y -18, height raised to -5.1 at most. + Entity_Tear::Update (0x6670f0): FallingAccel >= 0.001 -> velocity.y += it; else height > -10 -> velocity.y += 0.5; + dies once height >= -5.1 and updateTime > 0.6 range (no special flags); removed outside the room. +- Entity_Projectile::update_height_collision (0x65b500): sprite offset -15, height capped at -5.1 (never lands), + collision classes 4. Entity_Projectile::Update (0x653070): FallingAccel >= 0.001 -> velocity.y += accel * timescale, + else height > -10 -> += 0.5; removed when out of the room (moving outward). +- Entity_Pickup::Update (0x6e3940): unless the point (x, y + size * sizeMulti.y + 0.5) is a wall (collision 4), + velocity.y += 0.9 (Beast room: 0.4 and friction * 0.95). Anchored pickups (collectibles, priced) keep their target. +- Entity_Bomb::Update (0x6a24d0): velocity.y += 0.9 a tick (not variants 19, 20). +- Entity_NPC::Update (0x6c4b30): no general NPC gravity; a dying non-flier in a gravity cell gets its y velocity + halved/zeroed and x set to +-speed (death drop). + +## We Need To Go Deeper (UseActiveItem case 0x54, 0x5b83e0) + +After the dirt patch: not in type 16; the dig spot is moved 70 px (squared 4900, 20 tries) from doors; a trapdoor or +crawl space there already: nothing; on a GRID_DECORATION variant < 31 with the Level state flag unset: a crawl space +(GRID_STAIRS 0x12) and the flag set (once a floor); else, when Level::CanSpawnTrapDoor, a trapdoor (0x11). The grid +there is destroyed first. + +## Pools + +ItemPool::GetPoolForRoom (0x732dc0): its table at ItemPool+0x69c is indexed by room type - 1 off the pools array, so +type 16 -> pool 0 (treasure): a crawl space's item is a treasure room item.