Being Productively Lazy
My New Year’s resolution... to stop doing things the hard way and automate the boring stuff
I’m constantly looking for ways to cut corners, shave off some development time, or do things easier. Or maybe I’m just being lazy. I’ve always been interested in procedural content generation (PCG) for art. It very much leans into this idea of working smarter not harder. Having parameters control the outcome, and flexible enough to modify without being destructive. Basically, it’s when you give a computer a set of rules to create things on its own, rather than having a human build every single piece by hand… and no not the AI kind of creation.
For those of you who are new to proceduralism, this isn’t the first time I’ve delved into this topic. But nothing a GDC talk can’t fix to learn more about unfamiliar topics. Here’s one from quite a bit ago…
Procedural Foliage Placement
Foliage placement and landscape scattering are probably the more common applications of proceduralism. The organic nature, randomness, and sheer massive volume of entitles to create such a thing lends itself perfectly to be created in a more systematic way.
I mean… it only took me a grand total of one time to realize I didn’t want to spend more time placing sprite foliage all over the world. I knew I needed to take some time to come up with a better plan… a procedural plan, but hesitant on investing the time. Going procedural isn’t always the easiest, or even a requirement this early on, but it can add a lot of variability in the level, give unique playthroughs and replay value in the long run.
So last week was dedicated to working on a prototype of this type of foliage generator script. At the end of it all, it took a minute to debug, but came out quite smoothly the way I envisioned. All that’s left to do is load up the foliage prefabs, add collision boxes for where you want it to “grow’ and where you don’t, then hit Generate! It was a magical “make art” button when it came together.
It still could probably use a little more tuning and work, but this has already saved a lot of time from the manual hand placing assets.
The script ended up being a bit more robust than I expected. Here’s the breakdown of how I’m actually controlling the chaos…
Inclusion / Exclusion Volumes - using collision boxes as zones for placement of foliage and areas we don’t want any foliage at all, for example on a paved path.
Automatic Building Exclusion - houses, and building structures will automatically be flagged as a “no grow” zone from being on its own layer in Unity.
Random Seed Memory - ability to save random seed is important for debugging but also to save certain placement layouts or random colors if the roll was particularly favorable.
Art Direct - parameters such as density, number of clumps, spread, spacing, radius etc. can all be tuned to give some finer control.
Thanks… I mean it.
As we all close out the year, I just want to say thanks for sticking around while I brain dump. I appreciate all of you who have stayed for the random things I write about. I’m grateful for the community here and hope this Substack continues to give value to those who read it. I’m happy to see it keep going. Drink, celebrate, be safe ya’ll… and catcha on the Flippin New Year!!




