[QUOTE=ZenX2;28194292]Content Man, saving the day once again:
I got that dungeon generation algorithm working :buddy:
Now I just need to make the rooms bigger.[/QUOTE]
What algorithm are you using?
[QUOTE=spear;28194377]What algorithm are you using?[/QUOTE]
Probably one that generates dungeons!
[QUOTE=Richy19;28194367]Just like 99% of yours[/QUOTE]
"omg a opinion post i disagree with? must be worthless!"
[QUOTE=deloc;28194668]"omg a opinion post i disagree with? must be worthless!"[/QUOTE]
You really dont understand when is enought, do you.
Got diamond swapping working (sort of)
[url]http://i.imgur.com/fOd6i.gif[/url]
[QUOTE=ZomBuster;28194972][img_thumb]http://i.imgur.com/fOd6i.gif[/img_thumb][/QUOTE]
thanks for that 3.61mb gif
[QUOTE=deloc;28195116]thanks for that 3.61mb gif[/QUOTE]
What's wrong with you? Just trolling?
Ugh, I spent a good half of the day reworking the dungeon generating. I scratched what I had before since that would just make random mumble-jumbo. I found another good algorithm ([url]http://roguebasin.roguelikedevelopment.org/index.php?title=Basic_BSP_Dungeon_generation[/url]) with recursive division. Again, I prototyped in Java and have gotten better results. I want to rewrite some parts since I started getting frustrated, and when I get frustrated, I start losing control of what's happening. Regardless, I now get this:
[code]
################################
################################
## # ### ###
## # # ###
## # ### ###
#### ## ###### ### ###
#### ## ###### ### ###
## ###
## # ###
## # ### ###
## # ### ###
## # ### ###
## # ### ###
## # ### ###
## # ### ###
## # ### ###
## # ### ###
## # ### ###
####### ########################
####### ########################
## #### ########################
## #### ########################
## #### ########################
## ## ## ###
## ###
## ## ## ######
## ## ## ###
## ## ## ###
## ## ## ###
################################
################################
################################
[/code]
[QUOTE=likesoursugar;28195166]What's wrong with you? Just trolling?[/QUOTE]
it's generally faux pas on most internet forums to post massive gifs inline.
[QUOTE=deloc;28195215]it's generally faux pas on most internet forums to post massive gifs inline.[/QUOTE]
Get faster broadband if you dont like it
Or better yet go away
Speaking of dungeon generation I got a nice maze generator now (not the same one I pointed out earlier).
[img]http://gyazo.com/449e4fe1ef4de32f85f8b8cfc1f75cc0.png[/img]
Just need to figure out how to make every tile accessible, now...
[quote] SteveUK banned deloc for 3 Days in What are you working on? v15 with the reason “Shitposting in WAYWO (again)”[/quote]
:buddy:
[QUOTE=deloc;28195116]thanks for that 3.61mb gif[/QUOTE]
[QUOTE=deloc;28195215]it's generally faux pas on most internet forums to post massive gifs inline.[/QUOTE]
too lazy to upload a video, I'll link it
I find it funny that XNA makes sure to simplify everything to the point of a preprogrammed leaderboard, but lacks the function to draw a line without using a vertex buffer.
[QUOTE=thomasfn;28189932]Then why did he obfuscate it in the first place? It just slows down modders.[/QUOTE]
The only partly sane reason I can think of is that he had/has shoddy multiplayer anti-hacking machinery and hoped to delay hackers so he could release early.
[QUOTE=ZomBuster;28195285]too lazy to upload a video, I'll link it[/QUOTE]
It's ok, he's finally gone :P
I didn't make a maze generator, but I did start making a random dungeon generator again:
[img]http://i.imgur.com/4HyXj.png[/img]
Now I'm either going to figure out how to connect the rooms, or I'll have to remake it using one of the algorithms posted above...
EDIT:
[QUOTE=KillerJaguar;28195191]Ugh, I spent a good half of the day reworking the dungeon generating. I scratched what I had before since that would just make random mumble-jumbo. I found another good algorithm ([url]http://roguebasin.roguelikedevelopment.org/index.php?title=Basic_BSP_Dungeon_generation[/url]) with recursive division. Again, I prototyped in Java and have gotten better results. I want to rewrite some parts since I started getting frustrated, and when I get frustrated, I start losing control of what's happening. Regardless, I now get this:
[code]
################################
################################
## # ### ###
## # # ###
## # ### ###
#### ## ###### ### ###
#### ## ###### ### ###
## ###
## # ###
## # ### ###
## # ### ###
## # ### ###
## # ### ###
## # ### ###
## # ### ###
## # ### ###
## # ### ###
## # ### ###
####### ########################
####### ########################
## #### ########################
## #### ########################
## #### ########################
## ## ## ###
## ###
## ## ## ######
## ## ## ###
## ## ## ###
## ## ## ###
################################
################################
################################
[/code][/QUOTE]
Okay, how exactly did you code this? Can you please give me some pseudocode? I've been working on this one algorithm for like two weeks, with pretty much no results. Here's my pseudocode:
[code]
choose either horizontal or vertical
if horizontal, generate a value in a certain range of this node's horizontal size/2
if vertical, generate a value in a certain range of this node's vertical size/2
assign this value to the "split" integer
create two new child nodes
give both nodes size and top-left-corner data based on the parent's (this) split location, size, and top-left-corner data
//repeat a given number of times; every time new nodes are created, a check integer is incremented, so it only keeps creating new levels until the check integer meets its check-point
[/code]
What method have you been using?
[QUOTE=BlkDucky;28194373]This one: [url]http://roguebasin.roguelikedevelopment.org/index.php?title=Dungeon-Building_Algorithm[/url] ?
I kept getting strange results. Need to back to it.[/QUOTE]
Yup. I don't really like how it turns out, so I think I'll try the BSP one.
[QUOTE=KillerJaguar;28195191]Ugh, I spent a good half of the day reworking the dungeon generating. I scratched what I had before since that would just make random mumble-jumbo. I found another good algorithm ([url]http://roguebasin.roguelikedevelopment.org/index.php?title=Basic_BSP_Dungeon_generation[/url]) with recursive division. Again, I prototyped in Java and have gotten better results. I want to rewrite some parts since I started getting frustrated, and when I get frustrated, I start losing control of what's happening. Regardless, I now get this:
[/QUOTE]
What are you holding the layers of the dungeon generation thing in?
Only thing i could think of was a multi dimension array
[QUOTE=Hypershadsy;28195344]I find it funny that XNA makes sure to simplify everything to the point of a preprogrammed leaderboard, but lacks the function to draw a line without using a vertex buffer.[/QUOTE]
1x1 white texture
[code]
float lineLength = 100;
Vector2 linePos = Vector2.Zero;
float angle = MathHelper.PiOver2;
sprBatch.Draw(white, linePos, null, Color.White, angle, Vector2.UnitY / 2f, new Vector2(lineLength, 2), SpriteEffects.None, 0);
[/code]
[QUOTE=NovembrDobby;28195450]1x1 white texture
[code]
float lineLength = 100;
Vector2 linePos = Vector2.Zero;
float angle = MathHelper.PiOver2;
sprBatch.Draw(white, linePos, null, Color.White, angle, Vector2.UnitY / 2f, new Vector2(lineLength, 2), SpriteEffects.None, 0);
[/code][/QUOTE]
That was all I got when Googling, but I get the feeling that's really unoptimized.
[QUOTE=ZenX2;28195414]Yup. I don't really like how it turns out, so I think I'll try the BSP one.[/QUOTE]
I never even managed to get that far. Would you mind showing me the source? :3:
It goes something along like this:
[code]
[Chunk is a class with a x, y, width, and height]
func Split(Chunk, NumTimes)
if NumTime < 0 return
Pick a direction: horizontal or vertical
if (horizontal)
Pick a random spot within the chunk on the Y axis
if (vertical)
Pick a random spot within the chunk on the X axis
Create two new chunks from splitting the inputted chunk into two
if NumTime = 1
Generate the chunk's room
Call Split() recursively with both chunks separately and NumTime-1
Call ConnectTheRooms()
end func
[/code]
[QUOTE=Hypershadsy;28195587]That was all I got when Googling, but I get the feeling that's really unoptimized.[/QUOTE]
I don't think it is, I remember reading an XNA dev on the forums advising people to do it that way
Progress!
[img_thumb]http://i.imgur.com/TvyL0.png[/img_thumb]
I'm getting some weird stalls before the map is getting printed (they're coming from the hall generation), so I need to work those out... And, for now, only horizontal halls can be created (although it won't be difficult to add vertical halls; I'm just currently trying to fix these weird stalls).
EDIT:
[img_thumb]http://i.imgur.com/ZKOmN.png[/img_thumb]
Hm... It might be kind of difficult to ensure that all the rooms are connected. I don't even know how I'd check to make sure everything is connected... meh. Also, I don't know how to make sure that only one hall per the same two rooms is generated.
[QUOTE=BlkDucky;28195282]Speaking of dungeon generation I got a nice maze generator now (not the same one I pointed out earlier).
[img_thumb]http://gyazo.com/449e4fe1ef4de32f85f8b8cfc1f75cc0.png[/img_thumb]
Just need to figure out how to make every tile accessible, now...
:buddy:[/QUOTE]
Much, much better.
[media]http://gyazo.com/d5bcff6eac02c1f26d5d9b5b3cff9dd6.png[/media]
[media]http://gyazo.com/edb3cacadb0fd55373d782d7c77c2540.png[/media]
I'm... not sure if every tile is accessible... I don't think they are. I'm too tired to tell.
Now I want to get into the rogue-like games. That is, once I get SFML working... dumb linker flags.
Edit: Yay, fixed it, now I can learn some SFML :buddy:.
[media]http://gyazo.com/8f6aadef37387a83a47853c18333afcd.png[/media]
[media]http://gyazo.com/af05faed3b1eeee211aa2204d6a6ed4c.png[/media]
Dammit. I can't believe I spent that long exploring the maze only to find this. :v:
Also ninjas.
[QUOTE=spear;28196630]Progress!
[img_thumb]http://i.imgur.com/TvyL0.png[/img_thumb]
I'm getting some weird stalls before the map is getting printed (they're coming from the hall generation), so I need to work those out... And, for now, only horizontal halls can be created (although it won't be difficult to add vertical halls; I'm just currently trying to fix these weird stalls).[/QUOTE]
What do you do for your hallway generation? Mine is a little wonky.
[QUOTE=SamPerson123;27909194]Now my maze generator can make mazes as big as an int. I ended up moving the switch statement outside of the other switch because I realized I needed to compare it to something else. It's a bit nicer now, but I'm sure there's a cleaner way to do it.
[code here]
[editline]6th February 2011[/editline]
This can do a 500x500 cell maze in half a second.
[editline]7th February 2011[/editline]
Got it down to .25 seconds by using the clear function instead of making a new ArrayList each time.[/QUOTE]
Improved it's speed a little:
[code]
public void depthFirstGenMod( int X, int Y ){
final boolean[] opts = new boolean[4];
final Random randGen = new Random();
boolean finished = false;
while( !finished ){
maze[X][Y][0] = true;
int avail = 0;
opts[0] = X>0 && !maze[X-1][Y][0];
opts[1] = X<xSize-1 && !maze[X+1][Y][0];
opts[2] = Y>0 && !maze[X][Y-1][0];
opts[3] = Y<ySize-1 && !maze[X][Y+1][0];
if ( opts[0] ) avail++;
if ( opts[1] ) avail++;
if ( opts[2] ) avail++;
if ( opts[3] ) avail++;
if ( avail > 0 ){
int rand = randGen.nextInt( avail );
int cOpt = 0;
for ( int i = 0; i < 4; i++ ) {
if ( opts[i] ) {
if ( rand == 0 ) {
cOpt = i + 1;
break;
}
rand--;
}
}
switch( cOpt ){
case 1: maze[X][Y][1] = true; X--; dir[X][Y] = 2; break;
case 2: maze[X+1][Y][1] = true; X++; dir[X][Y] = 1; break;
case 3: maze[X][Y][2] = true; Y--; dir[X][Y] = 4; break;
case 4: maze[X][Y+1][2] = true; Y++; dir[X][Y] = 3; break;
}
}else{
switch(dir[X][Y]){
case 1: X--; break;
case 2: X++; break;
case 3: Y--; break;
case 4: Y++; break;
default: finished = true; break;
}
}
}
}
[/code]
To generate a 2560x2560 maze it takes 1193 ms, compared to 5650 ms with yours :]
[editline]Edit[/editline]
and 52011 micro seconds for a 500x500 one :D
[QUOTE=KillerJaguar;28196862]What do you do for your hallway generation? Mine is a little wonky.[/QUOTE]
Pseudocode:
[code]
In the map generation code:
int current_halls = 0;
int max_halls = 8; //arbitrary
while (current_halls < max_halls){
choose random x, y locations
if map[y][x] contains a ground cell (it is a room){
generate random direction
use this direction to explore, from the position, in that direction (NOTE: make sure this is on the edge of a room by first checking the cell one away from the current one in whatever direction you generated and making sure that it's a wall)
if your exploration results in you finding another ground cell (another room), start creating ground cells from the initial x, y position to this one, and current_halls++
}
}
[/code]
Not very detailed, but that's pretty much it. I can paste the real code if you want, but it's VERY spaghetti-code-esque (this is really just a test-case, so I'm not worried about the sloppiness of it that much).
Also, note that this isn't very ideal, because it can generate more than one hall for a pair of rooms, and it doesn't ensure that all the rooms get connected. I just wanted to try generating dungeons, so this is what I (poorly) came up with.
EDIT: Also, a video for those who are interested:
[media]http://www.youtube.com/watch?v=RVdd09ZoNbU[/media]
Sorry, you need to Log In to post a reply to this thread.