How I Generate Beautiful Environments for my Indie Game!

Sunday, February 19, 2023

This blog post is just a summary of the full video I made on the subject.

You can watch it here:

Hello! In this blog post, I'll be sharing my progress on a game that I've been developing for nearly two years now. Inspired by Minecraft, Stardew Valley and Skyrim, my game requires players to build a settlement and invite new villagers, each with their own quests, items, and abilities. This month, I focused on fixing some issues with the terrain generator.

The terrain generator problem was that it never really generated a navigable or consistent world - it looked cool, but it wasn't good for actual gameplay. The problem was how I masked off the island. Theoretically, it should have generated a circular mask based upon this animation curve - where the middle is a mountain and the edges are the end of the island. But instead of a circular shape, it looked more like a cross, which led to some really strange landscapes.

I generate the terrain using a height map consisting of three separate other height maps. The first is a ridged height map used to create the mountain in the middle of the world. The second is a billowing height map used to create some lovely rolling hills, and the third is just some standard simplex noise used to add some extra detail. To fix the cross shape, I created different masks for each height map. Here are a few different terrains generated from different seeds. You can see that it was very consistent in general shape but still has a lot of the charm that comes with procedural generation.

One thing very important to Sundermead’s story is the mountain in the middle of the island. This is because there will be a good few quests to place up there, just like the one I worked on next! This quest is for the character that I added in the last update, Rowena. She can be invited to Sundermead to work as your settlement’s tailor. Her quests are tailor-related, like this one where she is running low on resources and so asked you to explore an old Roman temple, high up on the mountain. When you get there, you’ll find a troll who has made himself at home in the ruins.

The troll's look was inspired by the Trork from Hytale, which was actually inspired by a combination of Trolls and Orcs. I began by modelling it in block-bench, but I realized that the rig I use for animating my characters wouldn’t work with it, so I had to start from scratch. This troll acts as Sundermead’s 2nd boss. He has a few different acts and will be quite a challenge to beat.

Next, I modelled an Armor set based upon what would have been worn by infantry during the later stages of the western Roman empire. This set is made up of a helmet and a tunic with scale Armor atop it. The helmet is similar to a lot of Germanic helmets that have been found, such as the Sutton Hoo helmet found in Suffolk in the 1930s. This is because the Germanic tribes began to copy a lot of Roman ideas at this time, especially when it came to Armor.

I also fixed quite a major performance bug this time around. This bug caused the terrain generator to become slower the longer you played the game, eventually to the point where walking around the world caused constant freezes. I eventually tracked this down to a memory leak caused by the algorithm that I used to update the chunks in my quad tree. Luckily, this is fixed now, and the memory usage of my game stays nice and consistent.

To finish up, I fixed a couple of small graphical issues. The first was that the fire and smoke from my torches would sometimes clip through walls. The other was that the light source on the characters was causing shadows to go in weird directions. I've now fixed both these issues, and the game looks better than ever!

~Josephus