A Continuation of PR #750 - Custom Stage Generation - #921
Open
Devilcasters wants to merge 8 commits into
Open
Devilcasters wants to merge 8 commits into
Devilcasters wants to merge 8 commits into
Conversation
ConnorForan
requested changes
Aug 30, 2026
ConnorForan
reviewed
Aug 31, 2026
…, auto-initialize off-grid rooms
…n failures to console errors, complete GameStateFlag enum
Devilcasters
force-pushed
the
custom-stage-generation
branch
from
September 1, 2026 02:44
0221dcb to
91517e4
Compare
…tion # Conflicts: # repentogon/resources/scripts/main_ex.lua
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A continuation and expansion of the custom dungeon generator system from PR #750 by @thicco-catto, adding crash guards, full Greed Mode support, automatic off-grid room handling, additional Lua APIs and Lua examples
Additions
Greed Mode Support
generator:SetGreedGoldRoom(room / gridIdx)for registering the Golden Treasure RoomHigh Lua Abstraction
PlaceRandomRoom()with defaults for the current stage, standard room type, and auto-doorsgridIdx) and 2D (col, row) overloads forPlaceRoom()andPlaceRandomRoom()Fixes and Crash Guards
Start Room Crash Guard
ValidateFloor()now automatically places a default starting room if Grid 84 is unassigned, preventing crashes and allowing modders to omit the starting room unless they want to customize itPlaceRoom False Failure Fix
Fixed false placement failures in
PlaceRoom()by verifying internal room list growth rather than relying on the native return valueThe Void and Null-Safety Crash Fix
Added null checks when resolving room configs in
PlaceRoom(),TryPlaceRoom(), andPlaceOffGridRoom(), fixed an unguarded off-grid descriptor dereference inPlaceRoomsInFloor(), and removedThe VoidbanDoor Reciprocity
Added validation to prevent invalid doors from being generated
Stage Lookup and Logging
Added a fallback to current stage inGetRoomConfig()when the requested stage does not contain a matching room configurationRemoved the fallback to the current stage when no matching room configuration is found and added detailed validation logging showing the
Stage,Type,ShapeandDoorsthat caused a room configuration lookup to failThe old fallback could make modders think their generation was accepted when it had actually failed validation and silently fallen back to another stage
Callback Handling
Fixed
MC_PRE_GENERATE_DUNGEONhandling inmain_ex.luaso multiple mods can listen to the callback without triggering premature validation or generator resetsConstructor Parameter Order
Corrected the
(col, row)parameter order inDungeonGeneratorRoomconstructorsConsiderations
Ascent vanilla generation can be intercepted, but I couldn't get the starting room to use the correct layout or get the Lightbeam to spawnAdjacent rooms will always generate connecting doors, so revisitingPlaceRoom()may be worth considering in the future for more control over stage buildingLua Samples
Bossless Single Room
8 Boss Rooms
L-Rooms
Maze
Distant Islands
Planetarium Dynamic Placement
Mega Satan Anywhere
Knife Puzzle 1
Knife Puzzle 2
Mausoleum Flesh Door
Corpse Mother Exit and Fight
Chest / Dark Room Mega Satan
Singular The Void Boss Room
The Ascent
Red Redemption
Greed Mode