Loading...
5
Game
Greg RPG
2 years 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

Summer

Devlog 24: 10.06....16.06.2024

Greg RPG version 0.9.0

Have you played Bandit Trap?

New quests celebrating the game have entered your log. Tell us about YOUR favorite trap from Bandit Trap using the tag #MyFavoriteBanditTrap.

Get the game: https://bit.ly/bandittraplaunch

Devlog 33: 12...18.08.2024

Everything is Crab is OUT NOW! Choose from near-endless evolutions and options in every run. Out now on Steam and Epic Games Store.

Quests celebrating the game are in your quest log.

Get the game: https://bit.ly/EverythingIsCrabLaunch

Learn more about the quests 🔽

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

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

Heya there! I really wanted to show you all a little gameplay preview of the first boss fight i'm currently working on i hope you like it ^^

Shadow The Hedgehog X pixel art