# [How?] Random dungeon generator (like Binding of Isaac)

• 04-13-2013, 04:55 PM
totalspelnerd
[How?] Random dungeon generator (like Binding of Isaac)
I'm programming a game like Binding of Isaac and right now I'm stuck at creating a random dungeon generator. I've looked through Google pretty much all day and I just can't find anything that could work like I want to. I've tried the A* path finding alg but I didn't like the results. Right now I barely have any code for the generator, just an ID array that contains Zeros. If it is by any help I want the spawn room to be a 2 in my array, the dungeon halls to be 1 and boss room to be 3. The array is 11 in width and 7 in height right now.

Thanks for spending time on me :D
• 04-28-2013, 12:22 PM
totalspelnerd
Re: [How?] Random dungeon generator (like Binding of Isaac)
I've fixed this now. Can't edit my post for some reason though.
• 04-30-2013, 07:01 AM
kjkrum
Re: [How?] Random dungeon generator (like Binding of Isaac)
If you tell us how you solved it, it might help someone who finds your question in a search.
• 05-04-2013, 03:39 PM
totalspelnerd
Re: [How?] Random dungeon generator (like Binding of Isaac)
sorry didn't see the comment. Here is the code explained:

Code:

//generate a random spawn position
int x = rand.nextInt(width);
int y = rand.nextInt(height);
ID[x + y * width] = 2;

//generating rooms
for (int i = 0; i < 14; i++) {
boolean done = false;
while (!done) {

//this is a method that generates two random positions and put them into a Point.
Point p = generateNewRoom();

//Here I check if the room at the given point is occupied.
//if it is it won't continue and restart the while loop
if (getRoomAt(p.x, p.y) == 0) {

/*
getRoomsBeside(x,y) returns the amount of rooms there is beside the given point.
doesn't check diagonal. since I don't want room with 4 adjacent rooms it doesn't
continue if the method returns 3 or over. Same if there is no room beside.
*/
if (getRoomsBeside(p.x, p.y) < 3 && getRoomsBeside(p.x, p.y) > 0) {
ID[p.x + p.y * width] = 1;
done = true;
}
}
}
}

If you need more explanation just ask :D
• 06-10-2013, 06:43 PM
Re: [How?] Random dungeon generator (like Binding of Isaac)
This would be very useful for my game in the future, so some explanation would be nice. Thank you!
Please PM/message me when you have!
• 05-02-2014, 02:25 PM
Re: [How?] Random dungeon generator (like Binding of Isaac)
Quote:

Originally Posted by totalspelnerd
I'm programming a game like Binding of Isaac and right now I'm stuck at creating a random dungeon generator. I've looked through Google pretty much all day and I just can't find anything that could work like I want to. I've tried the A* path finding alg but I didn't like the results. Right now I barely have any code for the generator, just an ID array that contains Zeros. If it is by any help I want the spawn room to be a 2 in my array, the dungeon halls to be 1 and boss room to be 3. The array is 11 in width and 7 in height right now.

Thanks for spending time on me :D

PLEASE SIR, I BEG YOU! PLEASE DO A TUTORIAL FOR HOW TO CREATE A GAME LIKE BINDING OF ISAAC . Please ... i really want to create a game like binding of isaac, except, you know... other sprites,textures, etc..please contact me or post here a tutorial or anything :(.Im new to Java btw.

• 07-10-2014, 07:50 AM
ruben381
Re: [How?] Random dungeon generator (like Binding of Isaac)
Quote:

PLEASE SIR, I BEG YOU! PLEASE DO A TUTORIAL FOR HOW TO CREATE A GAME LIKE BINDING OF ISAAC . Please ... i really want to create a game like binding of isaac, except, you know... other sprites,textures, etc..please contact me or post here a tutorial or anything :(.Im new to Java btw.

Depending on how new you are, I would really recommend spending some time getting familiar with Java before jumping into a project like that, 'cause from what you said it sounds like you'd need a lot of handholding at this point (which is OK!) but that's no fun and it won't be as good a product. No one's going to be able to give you a step by step guide on how to make your OWN game. Email me at pankakeshannon@gmail.com if you really want to go ahead with this and feel like you're capable, and I might be able to help you with little things here and there when I get time.

Have a good day.
• 07-10-2014, 08:57 AM
Re: [How?] Random dungeon generator (like Binding of Isaac)
Quote:

Originally Posted by ruben381
Depending on how new you are, I would really recommend spending some time getting familiar with Java before jumping into a project like that, 'cause from what you said it sounds like you'd need a lot of handholding at this point (which is OK!) but that's no fun and it won't be as good a product. No one's going to be able to give you a step by step guide on how to make your OWN game. Email me at pankakeshannon@gmail.com if you really want to go ahead with this and feel like you're capable, and I might be able to help you with little things here and there when I get time.

Have a good day.

sadly ive already gave up Java... its too hard for me... since ive never done this in school or anywhere,But i started making a game in Unity3D, and im on half of the road.The only sad thing on unity3d is that there arent many free stuff (models,animations,etc)... and since i have a 10h job... i barely open unity3d...
But thank you for replying , i really appreciate someone actually tried to help me :)
• 07-10-2014, 09:02 AM
ruben381
Re: [How?] Random dungeon generator (like Binding of Isaac)
Quote: