DrVrej / VJ-Base

An addon for Garry's mod that contains bunch of bases to make many different types of addons.

Home Page:http://steamcommunity.com/sharedfiles/filedetails/?id=131759821

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Server Performance Question

d4kir92 opened this issue · comments

commented

we figured out that this base is causing massive lags, would be nice to get a fix for that
image
(20+ players on server and some npcs)

i saw in the code that in several Think/Calcview
image

maybe that would fix one of the problems, only set the variable when it is changed
image

also you use NW2Vars but the devs recommend to only use NWVars, maybe you used NW2Vars because you noticed that NWVars break with more players, thats only happens when addon is using net messages, nwvars in think functions (spamming net messages or other network related things)

commented

To answer your question, I'll explain it in a list format:

  1. Scripted NPCs in GMod are limited, over 50% of the lag caused by them is from the engine rendering itself, which I have a video explaining this. There is nothing that modders can do about this.
  2. First code: It's irrelevant, only runs when an NPC is being controlled by player which I doubt you are doing in a large server.
  3. Second code:
    • Those used to be NWVars but I later converted them to NW2Vars. As described by the GMod developers themselves, they are much more optimized and efficient. I did tests last year, and confirmed it. So I will have to kindly disagree with the devs that told you otherwise. GMod Devs + My testing > random devs.
    • For your if-then suggestion, I will test it and apply it if it causes less performance.
  4. Lastly, I want to point that I know many large server owners who use VJ Base, and they don't encounter this issues, I don't run servers, so I am not sure why that might be. Performance drops could be accelerated when certain other mods are present.
commented

yes, thats not the only addon that is causing our problems, i just try to find and try to help/fix the problems
so it will be less data/spam over the network, when not really needed :D

commented

The small optimization that you suggested has been applied in 7e16016