Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- I wrote a mod to count the number of rooms on a floor, and then restart the game, and continue doing that for 10,000 iterations. This allows us to see the average number of rooms per floor and if the different kinds of stages have any effect.
- Results:
- - The average number of rooms on floor 1 is 9.5. The stage type makes no difference.
- - The average number of rooms on Basement 2, Cellar 2, and Burning Basement 2 is 12.6.
- - The average number of rooms on Downpour 2 and Dross 2 is 12.7. This is probably due to the floor generation algorithm having to place the mirror room.
- - The average number of rooms on floor 3 is 15.7. The stage type makes no difference.
- Conclusions:
- - On Basement 1 / Cellar 1 / Burning Basement 1, you might want to spend an extra key to go to Downpour 1 / Dross 1. In return, the floor will have 3 less rooms on average, but the enemies will be harder to dodge and the boss will be harder.
- - On Basement 2 / Cellar 2 / Burning Basement 2, you probably will want to spend an key to go to Downpour 2 / Dross 2. In return, the floor will have 3 less rooms on average, but the enemies will be harder to dodge and the boss will be harder (on average).
- - Another factor to consider is that the alt paths have two items in the Treasure Room, but this is most irrelevant as:
- - 1) You may not find the Treasure Room while on the way to the boss.
- - 2) You may not have a key to open the Treasure Room (especially since you just used one to enter the alt floor).
- - 3) The average expected value of the Treasure Room is extremely low.
- Full data is below.
- Floor 1 - Basement 1:
- Total floors: 10000
- Total rooms: 95094
- Average: 9.51
- Room count of 8: 1547 (15.47%)
- Room count of 9: 4111 (41.11%)
- Room count of 10: 2602 (26.02%)
- Room count of 11: 1236 (12.36%)
- Room count of 12: 450 (4.5%)
- Room count of 13: 53 (0.53%)
- Room count of 14: 1 (0.01%)
- Floor 1 - Cellar 1:
- Total floors: 10000
- Total rooms: 95050
- Average: 9.51
- Room count of 8: 1490 (14.9%)
- Room count of 9: 4180 (41.8%)
- Room count of 10: 2628 (26.28%)
- Room count of 11: 1256 (12.56%)
- Room count of 12: 384 (3.84%)
- Room count of 13: 62 (0.62%)
- Floor 1 - Burning Basement 1:
- Total floors: 10000
- Total rooms: 95054
- Average: 9.51
- Room count of 8: 1474 (14.74%)
- Room count of 9: 4182 (41.82%)
- Room count of 10: 2660 (26.6%)
- Room count of 11: 1244 (12.44%)
- Room count of 12: 380 (3.8%)
- Room count of 13: 60 (0.6%)
- Floor 1 - Downpour 1:
- Total floors: 10000
- Total rooms: 94928
- Average: 9.49
- Room count of 8: 1534 (15.34%)
- Room count of 9: 4126 (41.26%)
- Room count of 10: 2709 (27.09%)
- Room count of 11: 1192 (11.92%)
- Room count of 12: 388 (3.88%)
- Room count of 13: 50 (0.5%)
- Room count of 14: 1 (0.01%)
- Floor 1 - Dross 1:
- Total floors: 10000
- Total rooms: 95050
- Average: 9.51
- Room count of 8: 1494 (14.94%)
- Room count of 9: 4131 (41.31%)
- Room count of 10: 2711 (27.11%)
- Room count of 11: 1228 (12.28%)
- Room count of 12: 368 (3.68%)
- Room count of 13: 67 (0.67%)
- Room count of 14: 1 (0.01%)
- Floor 2 - Basement 2:
- Total floors: 10000
- Total rooms: 126118
- Average: 12.61
- Room count of 11: 1680 (16.8%)
- Room count of 12: 3746 (37.46%)
- Room count of 13: 2332 (23.32%)
- Room count of 14: 1464 (14.64%)
- Room count of 15: 599 (5.99%)
- Room count of 16: 154 (1.54%)
- Room count of 17: 25 (0.25%)
- Floor 2 - Cellar 2:
- Total floors: 10000
- Total rooms: 125983
- Average: 12.6
- Room count of 11: 1643 (16.43%)
- Room count of 12: 3799 (37.99%)
- Room count of 13: 2432 (24.32%)
- Room count of 14: 1366 (13.66%)
- Room count of 15: 593 (5.93%)
- Room count of 16: 152 (1.52%)
- Room count of 17: 15 (0.15%)
- Floor 2 - Burning Basement 2:
- Total floors: 10000
- Total rooms: 126076
- Average: 12.61
- Room count of 11: 1629 (16.29%)
- Room count of 12: 3781 (37.81%)
- Room count of 13: 2443 (24.43%)
- Room count of 14: 1361 (13.61%)
- Room count of 15: 619 (6.19%)
- Room count of 16: 152 (1.52%)
- Room count of 17: 15 (0.15%)
- Floor 2 - Downpour 2:
- Total floors: 10000
- Total rooms: 127085
- Average: 12.71
- Room count of 9: 2 (0.02%)
- Room count of 10: 142 (1.42%)
- Room count of 11: 1019 (10.19%)
- Room count of 12: 2574 (25.74%)
- Room count of 13: 4195 (41.95%)
- Room count of 14: 2008 (20.08%)
- Room count of 15: 57 (0.57%)
- Room count of 16: 3 (0.03%)
- Floor 2 - Dross 2:
- Total floors: 10000
- Total rooms: 127116
- Average: 12.71
- Room count of 9: 2 (0.02%)
- Room count of 10: 144 (1.44%)
- Room count of 11: 1009 (10.09%)
- Room count of 12: 2545 (25.45%)
- Room count of 13: 4249 (42.49%)
- Room count of 14: 1985 (19.85%)
- Room count of 15: 64 (0.64%)
- Room count of 16: 2 (0.02%)
- Floor 3 - Caves 1:
- Total floors: 10000
- Total rooms: 156895
- Average: 15.69
- Room count of 15: 4093 (40.93%)
- Room count of 16: 5246 (52.46%)
- Room count of 17: 415 (4.15%)
- Room count of 18: 188 (1.88%)
- Room count of 19: 37 (0.37%)
- Room count of 20: 19 (0.19%)
- Room count of 21: 2 (0.02%)
- Floor 3 - Catacombs 1:
- Total floors: 10000
- Total rooms: 156851
- Average: 15.69
- Room count of 15: 4083 (40.83%)
- Room count of 16: 5291 (52.91%)
- Room count of 17: 385 (3.85%)
- Room count of 18: 182 (1.82%)
- Room count of 19: 52 (0.52%)
- Room count of 20: 6 (0.06%)
- Room count of 21: 1 (0.01%)
- Floor 3 - Flooded Caves 1:
- Total floors: 10000
- Total rooms: 156836
- Average: 15.68
- Room count of 15: 4102 (41.02%)
- Room count of 16: 5280 (52.8%)
- Room count of 17: 377 (3.77%)
- Room count of 18: 178 (1.78%)
- Room count of 19: 49 (0.49%)
- Room count of 20: 12 (0.12%)
- Room count of 21: 2 (0.02%)
- Floor 3 - Mines 1:
- Total floors: 10000
- Total rooms: 156869
- Average: 15.69
- Room count of 15: 4047 (40.47%)
- Room count of 16: 5328 (53.28%)
- Room count of 17: 404 (4.04%)
- Room count of 18: 160 (1.6%)
- Room count of 19: 52 (0.52%)
- Room count of 20: 9 (0.09%)
- Floor 3 - Ashpit 1:
- Total floors: 10000
- Total rooms: 156806
- Average: 15.68
- Room count of 15: 4046 (40.46%)
- Room count of 16: 5368 (53.68%)
- Room count of 17: 390 (3.9%)
- Room count of 18: 137 (1.37%)
- Room count of 19: 48 (0.48%)
- Room count of 20: 11 (0.11%)
- Floor 3 - Caves 1 (Hard Mode):
- Total floors: 10000
- Total rooms: 180384
- Average: 18.04
- Room count of 17: 2353 (23.53%)
- Room count of 18: 5021 (50.21%)
- Room count of 19: 2546 (25.46%)
- Room count of 20: 57 (0.57%)
- Room count of 21: 16 (0.16%)
- Room count of 22: 6 (0.06%)
- Room count of 23: 1 (0.01%)
- Here's a copy of the mod used:
- -- Constants
- local MOD_NAME = "floor-average-finder"
- --local WARP_COMMAND = "stage 2b"
- local STAGE = 1
- local STAGE_TYPE = 0
- local MAX_ROOM_INDEX = 168
- local mod = RegisterMod(MOD_NAME, 1)
- local game = Game()
- local sfx = SFXManager()
- local totalFloors = 0
- local totalRooms = 0
- local roomMap = {}
- local isEnabled = true
- -- From: http://lua-users.org/wiki/SimpleRound
- local function round(num, numDecimalPlaces)
- return tonumber(string.format("%." .. (numDecimalPlaces or 0) .. "f", num))
- end
- -- From: https://stackoverflow.com/questions/33510736
- local function hasValue(t, val)
- for index, value in ipairs(t) do
- if value == val then
- return true
- end
- end
- return false
- end
- function mod:postRender(player)
- if isEnabled then
- Isaac.ExecuteCommand("restart")
- end
- end
- function mod:postNewLevel(player)
- local level = game:GetLevel()
- local stage = level:GetStage()
- local stageType = level:GetStageType()
- if stage ~= STAGE or stageType ~= STAGE_TYPE then
- return
- end
- totalFloors = totalFloors + 1
- -- getNumRooms
- local roomSafeIndexes = {}
- for i = 0, MAX_ROOM_INDEX do
- local room = level:GetRoomByIdx(i)
- if room ~= nil then
- local data = room.Data
- if data ~= nil then
- if (
- data.Type ~= RoomType.ROOM_SECRET
- and data.Type ~= RoomType.ROOM_SUPERSECRET
- and data.Type ~= RoomType.ROOM_ULTRASECRET
- and not hasValue(roomSafeIndexes, room.SafeGridIndex)
- ) then
- roomSafeIndexes[#roomSafeIndexes + 1] = room.SafeGridIndex
- end
- end
- end
- end
- local numRooms = #roomSafeIndexes
- totalRooms = totalRooms + numRooms
- if roomMap[numRooms] == nil then
- roomMap[numRooms] = 0
- end
- roomMap[numRooms] = roomMap[numRooms] + 1
- Isaac.DebugString("Total floors: " .. tostring(totalFloors))
- Isaac.DebugString("Total rooms: " .. tostring(totalRooms))
- local average = round(totalRooms / totalFloors, 2)
- Isaac.DebugString("Average: " .. tostring(average))
- local sortedKeys = {}
- for k, v in pairs(roomMap) do
- sortedKeys[#sortedKeys + 1] = k
- end
- table.sort(sortedKeys)
- for _, sortedKey in ipairs(sortedKeys) do
- local roomCount = roomMap[sortedKey]
- local averagePercent = round((roomCount / totalFloors) * 100, 2)
- Isaac.DebugString(
- "Room count of " .. tostring(sortedKey) .. ": " .. tostring(roomCount)
- .. " (" .. averagePercent .. "%)"
- )
- end
- if totalFloors >= 10000 then
- isEnabled = false
- sfx:Play(SoundEffect.SOUND_ANGEL_BEAM)
- end
- end
- function mod:postGameStarted()
- local seeds = game:GetSeeds()
- if seeds:HasSeedEffect(SeedEffect.SEED_PREVENT_ALL_CURSES) then
- --Isaac.ExecuteCommand(WARP_COMMAND)
- else
- Isaac.DebugString("ERROR: Turn on BLCK CNDL Easter Egg.")
- end
- end
- mod:AddCallback(ModCallbacks.MC_POST_RENDER, mod.postRender)
- mod:AddCallback(ModCallbacks.MC_POST_NEW_LEVEL, mod.postNewLevel)
- mod:AddCallback(ModCallbacks.MC_POST_GAME_STARTED, mod.postGameStarted)
- Isaac.DebugString(MOD_NAME .. " initialized.")
Advertisement
Add Comment
Please, Sign In to add comment