Posted January 15, 2022 by PlayMedusa
#procedural
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:
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:
It took a while to come up with all those rules, but here's the final result. Tons of cities!