Loading...
5
Game
Greg RPG
1 year ago

Using binary space partitioning to make my dungeon layout!


I needed to make a dungeon area for my game and didn't feel like making it by hand - enter procedural generation!

Binary space partitioning, if you read its Wikipedia page, is something super complicated and nerdy in actuality. What I've implemented should techically count as BSP, though!

My algorithm is basically:

  • have an array of rectangles (size one to begin with)

  • in that array, split each rectangle in 2 and add to a new array

  • run the operation again on that new array

And then I can build room objects and walls after I have all that data set up.

I keep all rooms above a certain size threshold so that they don't get too small.

My implementation seems pretty fast too! The decoration phase is the slowest part that I have any control over. Sadly, the built-in Godot tilemap functions are really slow.

Greg greg greg Greg Greg



0 comments

Loading...

Next up

Devlog 24: 10.06....16.06.2024

Devlog 33: 12...18.08.2024

Greg RPG version 0.9.0

Welcome @PQubeGames to Game Jolt by giving them a follow!

Their upcoming game Discounty is a cozy supermarket management game 🛒 Make friends (and enemies) as you grow your shop!

Learn more about Discounty: https://gamejolt.com/games/Discounty/1006923

Summer

Happy #WIPWednesday! Are you working on a game? Making some art? Practicing a song? Something else? Tell us in the comments!

Artist Richard Hogg illustrated over 60 different puzzles for Wilmot Works It Out! Watch his process for one of our favorites here!

This chill game is available now for PC, Mac, and Switch! https://store.steampowered.com/app/2060590/Wilmot_Works_It_Out/

This Satuday we invite to watch another #speedpainting of our artist Daniel Faiad.

How great is this scene of #Pecaminosa?

#ScreenShotSaturday | #IndieDev | #DigitalArt

Here's a peaceful little forest scene for this #screenshotsaturday, from the beginning of the game.

Another house i made long time ago.