Procedural cities


The city mockup looked nice, but I needed infinite random cities. Let's try procedural generation! The mockup was created using actual Pico 8 8x8 sprites, so buildings were already modular. I just needed a few more windows (open and closed), doors and roofs:


I used five colors: wall, dark, light, door (these are the three that would change programatically), glass and glass detail. Using PAL in Pico 8 you can swap colors, so with just those blocks in the image and a few color sets (i.e. {4,9,10,2} <- dark, wall, light, door) I would have buildings with different colors.  Lots of sprite space saved!

In order to have a building we need some numbers:

  • width (minimum 3 tiles, maximum 5)
  • height (minimum 4, maximum 9 for front buildings; minimum 10 and maximum 12 for back buildings)
  • color set (wall, dark, light, door)
  • window, door and roof sprite.

So a building is just a bunch of tiles: roof, windows, ground level, plus some details like not adding windows at certain floors from time to time, just to add variance. 

Cities are just a bunch of buildings following these  rules:

  • Cities have between 3 and 5 buildings.
  • There's a road or a railway. No water, yet, nor bridges.
  • There are 2 or 3 buildings on the background, the rest of them on the foreground.
  • Buildings on the same plane can't touch.
  • Buildings can't have the same color as nearby buildings.
  • Buildings on the foreground can't be tangent to buildings in the background (sides can't touch)

It took a while to come up with all those rules, but here's the final result. Tons of cities!

Get Rampaging

Buy Now$2.00 USD or more

Leave a comment

Log in with itch.io to leave a comment.