Hi all. I am going to attempt to use a bsp-tree system (often used in basic procedural dungeon generation) as a means to create a small town layout for the game I am developing. The towns (hamlets really) only offer perhaps seven or so buildings at max. Because towns are not very complex, I think bsp is a good route.
Here is a link to the bsp method of any are unfamiliar: here
The benefit of this method is mostly the avoidance of overlap. All of this said, I have never actually coded this method before using C# so that should be interesting…
Regardless, is this viable for what I am looking to do?
Any tips on how to split rectangles?
And does anyone know of an easier / alternative method that I should be aware of? Thanks!
If all you want to do is plop down some houses and fields, then it could work.
Realistically it’s not the best choice. If you actually have roads, then better results can usually be had just laying things out linearly. For something to play around with, BSP trees are fine. Consider it a learning exercise and a taste test for whether you want to dive into the ocean that is spacial partitioning.
If you don’t mind your road system being kind of insane, you could treat the edges of each rectangle as half road, so it makes a complete road where it meets up with other rectangles, and proper cross sections at corners. But that’s just a thought, RockoDyne seems to have the better long term solution.