Procedurally placing buildings on the map?

Hi,

For my RPG game maps, I am looking for techniques to procedurally place buildings (houses, shops,…) on the island using a seed number.

Currently, I do know about the BSP (Binary Space Partition) method, if you know about other good techniques that can be used for this purpose, please let me know.

Thanks

2 Likes

Could start from things like placing roads. Once roads and terrain are set, position buildings around the roads.

1 Like

My idea would be using “Plotter”(like grass/tree plotters) where you have roads / other things, and just place buildings not conflicting with themselfs/roads in some distance from road like Leo said.

And ofc marked area where is city to use this plotter within that can be made by second plotter.

But…

IN today time, BEST would be teach AI how cities are constructed in real life and use it for filling plotter itself :slight_smile: We have maps data, just teach AI based on it hehe

edit:

  • you know, gather real world map data of cities, parse it into “plotter data”.
  • then teach AI about plotter data that is proper and its “quality” (tho every real city is 1 quality in accurate i would say lol)
  • with generated model, generate new random plotters with AI.

good idea?

1 Like

It will largely depend on what you want to get out of it.

For example, there must be reasons (probably several) for why just randomly placing building in any random location doesn’t work for you. What else?

Are your buildings fixed orientation? Free orientation? Tiles?

Will you have roads?

Edit: will all of your buildings have a reason for being there? Or are you just trying to tightly pack a bunch of filler buildings?

Are you pregenerating this as part of game design or creating random islands on the fly for the player.

…every technique will have trade offs and benefits. It’s important to know what the game actually needs.

2 Likes

Thanks guys for the suggestions :slightly_smiling_face:

Ended up creating a simple object plotter (as suggested) and fed it with the list of objects I want to spawn (buildings in this case), then set a random seed number, then I pick a random location on the map, and the plotter spawns a random object from the list on that spot.

After that, I can also change the seed and click on respawn to replace the existing objects with a different one from the list but at the same spot.

Here is a screenshot:

Buildings are placed around the roads (they are not a real road though;). The terrain is also generated procedurally.

Yes

5 Likes

Ah, yeah, your use-case is much simpler… and being able to edit the results to make them nice helps, too.

This is a topic that I’ve long since jumped off the deep end and grown gills. (See any number of live streams on town placement for example… … … …)

1 Like