Posts

Random Building Tool

10 Oct 2025

About


This untitled game is huge, for a sol dev, the city would take forever to create manually. Also, I think it's quite hard to add randomness to things by hand - inevitably the same few objects keep getting reused and placed in a way that looks repeated.

To combat the above and hopefully build a more realistic, lived in looking, city, I created a tool to help with the randomisation and rough placement. Scriptable Objects are used to store the data of which prefabs to use, allowing for different selections of buildings and to quicky swap between them.

Using the data from the Scriptable Object the placement tool will go around each side and randomly select an available building. It will check the bounds of the selected building and the position it's going to be placed, to roughly place buildings around the block (randomly rotated) until all four sides are full.

I then go round and tidy the placements up. Removing any overlaps and filling in gaps between the buildings, as I don't want the player to be able to get inbetween the buildings. Further into development another pass will be done to add polish - more set dressing to add more life to the city.