itch.io is community of indie game creators and players

Devlogs

proc gen1

002
A downloadable couch coop adventure

unity game engine in use.
I wanna talk a little bit about procedural generation.
lists vs. arrays in code. 
arrays are cool, they're clear. easy to use when you're using perlin noise or something similar. i have this idea now , as if  i learned it. arrays work well whhen I want to follow the same instructions  with generation with every  single object during generation.
I'm not using arrays. I've got lists.
no perlin noise, just rng. I've got a list of AvailableTiles, I've got a list of WhatButtonsIWannaPlace.
the latter getsss populated step by step. in every step I try to place one big blue button, one medium sized blue button and one tiny blueish button. if it fails to place, i just don't worry anymore. code will try again. using list.Exists(thing => ting conditions) i know if a complex condition is satisfied anywhere in the list. list.Find() to find the exact reference. then i can cary on double checking and tripple checking if that entire area is made of AvailableTiles (like nothing has been built there yet) and then make sure when i built  a blue button there, it really becomes imposible for any thing to overlap.

Read comments (1)