Wednesday, September 25, 2013

Tworenas Snapshot 11

Yeah, you know what this snapshot is about. The thing I've been talking about the last week. This is the first snapshot with terrain LOD!

The first generation terrain LOD is finished, tested, quite stable and I even managed to squeeze in a first round of hefty optimization. On the other hand, barely a week old and the system has reached its limit! I just got started on the second generation LOD system!

But let's not get ahead of ourselves! Last time I talked about fixing seams and left off with adding a new level to the LOD system that I didn't manage back then to add the seam fixing functionality in for (what a phrase; I R engrish):


I just can't leave you with that screenshot, so here is a fixed one:


I added further levels since then and now the system uses 5 LOD levels, each reducing the resolution to 1/4 of the previous level.

With this system the standard view distance is 2 km, with fog starting from 1.9 km. The old default was 500 meters, with fog starting at around 400 meters. Even though the view distance is 4 times larger, the polygon count is about half and the performance is a lot better. The engine really flies, even on the Intel on-board.

I also optimized loading a bit and it should be better. This is still C# and the garbage collector really hates to run with a lot of RAM use and no free system RAM, so for best results please make sure that you have about 1 GiB of free real RAM on the system before loading a map. If this is true, loading becomes really fast. If you have low RAM, loading can take 4-10 times as much as normal. Why did I ever leave C++?

This is also the best behaved version RAM wise ever. Pooling is far better and no longer are resources held onto more than needed.

The system can handle more than a 2 km view distance. The batch count is not great, but it works. Let's start with the bad: heights! If you are somewhere very high, there isn't any level geometry to block your view and everything you see is bellow and the view distance seems very low. The 4 km view distance barely seems higher than the 2 km one:


Yup, that is 4 km! Seems so low. Here is the same shot with another style of fog:


On the other hand, if you are low, the view distance is really great. Check out this shot where the peak far away in the distance above the cursor is a 4 km from you:


So how can you fix the problem with heights? One solution would be to make sure that from all high points, there is high level geometry somewhere in the distance hiding the unwanted effect. A lot of games use this, but this is very difficult if you don't have an artist designing the terrain. My terrain is procedural. Another solution would be to further increase the view distance.

My LOD scheme scales very well the number of polygons with view distance. What it does not scale is the number of draw calls. The amount of draw calls is the same as if there wasn't any LOD scheme. What does this mean? It means that if you don't care about interactive framerates and the amount of draw calls, with the current system you can have impressive results:


Te above screenshot is a 64 square km map without fog viewed from a height of 4 km. It has 546k polygons, 5335 draw calls, 11 MiB mesh data and runs at 17 FPS. The only value that is not great here is the draw call count and in consequence the frame-rate. It is actually abysmal. So the second generation LOD method will try and do something about the number of draw calls.

So Snapshot 11 is mostly view distance eye-candy and a better performance overall. And very buggy. In Snapshot 10 the bugs were accidental. This time, I know about them but did not have time to fix them. Basically, all the bugs are related to the fact that the terrain editing features were not designed with LOD in mind. Try to edit a chunk with a lower LOD: crash!

I'll fix these bugs by snapshot 12, so fell free to skip this one.




BY AGREEING TO DOWNLOAD THIS SOFTWARE, YOU TAKE TOTAL RESPONSIBILITY FOR ANY CONSEQUENCE RESULTING FROM THE USE OR MISUSE OF THE SOFTWARE. I AM NOT TO BE HELD RESPONSIBLE FOR ANY POSSIBLE HARM THAT CAN BE CAUSED BY THE SOFTWARE NOR DO I GUARANTEE THAT IT IS FIT FOR ANY PARTICULAR PURPOSE OR THAT THE INTEGRITY OF THE SOFTWARE WILL BE PRESERVED WHILE BEING TRANSFERRED ON ANY AND ALL MEANS OF COMMUNICATION.

ALL RESOURCES INCLUDED FALL UNDER MY COPYRIGHT AND ARE ORIGINAL CREATIONS, EXCEPT FOR THE TERRAIN, GRASS AND SKYBOX TEXTURES, WHICH WILL BE REPLACED SOON WITH ORIGINAL OR OWNED CREATIONS. FULL LIST OF BORROWED ASSETS:

  • data\textures\bush: grass01.c.dds, grass02.c.dds, grass03.c.dds, grass04.c.dds
  • data\textures\terrain: region1.c.dds, region1.n.dds, region2.c.dds, region2.n.dds, region3.c.dds, region3.n.dds, region4.c.dds, region4.n.dds
  • data\textures\skybox: clouds-back.c.dds, clouds-front.c.dds, clouds-left.c.dds, clouds-right.c.dds, clouds-top.c.dds

Link: Snapshot 11

3 comments:

  1. Didn't all this start as a potential alternative to Dwarf Fortress? What has all this mutated into ? Is the project dead now ?

    ReplyDelete
    Replies
    1. Yes, I did start as that but I moved away from that a long time ago and I did announce it back then. Anyway, the reception for that endeavor was negative to say the least. More like "you want to make a shameless clone and take the food away from Toady's mouth". So I'm done with that forever.

      Now it is about something else, more like a procedural generated and populated large landmass, where everything you can see and interact with is craft-able and destroy-able, with the goal to attract a large population of NPC characters around your settlement and keep them alive and happy in an almost unfairly hostile environment. With permadeath and volunteered retirement if you want to change characters on the same save.

      Unfortunately, life is really kicking my ass right now with the amount of responsibilities it trows my way these days. And I traditionally don't work in December.

      I'm hoping that in February-March I'll be able yet again to go back to the weekly release schedule.

      Delete
    2. "Now it is about something else, more like a procedural generated and populated large landmass, where everything you can see and interact with is craft-able and destroy-able, with the goal to attract a large population of NPC characters around your settlement and keep them alive and happy in an almost unfairly hostile environment. With permadeath and volunteered retirement if you want to change characters on the same save."

      Sounds awfully familiar. Sure you aren't moving away from Dwarf Fortress clone?

      Delete