1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

DevBlog - Optimizing Models & LOD's

Discussion in 'Infestation The NewZ' started by Hitliz, Sep 25, 2018.

  1. Hitliz

    Hitliz Executive Member
    Staff Member Executive Member Donator Member

    Aug 19, 2016
    Likes Received:
    Dear Community,

    Today we are going to talk about performance optimizations and current problems we are facing in the development of the game. I am personally spending a lot of time on this and at the same time it's very important this gets done. Before you guys see this in the patch notes I'd like to write a developer blog about the current status, how everything works and why we are doing this. In this developer blog I will do my best to explain everything as simple as possible so that everything is clear. In the end the most important is that you guys understand what we're working on and why that could take a lot of time. Now, let's jump into it.

    Short Explanation List:
    Before we jump into the actual blog I'd like to explain some short terms to make it easier for you guys to read in general:

    • LOD = "Level Of Detail". I will be referring a lot to "LOD" or "LOD's" and it basically defines the quality of a model. For example we will be using LOD 1, LOD 2, LOD 3 where each number means higher / lower quality.
    • Render Distance = The distance until an object / model in-game gets rendered. If the render distance of something is 600 meter than after 600 meter you won't see (render) that object anymore.
    • Faces / Vertices = Also known as "polys". All you guys pretty much have to know is that the more faces / vertices an object has the higher quality it probably is. At the same time the more faces / vertices it has the more performance drowning it potentially is. For more information about this I highly recommend to take a look at: https://www.mathsisfun.com/geometry/vertices-faces-edges.html

    The current "problems":
    Before I explain what we're working on I'd like to explain what the reason is why we're working on this and how it's going to improve the game. Let me list out all the current problems here:

    • A lot of original models currently used in the game are not optimized by default. (Aka have too many faces / vertices and are too big in file size)
    • A lot of models have incorrect LOD versions or don't have any LOD's at all.
    • Render distances have never been used correctly in the game until now: all objects had pretty much the same render distance.

    Now, as you probably can imagine is that we can go out from the following factor: "The more objects around / loaded / rendered around a player the less FPS / Performance he will have". This obviously also depends on his system etc but this is pretty much the most simple definition of the problem.

    Fixing the issues:
    A start I took with approaching and fixing this problem is starting with the render distance of objects. Please keep in mind that everything I am going to explain below IS NOT LIVE in the game yet and will be patched in the upcoming few patches. The good news is that render distances are already done. In the game we now have different render distances for different types of objects. For example: interior objects have less render distance than big buildings. In the end the render distances of objects is just a minor change. It will increase FPS and performance for players but not that much. In the end even the 5-10 FPS you will get more for this is worth it anyways so that's great!

    The second issue has been like this ever since the start of the game. A lot of original models (no idea why) are not optimized and feel unfinished. They are however, after all those years, still used in the game. Just to name a few examples: object where a zombie was spiced up on a spike had the same amount of vertices and faces as 1 five story building. Placing just 4 of these spikes would already drop 5 FPS. Insane! If you think about it. On top of that imagine that this object in the past had like a 600/800 meter render distance! Even if you were so far away from this player-sized object that you couldn't even see it, you were still rendering and loading those 12.000 faces and vertices. Again, that last part about the render distance is already fixed. In this example the render distance of the spikes would be around 300 meter, but that's not just it. Here's how we proceeded:


    So, we optimized the model. Sounds simple! It was quite some work unfortunately. Take a look at this:


    The funny thing here is that you don't even see that much difference! Trust me, the model looks exactly the same even though it's 4 times smaller and more optimized than the original model.

    Now, lowering the render distances depending on the model and optimizing the models isn't the only thing that I am working on. Obviously we can not always optimize a model because it might already be optimized and we also don't want to make the game look bad. Huge buildings for example have high amount of faces / vertices and can not really be optimized more unfortunately. Don't worry! There's 1 more thing (the best thing) that I still have to explain: LOD's.

    "LOD" means: "Level Of Detail" and simply define different versions of the model in different qualities. Just like with the render distances of objects where we grouped them up and set render distances depending on the group, we apply settings on the LOD's. How it works is as following: In New Z there is 4 different versions of a model:

    • Original Model.
    • LOD 1.
    • LOD 2.
    • LOD 3.

    Right now, in the current New Z build no matter what, players are always rendering the original unoptimized model. Insane if you think about it. You might be thinking "Well, that's nice, so what?" but the problem is that the game almost has no LOD versions of models. (probably because it was too much work) LOD versions depend on range (meters) a player is away from the object. To refer back to the zombie spike example this is kind of how it will work:

    • Original Model. (Loaded between 0-25m)
    • LOD 1. (Loaded between 25-100m)
    • LOD 2. (Loaded between 100-200m)
    • LOD 3. (Loaded between 200+ until render distance. For example: 600m)

    Here's how that would look visually:


    Just to make the whole "LOD" system easier to understand I've made a picture where you can kind of see how it works:


    And, to refer back to the zombie spikes model again: (Because for each object group / type these distances can variate)


    Now, simply said what happens if (going out from the fact that all the render distances are fixed) for example this zombie spike model has LOD's with the distances set above: the further the player is away from the model, the less the model will be in file size / vertices / faces, the more FPS the player will have. You might be thinking "But the second / third LOD version looks like sh*t" - I agree. But you will never be closed to those models than a 100-200 meters because when you get closer it will just load a higher quality version of the model. To prove my point:


    Can you see above what LOD version of the zombie spike you see there? No, you can't. This is from 120 meter distance. Why would you load the original model here with the 3000 faces and vertices, if you can load a model that only has 500 faces and vertices?!

    For the people that like to see more pictures: here's what I did working on LOD's for for example hedges or the diner building:



    Just now, Sven said:


    Did some work today on the most unoptimized building in the game. First of all I have optimized the original model (had 60.000 faces) and now has 45.000 faces. Also added LODs AND for the third LOD version, which is the one furthers away before the model unloads I have tried something new. You can see in the picture LOD 2 has 15.000 faces and LOD 3 500. Basically crazy optimizations. Applying this process to everything in the game, in the correct way, will literally give players crazy more FPS and faster loading times....


    Stay tuned for more!

    Summarized up:
    For the people that don't like to read everything explained above: Simply said we will create LOD's for every model of the game, we will fix the render distances and we will optimize the original models of the original game more and better. This is a procedure that will take a lot of time (if you want to know why read above) and therefor this developer blog is created to give a better understanding to players and our community.

    In the end mostly by fixing 1 object won't really make a difference but everything together will give A HUGE performance boost to players. It's a lot of work but has to get done. (Oh it will also make your loading times 10000x faster)

    I did my best explaining everything as clear as possible. Feel free to let me know in the comments if you don't understand anything. It would be appreciated if you could give a heads up by commenting what you think of this!

    Best Regards,

    // Sven

    // The New Z - Development Team

    Continue reading...

Share This Page