Binding of Isaac Dungeon Generation Issues

So I've just started work on an isaac style proc-gen map, akin to alot of roguelites you see nowadays.
At the moment, it works with every room calculating their grid number by dividing their position + width/2 by 100 (the grid size). The rooms are 100 pxls wide so a room with posX/posY of 50 should have a grid number of 1,1. They then change the corresponding row + column value of my RoomMap table to 1. Its somewhat frustrating because the row numbers go down (instead of up like a graph). This means that every room knows where every other one is to prevent rooms from spawning twice in the same grid area.

For the random generation, the room changes an attribute to random (1,4), with 1 being up and 4 being left (clockwise). I have 4 rules set up for each direction, saying that if the corresponding grid area where the room would be spawned is 0, spawn the room - otherwise change attribute again to random (1,4).
The issue is that the room, as far as I know, doesn't change its number via the otherwise section and at the very least doesn't spawn another room if the first direction was taken up by a room. If it rolls a 3(down) but there's a room below it, the rooms direction number often stays the same and doesn't attempt to spawn a room or change number basically.

I'm guessing this is an issue with the game logic that I'm using? I thought that perhaps this is something that I need a loop for, but I've heard that you need 'nested loops' (that GS doesn't have) where the random number gen is the outer loop and the inner loop checks for taken rooms and spawns them if empty. Regardless, does anyone have an idea what is going wrong here - could I use looping to get the game to constantly change numbers until it finds something - or is there a better idea for a system of procedural generation in a binding of isaac style?

Cheers.

Comments

  • pHghostpHghost London, UKMember Posts: 2,342

    Procedural generation is certainly possible in GS.

    I'm not 100% sure I understand the details of your issue? Could you send a screenshot of the code that is misbehaving, wit a description of what you expect it to do and what it in fact does?

Sign In or Register to comment.