Caves
Today I squashed an old bug…
I had a cave planet whose generation ended up being this:
So the player couldn’t get out of the initial drop zone!
I have a lot of code to try to prevent this sort of thing, but sometimes some stuff falls through the cracks… That’s actually one of the big problems of procedural generation: you either have very boring and similar areas, or you risk having bad gameplay situations.
In the case of the cave levels, they are built by creating some noise (which can be biased towards more “walls” or more “floor”):
Then I apply a cellular automata to cluster stuff:
And to have a bit more open areas or closed areas, I add some random blobs on the noise:
And the blobs were the reason I was getting that bad circumstance in the beginning area… Solving it was just a matter of avoiding a blob too close of the starting area:
I also decided to try something else: add more floor near the center area, so the map becomes more dense/claustrophobic the more you go away from the starting area:
But it didn’t work:
I get too much of an empty space (because the cellular automata tends to get rid of small clumps)… Fine tuning the area a bit yields a very similar result to the initial one:
So, all put together:
So, I got rid of a bug, but spent an hour or so on a dead end, which annoys me, especially nowadays when I don’t have much time to work on the game!
Now listening to “Illumination” by “Tristania”
Comment
You must be logged in to post a comment.