Hi,I have a question: Will the plugin make server lag?
thanks
Hi,I have a question: Will the plugin make server lag?
To answer this question, the term "lag" needs to be defined. Usually when people ask about lag, they are talking about lag spikes, particularly short bursts where the server is frozen. Plugins cause lag spikes when they try to do a lot of computation in a short amount of time. That usually happens for one of the following reasons.
- Plugin has a "slow" function which is called sometimes. Each time a "slow" function is called, you may see a lag spike.
- Plugin has a "fast" function which is called often. If a "fast" function is called many times in a short period of time, you may see a lag spike. If a "fast" function is called many times, but spread out relatively evenly over time, you won't see a lag spike, but you may see an overall FPS reduction.
This plugin falls more into the second category. The way this plugin works is that it subscribes to every damage event, and does a very small amount of computation for each of those events. That computation determines whether the damage amount needs to be changed (depending on whether it's explosion damage), and potentially changes the damage amount. Practically speaking, damage events don't come in very large bursts, meaning you will see maybe a few dozen damage events per frame. The small cost of processing each damage event, multiplied by the relatively low frequency of damage events, is not sufficient to cause lag spikes.
Also, in the extremely unlikely case that so many damage events are occuring to the point where this plugin would cause a lag spike, at the same time, the largest contributor to the lag would actually be the vanilla game, since when entities take damage, Rust has to do several expensive things such as send network messages to nearby players in order to synchronize their games with the object's new health.