So work has been busy, and I haven’t had nearly as much time to code on things here as I would have liked, but I’ve made some interesting progress over the past week or two.
The first thing to mention is that I believe I’ve finally cracked the nut of making the game’s height map look good; no more weird diagonal diamond patterns visible across changes of surface facing! (this involves re-triangulating the surface to try to minimise artefacts) This was especially bad before at sharp creases, such as you can see at the bottom of this extreme hill, or around the edges of darker areas, at the crest of the hill. It was also often very visible on the mountains at the region boundaries. But now, it’s pretty much bang on every time. I’ve been doing this “re-triangulate the mesh to try to hide those diamond patterns” thing for an awfully long time, but it was only today that I finally found the right combination of heuristics to actually make it work reliably.
I’ve also moved from a simple directional-lighting light model to a wrap-around lighting model, which gives the game a much softer look, which also helps with the smoothness. And is just a nicer look overall, in my opinion.
I’ve also started implementing more ground shaping tools. Most notably is the ground leveller. Basically, it tries to flatten out the terrain under your cursor. There are versions which will only raise terrain, only lower terrain, and which will go in both directions. This is great for setting up flat surfaces to place buildings upon. (Since buildings only place their centre point on the ground, it’s common for their corners to be floating, or for the ground to be embedded through the building geometry. Still TODO is to have buildings automatically flatten the ground under them, when placed.
Oh, and incidentally, grass now flows downhill, instead of always east-west. I don’t think you can make it out in this screenshot (I’m too far away), but trust me. :)
I still need to do thinking about how to set up the overall ground editing interface. The “paint on” interface is nice, but even with the work being farmed out to background threads, it’s hitting the frame rate too hard, when the user paints with a large brush. I’ve been thinking about having the terrain editing tools work with a grid lattice, which I could easily update in real-time. When the user is happy with his changes, he could click an “Accept” button, to assign the terrain rebuilding to a game developer. This would make it work similarly to how placing buildings works; giving commands to actually be executed by minions. And it would also solve the problem of needing to rebuild the terrain every frame; instead, it could just happen in the background, when the developer is actually performing the task. Need to think about this more; I’m not sure how the user would specify terrain types on a grid lattice, for example.
I took a stab at continuing with player AI, but rapidly banged my head against the current code setup. I think I’m going to have to heavily refactor the code, before I can add anything more to it. It works right now, but it was written in the fastest possible way, way back for my self-induced “Milestone 1”, and at this stage, I’m stumped as to how to add parties to the system, without breaking the quest-following behaviours that are already in there.