[Help] Dungeon Generation BSP tree-alike

For questions about using Classic.

Post » Sun Oct 03, 2010 10:49 pm

I'm trying to write dungeon generator based on bsp tree ([url:28vihsjx]http://roguebasin.roguelikedevelopment.org/index.php?title=Basic_BSP_Dungeon_generation[/url:28vihsjx]) but to partition into 4 parts each step (1 horiz and 1 vert line, total 4 rooms).
I'm defining a point in which i'll cut layout into 4 segments by horizontal and vertical cut.
Then each cutted Layout piece will be cutted again, into 4 segments and so on until i'll get small roms. Cant get it work. Maybe anyone can provide me an example of BSP tree-based generator or something?

I'm working on roguelike without diagonal movement (for netbooks or notebooks without numpad as mine vaio notebook). So i need this generator, cause it has straight corridors and square rooms - ideal for 4-ways moving.
Someone... anyone?
B
19
S
6
G
4
Posts: 171
Reputation: 2,507

Post » Mon Oct 04, 2010 2:45 pm

Help me someone. Stuck in it for couples of days, no luck.
Here's wiki description of quadtree [url:kw53mzpy]http://en.wikipedia.org/wiki/Quadtree[/url:kw53mzpy]
B
19
S
6
G
4
Posts: 171
Reputation: 2,507

Post » Mon Oct 04, 2010 3:37 pm

Have you tried Luomu's Dungeon/maze generator plugin.
viewtopic.php?f=29&t=7161
B
21
S
4
G
4
Posts: 280
Reputation: 2,934

Post » Mon Oct 04, 2010 4:43 pm

[quote="toralord":17hgvwam]Have you tried Luomu's Dungeon/maze generator plugin.
viewtopic.php?f=29&t=7161[/quote:17hgvwam]
Yes, and must say it's a great plugin Luomu, but in my case particually, quadtree is definetly 2x better
B
19
S
6
G
4
Posts: 171
Reputation: 2,507

Post » Mon Oct 18, 2010 6:02 pm

I'm writing my own quadtree dungeon generator, experiencing problems please help. Second "Parent" sprite refuses to continue loop spawning 4 childs. Heeeelp)
some notes:
on any key press system spawns "Parent" sets his position and size.
next - loop. It must continually loop through the "parents" that spawns "Childs", and through "Childs" to spawn parents on each child to continue loop.
It must look like parent creates 4 childs in its bounds, then every next child creates 1 parent in its bounds. This new 4 parents creates 4 childs in their bounds (each of them, totally 16 childs) and so on. Sorry for possibly bad English, see signature)
Here's the cap
[url:1tzj14nz]http://www.box.net/shared/rpbxd6r7od[/url:1tzj14nz]
B
19
S
6
G
4
Posts: 171
Reputation: 2,507

Post » Mon Oct 18, 2010 7:27 pm

The problem is with created objects. They can be selected just after they are created, but only the most recently created one, they [u:xuldbqf1]can[/u:xuldbqf1] however be selected like normal on the next tick. So a solution would be to do one depth level per frame.

Ex:
[url:xuldbqf1]http://dl.dropbox.com/u/5426011/examples2/quadtree.cap[/url:xuldbqf1]
made in 0.99.96
B
79
S
24
G
52
Posts: 4,725
Reputation: 39,713

Post » Tue Oct 19, 2010 11:21 am

R0J0hound, thanks alot.
Sometimes it's like you screw up all your work, till somebody more experienced helps you to clean all that mess for you).
B
19
S
6
G
4
Posts: 171
Reputation: 2,507

Post » Tue Oct 19, 2010 3:29 pm

R0J0hound you should change global variable 'midx' and 'midy'
from this
-> System: Set global variable 'midx' to Box.X+Random(Box.Width)
-> System: Set global variable 'midy' to Box.Y+Random(Box.Height)

to this
-> System: Set global variable 'midx' to Box.X+((Box.Width/4)+(random(Box.Width/2)))
-> System: Set global variable 'midy' to Box.Y+((Box.Height/4)+(random(Box.Height/2)))

this is to keep them from going to far to the edge.
B
21
S
4
G
4
Posts: 280
Reputation: 2,934


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 2 guests