I’ve made some decent progress over the last week or so. Working mainly on the world meshing and some dev tools. Urho3D has an editor built in but it’s very basic and quite ugly, also it’s written in Angelscript which I have little experience in. Rather than attempt to modify it I’m going to built some custom tools.
I had some issues getting shadow maps to work correctly with an orthographic camera. In the previous update no shadows can be seen, I’ve since figured this one out.
The standard game world is relatively large 5000 x 5000, I split the world into chunks of 128 x 128, at any given point at least 9 chunks are in view and meshed at the highest level of detail. The chunk streaming system distributes the load of mesh generation across multiple frames, so that we keep a solid 60fps while chunks are meshed in the background. The chunks not at the centre of focus are going to rendered at a lower LOD.
– Fixed issue with near and far clipping
– Added a sand tile which appears near sea level
– Fixed issue where game would crash after exiting devmode
– Fixed zooming issue where world would be clipped when at min zoom
– Refactored chunk loading and saving
Long time since the last update, the whole project has undergone some major changes. Very little of the code I had written as of the last update remains. I have made the decision to use an game engine, Urho3D. After a lot of thought it’s clear that if this game has any chance of existing complete then I need to do everything I can to speed up development. I considered the various options from complete packages like Unity to graphics engines like Ogre3d. In the end Urho3D seems like the best fit, it is a very well written open source engine. Being open source it allows almost the flexibility that a custom engine would have given.
Surface Mesh Generation
The underlying structure of the world is in voxels, however each voxel does not represent a singular unit, instead I give it a volume. This allows the terrain to be smooth when the adjacent voxels are not of too great a hight or depth. I want to avoid the typical Minecraft style voxel landscape as much as I can, It’s been well overdone at this point and I don’t think it lends itself well to an overhead view. The little red dots you see on the surface are just placeholder flowers.
I jumped into the ambient occlusion not really thinking of the difficulty it would impose. In a Minecraft style world AO is quite trivial because each voxels vertices are clamped to an integer unit. You can bake the ambience value directly into the vertices. In this game it’s not possible because a voxel can have a vertex at an arbitrary location depending on the volume of the voxel. This only matters for AO at the top and the bottom of the sides of a voxel. So far I have baked AO for the surface (Grass) and I’m going to make another post about my alternate solution for the voxel sides (Rock).
Free Floating Camera
I added another camera type for debugging, the free floating camera allows me to see the world from any angle.