Been working on improvements to the world generation lately, so I thought I’d give a little peek at how it works.
This tilemap has 10 layers, and the generator looks through all of them to find ‘interesting’ bits, such as ‘Singles’ (1x1 island tiles, peninsula tiles, waterfalls, etc), ‘Corners’ (up to 3 tiles wide), and ‘Strips’ (1-wide rectangles adjacent to air or water on one or both sides)
Once Singles, Corners, and Strips have been found, they are converted into meshes of the appropriate size. For example, a a 1x5 cliff strip chooses a random mesh from a pool of 1x5 cliff meshes. Similarly, a 1x9 might choose a 1x9 mesh, but it may also break itself up into two smaller strips, say a 1x4 and a 1x5.
This all results in a more natural looking landscape, as its tile-based nature is less detectable when the meshes are larger than 1x1 and repetition is kept to a minimum due to the variety of meshes which can be chosen.
Each island is broken up into chunks, which load and then slide into place as you approach them. When you move far enough away, the island unloads. All of the building happens asynchronously so its impact on performance is minimal.
To hide the loading and unloading, there is a plane stretching across the bottom of the world (shrunk in the video for demonstration purposes) on which the background is rendered. Using a simple distance-based fade on its shader, the world can smoothly fade in and out.
Been spending a lot of time updating the worldbuilding. Instead of randomly generating the maps, everything is handcrafted and then randomly assembled. Secrets and exploration can be a much bigger part of the game now.
My grass is 3D now! Previously, the camera was locked to 90 degree intervals and the grass was built around this limitation. I recently unlocked the camera, so the old grass would no longer cut it.
The only difference is that each blade of grass now renders 3 triangles instead of 1. Since the grass was pretty cheap already, this had no noticeable impact on performance.
Well, another difference is that I no longer have to enable/disable different meshes based on the camera angle.
So it’s simpler and more versatile. Why didn’t I do it this way from the beginning? 🙃
Added support for palette swapping different areas of the wilderness. Also, there’s these little Bruce Lee skeleton spiders who come out at night to harass you if you’re out too late.
I thought ending the day at a specific time felt too restrictive, so these things act as a ‘soft timer’. You can navigate around them, it would be much easier to just go home and sleep until tomorrow.
I added a bow. I gave it a special attack that’s supposed to only work while stealthed... but I forgot to put that requirement in. Oops! But it was a blast machine gunning these slimes, maybe I’ll have to find a way to make this a feature.