Wow! I have been working on the 3D engine for two weeks now.
Let’s start with performance. It is OK. But there are still a lot of things to add to the engine, and when you add things performance will drop. There is no way around it. So I improved current performance: I get an extra 10 to 50 FPS on the same scene after this change.
Mesh generation is divided into two kinds: meshes that have different LOD levels and ones that have only one. Stone tiles have only one, so in consequence meshes formed by stone blocks are now only generated when you change levels. The other type is updated as needed on camera movement.
This caused some extra strain on the CPU since we generate larger areas less frequently. So now sections cache some parts of them that remain consistent between level changes and it is fairly smooth now but it will never work perfectly smooth with huge level gaps. This did not work in 2D so it won’t work in 3D where there is more work. But this is a small problem in extreme cases.
Taking this opportunity I rewrote the basic terrain mesh generator to a shorter and considerably more elegant solution. I did lose the ability to have different grass levels, but this is only temporary. Multiple grass levels were cosmetic anyway. The important thing is that the new generator is great.
I also tried to increase general visual quality and also create some contrast. Even though floors and walls made out of the same materials should look the same, I use different textures with the same color to give better contrast to the scene and wall borders have different color than floor borders:
What do you think? Is it easier to tell what is going on? I wonder how I can better increase the contrast and clarity. Can it be done by texture work alone?
So terrain generation is done for now. For next week I’ll merge the 3D engine package with the DwarvesH package to finalize the 3D transition.
I’ll leave you with this sample of random starting locations: