What causes server lag and why you should care.

Discussion in 'Naval Play Discussion' started by Animefan162a, May 29, 2018.

Thread Status:
Not open for further replies.
  1. Animefan162a

    Animefan162a Member
    Server Administrator

    Joined:
    Apr 23, 2016
    Messages:
    120
    Likes Received:
    11
    Greetings everyone, I find it rather absurd and frustrating that I even have to write this but the new players frequently complain about lag without understanding anything about it's nature. Now I will admit I am not an expert on lag, but this is what I've figured out from my 5 years playing here.

    Lag on Naval Play 2 (hereafter referred to as "NP2") is caused by 2 main factors: Collisions, and Constraints. Both of these stress out not only the Server Hosting Software (hereafter referred to as "SHS") but also the Source(tm) Physics Engine itself (hereafter referred to as "SPE"), more on that in a moment.

    Collisions are basically how two (or more) props collide or forcefully repel each other based on the physics rules as set out by the SPE. The SPS and SPE need to calculate collisions on every prop, on every vehicle, every second.

    Constraints are basically physical interactions made between props by tools such as Weld and No-collide, the SHS and SPE need to make calculations based on how many constraints between every prop, on every vehicle, every second.

    Now let's discuss the SPE, this has a maximum set number of collisions and constraints it can smoothly calculate at one time; go over this maximum, and the server will start to lag.

    This is further limited by the SHS, weaker SHS or a lower allocation of CPU on a Hosting Server means it takes even less collisions or constraints to lag the gamemode.

    So basically it comes down to this, the SHS and SPE have a certain amount of collisions and constraints they can handle, EVERY player contributes to this. So that means if you have a vehicle that has a a lot of collisions, or a large amount of constraints, you're taking away the allocation of server and engine power the other players can have. Collisions are generally just bad, and you should avoid having many by proper use of the nocollide tool to ensure that props are not colliding with each other unless you absolutely need them to be. Constraints are unavoidable and a natural part of the gamemode: however if a player has a 1000 constraint ship, that takes up the server/engine load of 2 or 3 other players that might have 300 constraints on their ships.

    I know it sucks to be singled out by a Staffmember and be told "You have too many collisions, go back to harbour and nocollide" or "You have too many constraints, go back to harbour and optimise", but in the end it comes down to we're stuck on an old physics engine that can't handle much and we need to be fair and courteous to other players by making sure our vehicles cause as little lag as possible. As you spend more time building, you will figure out how to make your vehicles as durable and stable as possible with the most minimal impact on the server; until you reach that level of experience I suggest you keep your vehicles simple and straightforward.

    Thank you for reading,
    - Animefan162a
     
Thread Status:
Not open for further replies.

Share This Page