Tips N Tricks for MP-Servers

    Tsnonak

    Let's Kautsch!
    Joined
    Dec 14, 2014
    Messages
    242
    Reaction score
    252
    • Purchased!
    • Community Content - Silver 1
    • Legacy Citizen 5
    This is a broadcast message from your local server, please do not adjust the screen...

    Last Update: Feb. 19., 2020
    Game version: 0.202.87

    This thread is an attemp to raise the quality of life for server-owners, administrators, and players!
    StarMade is in Alpha, not optimised and buggy, there some things you should (maybe) know.

    Player count plays a big role in how much is going on at the same time all over the universe.
    All sectors around the player-sector (27 total), are loaded /unloaded as players gallivant through the universe.

    Here are some tips for running a smooth server, Starting with the server.cfg.
    These are some of the settings we use on the LK-server...

    CONCURRENT_SIMULATION = 8 // Reduce the default number.
    BLUEPRINT_DEFAULT_PRIVATE = true // This should always be true on public servers.
    DEFAULT_BLUEPRINT_ENEMY_USE = false // This should always be false on public servers.


    Some tips for keeping npc interaction interesting instead of painfull...
    AI_ENGAGEMENT_RANGE_OF_MIN_WEAPON_RANGE = 0.5 //brings AI closer to players, helps with grueling chases

    NPC_LOADED_SHIP_MAX_SPEED_MULT = 0.5 // ships that are too fast(custom npcs) are grueling to catch, slow them down some


    AI_WEAPON_AIMING_ACCURACY = 200 // This is a little low and allows for AI errors (1000-2000 has been common on servers in the past)
    current v0.202.86 release seems intent on setting this back to default 200 for singleplayer, seems ok for servers*

    Asteroid Problem:
    Do not make asteroids too big, but if you really want them I recommend not bigger than MAX = 128
    ASTEROID_RADIUS_MAX = 128

    Turn asteroid respawn off, last tests duplicate asteroids are still prevalent in v0.201.378
    They often enter endless loops of crashing, warp away, return and crash again, or they jitter verry strangely in an endless collision-cycle.
    ASTEROID_SECTOR_REPLENISH_TIME_SEC = -1 // -1 = OFF

    crashing asteroids can be problematic @ default settings...
    If you leave asteroid-respawn on: do not increase from default settings, (smaller is ok), but it may still cause problems on busy servers!



    PLAYER_MAX_BUILD_AREA = 30 // Brush sizes that are too big can cause problems depending on your rig and player count
    Players setting 50x50x50x8 blocks at a time is going to cause problems!


    CHUNK_REQUEST_THREAD_POOL_SIZE_CPU = 3 // Adjust as needed, Rule of Thumb is number of proccessors - 1

    ONLY_ALLOW_FACTION_SHIPS_ADDED_TO_FLEET = true // This should always be true on public servers

    Prevent Logic-bombs: we have had no problems with players needing more than this in almost two years of service.
    MAX_LOGIC_SIGNAL_QUEUE_PER_OBJECT =10000
    MAX_LOGIC_ACTIVATIONS_AT_ONCE_PER_OBJECT_WARN = 8000
    MAX_LOGIC_ACTIVATIONS_AT_ONCE_PER_OBJECT_STOP = 10000


    Turn NPC factions off:
    NPC_FACTION_SPAWN_LIMIT = 0



    The GameConfig.xml: set max-limits and adjust start-inventory.
    The following has been copied from another post...

    "
    I have played on servers that had no lag reduction policies, it didn't end well.
    I have played on a server with an enforced turret count limit and mass limit, it was the most stable I ever played on.

    Fact is, StarMade doesn't have a hard cap for ship size and docked entity count, but the game's engine and server/player hardware definitely has a softcap.
    "


    PATH: \Starmade\GameConfig.xml


    Max ship / station size / mass-limits:

    <MaxDimensionShip>
    <X>600</X>
    <Y>600</Y>
    <Z>600</Z>
    </MaxDimensionShip>

    <MaxDimensionStation>
    <X>2000</X>
    <Y>2000</Y>
    <Z>2000</Z>
    </MaxDimensionStation>

    <ShipLimits>
    <Mass>250000.0</Mass>
    <Blocks>2000000</Blocks>
    </ShipLimits>

    <StationLimits>
    <Mass>2000000.0</Mass>
    <Blocks>5000000</Blocks>
    </StationLimits>

    Max weapon / support systems can also be set: ID_list

    <GroupLimits>
    <Controller>
    <ID>4</ID> // ID of the computer
    <GroupMax>125</GroupMax> // MAX allowed groups
    </Controller>
    <Controller>
    <ID>4</ID>
    <ComputerMax>2</ComputerMax> // MAX allowed computers
    </Controller>
    </GroupLimits>

    What does Schine say about Salvagers:
    SALVAGER-DETAILS.jpg

    Add a blueprint to start inventory:
    <Blueprint>
    <Name>STARTER_SALVAGE_CRAFT</Name>
    <Filled>true</Filled>
    <Slot>inventory</Slot>
    </Blueprint>




    NPC Faction Problem:
    "they are the most destructive feature of this game in terms of server stability"...

    They accumulate in masses when left unchecked.
    They leave docked parts all over the universe.
    They grow too fast and crash too much.

    regular cleansing of the database via admin-commands / scripts is recommended, best time is right before or after restart.
    Note, if this has not been done and the world is older or already full of NPCs this can cause a server crash and possibly death!

    /despawn_all MOB_ all true
    /despawn_all FLTSHP_ all true
    /despawn_all GFLTSHP_ all true
    /despawn_all GNPCFLT_ all true
    /despawn_all [System_ all true

    You may / or may not want to adjust NPC-Faction-growth in the appropriate npc-faction-folders...

    Initial territory is set with the npcSpawnConfig.xml...
    PATH: StarMade\data\npcFactions\npcSpawnConfig.xml

    <InitialGrowth>-1<!--How many systems are initially taken--></InitialGrowth>
    -1 is random generation, remove the (-) minus to give the faction 1 InitialGrowth-system, (they will start with 2 systems*).

    Reduce Faction-turns in the npcConfig.xml...
    PATH: StarMade\server-database\YOUR_WORLD\npcFactions\faction\npcCofig.xml

    (line 287*)
    <TimeBetweenTurnsMS>9000000<!--Time between faction turns in milliseconds--></TimeBetweenTurnsMS>
    We've just added another 0 to make it 9 million instead of 900,000 milliseconds.


    NPCs / Pirate:

    When replacing NPC assets always remember to have them in-place before running the first time!

    Currently Pirate stations will bug-out if they are updated: updated-pirate-stations

    Regular NPCs are not affected by this, (to my knowledge*).
    Updated NPC Assets



    Hardware:
    The most important thing to consider when selecting hardware: above RAM or SSDs, is CPU-clockspeed.

    Golden-Rule:
    "Don't just throw more RAM at the issue, or a faster SSD or anything like that unless you're sure those are the root cause of your performance issues." therimmer96™

    ISP: Good Bandwidth is also important.

    Server-[RAM]-Settings according to Schine™:
    4-8 G ist the sweet-spot for Java (depending on the system, (more than 8G can have negative effects & always in multiples of 2*)).
    Only add more if you have ca. 10 players constant w/ restarts 8 - 12 hours.

    suggested-server-settings: java -server -Xms1G -Xmx8G -jar StarMade.jar -server
    Keep start-RAM [Xms] low.



    The following has been copied from another post...
    I do not have the resources or time to validate everything stated below, but can confirm that it still applies to an extent today.

    "The simplified version of the multitude of problems of running a server at that time"... ca. 2015
    1. It took an absurd amount of bandwidth spiking in excess of 500mb/s for the roughly 50-60 people online.
    2. It took an absurd amount of disk space. The server would grow by as much as 5GB per day, if left unattended.
    3. The server was in a constant state of very low performance even when run on top of the line hardware.
    4. The server would implode if no admin was on to watch it 24/7 due to people doing seemingly simple mistakes like getting too many ships near each other, or having too much stuff near a planet.
    5. The catalog getting corrupted was nearly a daily occurrence.
    6. Sectors would randomly corrupt themselves.
    7. Planets, asteroids and NPC stations / shops would disappear or randomly move (ghost stations are still a thing*)
    8. Unrecoverable crashes at least 1 time a month resulting in rollbacks
    9. Admin commands were basically useless since they either didn't work, or reported invalid information, or sometimes crashed the server.
    10. The sheer volume of log output could cripple the server if not running on SSDs.


    Gigantism:

    Is still a big problem for MP-servers...
    Giant bases and ships with high block count / mass cause server / client lag.

    With the introduction of chambers in P2.0, reactors themselves have also become lag bombs...
    changes to reactors / chambers in the tens to hundred thousands can cause server spikes in the thousands!

    Changes to giant entities can cause server spikes!
    Giant ships flying through space cause lag...
    it is best to avoid gigantism, and inform players of the problems it causes.





    Full list of Admin Commands

    Feel free to post anything affecting server-stability that you have encountered below , thanks for your participation!


    Brierie:heart:

    WIP*

    See you in Space!
     
    Last edited:

    therimmer96

    The Cake Network Staff Senior button unpusher
    Joined
    Jun 21, 2013
    Messages
    3,603
    Reaction score
    1,046
    At the end of the day, the thing that has the most impact on performance above any of the things listed here is to have appropriate hardware.

    Starmade, and most game servers for that matter, is largely single threaded. If you're shopping for hardware directly, find the CPU with the best single thread performance you can afford and use that. If you're using a Game Server Provider <Cough>PingPerfect.com*</Cough> and you're having performance issues, contact their staff and find out if you can upgrade to a higher clock speed system/tier. Especially if your performance issues occur during moments of combat, collisions and the likes.

    Don't just throw more RAM at the issue, or a faster SSD or anything like that unless you're sure those are the root cause of your performance issues.
     
    • Like
    Reactions: Tsnonak

    Tsnonak

    Let's Kautsch!
    Joined
    Dec 14, 2014
    Messages
    242
    Reaction score
    252
    • Purchased!
    • Community Content - Silver 1
    • Legacy Citizen 5
    At the end of the day, the thing that has the most impact on performance above any of the things listed here is to have appropriate hardware.

    Starmade, and most game servers for that matter, is largely single threaded. If you're shopping for hardware directly, find the CPU with the best single thread performance you can afford and use that. If you're using a Game Server Provider <Cough>PingPerfect.com*</Cough> and you're having performance issues, contact their staff and find out if you can upgrade to a higher clock speed system/tier. Especially if your performance issues occur during moments of combat, collisions and the likes.

    Don't just throw more RAM at the issue, or a faster SSD or anything like that unless you're sure those are the root cause of your performance issues.
    thanks, and quite correct, hardware stuff also plays a big role!

    At the end of the day, StarMade is known to bring top-line hardware to its knees...
     
    Last edited: