[Help] Dungeon Generation BSP tree-alike

This forum is currently in read-only mode.
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • I'm trying to write dungeon generator based on bsp tree (http://roguebasin.roguelikedevelopment.org/index.php?title=Basic_BSP_Dungeon_generation) 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?

  • Help me someone. Stuck in it for couples of days, no luck.

    Here's wiki description of quadtree http://en.wikipedia.org/wiki/Quadtree

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Have you tried Luomu's Dungeon/maze generator plugin.

  • Have you tried Luomu's Dungeon/maze generator plugin.

    Yes, and must say it's a great plugin Luomu, but in my case particually, quadtree is definetly 2x better

  • 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

    http://www.box.net/shared/rpbxd6r7od

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

    Ex:

    http://dl.dropbox.com/u/5426011/examples2/quadtree.cap

    made in 0.99.96

  • 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).

  • 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.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)