Rust Limit trees and animals

Discussion in 'Plugin Requests' started by cenk, Mar 21, 2015.

  1. hello

    Is there any way to limit trees and animals in server or auto delete half of them or all of them when they reach to limited amount. I just notice that; when I delete trees and animals save file drop from 3mb to 1.5mb and also server cpu usage drop from %9 to %1,24

    For example currently auto spawn trees about 17000 and animals abt 170
    I would like to limit them 10000/80
     
  2. no idea if it's possible
    you can block them on SPAWN, but as it will check EVERY spawns, and when they spawn it SPAMS i'm not sure it's a good idea, in LUA it made a mass lag, maybe in C# it would also.
    Only way would be to edit the number from the procedural spawns, but i have no idea how to do that.
     
  3. probably same reply just for take attention of other members;

    there are abt 17.000 trees and 175 animal in game
    If you clean all trees and animals they will respawn in 2min but it will not spawn more than 17K trees + 175 animal which means that; game engine have limit for this amount and there should be way to decrease it.

    I create additional 400 animal + 1000trees

    After server started all additinal animals and trees was there(i.e. total 18K trees + 575 animal)

    When I clean both, they respawn up to 17K trees + 175 animal again

    In the light of above said I can say that;
    - You can create additional animal and trees but more than 300animal create huge lag
    - Even you clean all or half of them they will respawn up to limited amount (i.e. 17.000 trees + 175 animal)

    As I say in above, check about the save file before clean and after clean.
    my 3,1mb save file drop 1,24mb
    Also server cpu usage drop from %9 to 0,2%

    If we can change tree and animal limit (i.e. as decrease to 10K trees + 100animal) it will be definetly assist to avoid lag and will increase server performance
     
  4. What world.size is this on? As on my 2000 world the limit on animals seems to be 53, and now after some modifications it seems to be 3, which makes no sense as I thought I had changed it to 10 so there is something I'm missing xD
     
  5. I'm not sure if this could possibly help you, but I've used it to INCREASE the trees/nodes/animals on my server. It has to be typed in console:
    • spawn.min_rate # (default .1)
    • spawn.max_rate # (default 1)
    • spawn.min_density # (default .1)
    • spawn.max_density # (default 1)
    I think it applies to all resources evenly, and be careful not to set it too high, because of lag. I don't know if you could set it to .05 or something, I haven't tried, but I don't see why not.
     
  6. sorry for late reply
    world size is standard 4000x4000= 16sqm
    [DOUBLEPOST=1426977914][/DOUBLEPOST]
    - with standard 4000x4000=16sqm map, If you restart the server there will be about 170 animals and 17.000 trees
    - My server last wiped on 5th March and currently save file 3.2mb with %9 cpu usage + 1,7gb ram(while couple of players online)
    - If you decrease amount of animal and trees, your save file and cpu/ram usage will be greatly decrease

    - What I did;
    under current circumstances(i.e. 3,2mb save file + %10cpu usage + 1,7gb ram usage) installed clean&count plugin and typed followings in server;
    /clean animals 1
    /clean trees 1
    - get information message as "abt 170 animal and 17000trees deleted"
    - typed save.all in console and checked save file size and notice that; it decreased from 3.2mb to 2.1mb also cpu usage drop drown from %9 to %0,26 and ram usage decreased from 1,6gb to 1,04gb
    - normally animals re-spawn completely in 3-4minutes but trees will re-spawn completely in about 15min therefore, waited 15min
    - then again typed save.all in console and checked cpu+save file (no surprise it's jump to 3.2mb with %10 cpu usage + 1,7gb ram usage again)

    - In order to decrease %50 of animals + trees I just typed following in console;
    spawn.max_rate 0.5
    spawn.max_density 0.5
    - then in order to clean everything and re-spawn with new limits typed in game followings;
    /clean animals 1
    /clean trees 1
    - Waited 1hr for check the number of animals and trees
    - Result is;
    about 88 animals + abt 8000 trees with lag free server :)

    - As prettyflower girl advise that; default settings as follows;
    spawn.min_rate 0.1
    spawn.max_rate 1
    spawn.min_density 0.1
    spawn.max_density 1
    - I just changed;
    spawn.max_rate 0.5
    spawn.max_density 0.5

    (I try several variation such as increase rate from 0.1 to 500 then after perform same to the density as well and after 1hr work notice that bot of above need to be modify)
    Result:
    + Improved performance(i.e. cpu usage drop down from %9 to %1,3 also ram usage drop down from 1,7gb to 1,22gb)
    + decreased save file size(i.e. drop from 3,2mb to 2.1mb which will be perfect for avoid stack size problem with huge save file)
    - less animals might cause angry players
    - less trees but i don't think that it will be problem

    Re-appreciate prettyflowerfirl for assistance

    In order to avoid to do it every server restart you can type in command line;
    +spawn.max_rate 0.5 +spawn.max_density 0.5
    If your server provider does not allowed to it, don't worry - just type same near the server map size - for example as follows;
    Map size: 4000 +spawn.max_rate 0.5 +spawn.max_density 0.5

    Needless to be remind that; 0.5 is my opinion for decrease the amount %50. you may want to decrease less than %50 then in this case instead of 0.5 use 0.6 or 0.7 or 0.8 or 0.9 which should be less than default value 1 - Also you may increase the size instead of decrease(i.e. for small maps) then you can type 2 instead of default value 1 which will be increase amount of animals + trees
     
    Last edited by a moderator: Mar 21, 2015