Results 1 to 9 of 9
  1. #1
    totalspelnerd is offline Member
    Join Date
    Mar 2012
    Location
    Sweden
    Posts
    88
    Rep Power
    0

    Default [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

  2. #2
    totalspelnerd is offline Member
    Join Date
    Mar 2012
    Location
    Sweden
    Posts
    88
    Rep Power
    0

    Default Re: [How?] Random dungeon generator (like Binding of Isaac)

    I've fixed this now. Can't edit my post for some reason though.

  3. #3
    kjkrum's Avatar
    kjkrum is offline Senior Member
    Join Date
    Apr 2011
    Location
    Tucson, AZ
    Posts
    1,060
    Rep Power
    6

    Default 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.
    Get in the habit of using standard Java naming conventions!

  4. #4
    totalspelnerd is offline Member
    Join Date
    Mar 2012
    Location
    Sweden
    Posts
    88
    Rep Power
    0

    Default Re: [How?] Random dungeon generator (like Binding of Isaac)

    sorry didn't see the comment. Here is the code explained:

    Java 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.
    		// Can be made differently
    		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

  5. #5
    Join Date
    Jun 2013
    Location
    Sheffield
    Posts
    4
    Rep Power
    0

    Default 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!
    Last edited by CadeLegallow; 06-10-2013 at 07:46 PM.

  6. #6
    vlad9727 is offline Member
    Join Date
    May 2014
    Posts
    2
    Rep Power
    0

    Default Re: [How?] Random dungeon generator (like Binding of Isaac)

    Quote Originally Posted by totalspelnerd View Post
    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.

    myemail: p.vlad9727@gmail.com

  7. #7
    ruben381 is offline Member
    Join Date
    Jan 2012
    Posts
    13
    Rep Power
    0

    Default Re: [How?] Random dungeon generator (like Binding of Isaac)

    Quote Originally Posted by vlad9727 View Post
    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.

    myemail: p.vlad9727@gmail.com

    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.

  8. #8
    vlad9727 is offline Member
    Join Date
    May 2014
    Posts
    2
    Rep Power
    0

    Default Re: [How?] Random dungeon generator (like Binding of Isaac)

    Quote Originally Posted by ruben381 View Post
    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 :)

  9. #9
    ruben381 is offline Member
    Join Date
    Jan 2012
    Posts
    13
    Rep Power
    0

    Default Re: [How?] Random dungeon generator (like Binding of Isaac)

    Quote Originally Posted by vlad9727 View Post
    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 :)

    Haha that's ok man. Good luck with Unity.

Similar Threads

  1. Random number generator
    By adjit in forum New To Java
    Replies: 9
    Last Post: 03-05-2012, 05:09 PM
  2. Random number generator
    By zerwik in forum New To Java
    Replies: 3
    Last Post: 12-26-2010, 01:10 PM
  3. Random Generator
    By Learning Java in forum New To Java
    Replies: 9
    Last Post: 05-31-2010, 09:15 PM
  4. Random Numbers generator
    By pinkdreammsss in forum Java Applets
    Replies: 10
    Last Post: 04-08-2010, 04:38 AM
  5. Random Generator
    By padutch2 in forum New To Java
    Replies: 1
    Last Post: 12-03-2007, 07:43 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •