Barotrauma

Barotrauma

1,822 ratings
Performance Fix
18
9
4
8
8
7
12
2
2
6
3
3
5
5
4
3
3
2
2
2
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
27.017 KB
30 Dec, 2021 @ 1:28pm
15 Jun, 2023 @ 10:12am
26 Change Notes ( view )

Subscribe to download
Performance Fix

Description
This mod will work in any vanilla or modded server that you join, regardless the server having the mod on or off

What is this

This is a very experimental Lua mod, so expect that things may break.

This is mod can greatly improve performance, it works by decreasing the amount of map entity updates, which can greatly improve performance. In my computer, i noticed that my fps nearly doubled after decreasing the updates by 4 times.

This has the potential side effect of making some items act weird, i made an item update priority system to try combat this, so important items update normally, if you have issues with some items acting weird, you can try putting the item's id in the priority list.

This mod also has a config that disables shadow casting lights globally, so if your computer struggles with lightning, try enabling that config.

How to install

Notice: If you only want to boost server-side performance, you don't have to install client-side Lua, and only requires LuaForBarotrauma to be installed on the server.

If you have client-side LuaForBarotrauma installed and wants to update it, press the "Remove client-side Lua" button in the main menu and then do the installation process again.

Windows installation:
This installation is for both multiplayer and singleplayer!

  • Subscribe to Lua For Barotrauma
  • In the setting menu enable LuaForBarotrauma.
  • Select the ServerExecutable to be equal to the LuaForBarotrauma executable
  • Host in-game server
  • While hosting, open the console window (most commonly 'F3')
  • Type in or copy, then execute the console command:
    install_cl_lua
  • Restart the game

Video if you are not able to understand the instructions above: https://youtu.be/wEeJ70vH1TM

Warning: everytime you verify the integrity of the game files or a new update is released, you will need to do the process again.


Linux/Mac installation:
You will have to manually install LuaForBarotrauma, you can follow this guide[evilfactory.github.io],
warning: mac version isn't tested, so it can be unstable.

If something breaks, just verify the integrity of the game files to undo the process.

Submarine builders: You can tag a button component with "performancefix" and that will make it output the map entity update interval continuously. You can also tag components with "highpriority" which will automatically put them in the priority list.


Configuration

To configure the mod, simply use the console command performancefix to open a GUI menu.
To use the command while in the mainmenu, type cl_reloadlua before using the command

reloadlua - Use this command to reload the script in the server-side, it will reload the script, applying the new configuration.

showperf - Useful command to see what is causing performance issues.


Results
(note: these tests been done a few years ago and haven't been updated, so they are probably inaccurate)
I tested the mod in a few servers and submarines that i know that lag a lot:

My specs for comparison: Ryzen 3200g, AMD Vega 8 gpu, 16gb ram 2667mhz

- ECS Argonaut: with 19 players on: 20-25 fps => 40-55 fps, with map entity divider equal to 4

- Vengeance Mk III: local server with me only: 13-16 fps => 38-43 fps, with map entity update divider equal to 4 and shadow casting lights disabled

- The Red Planet: local server with me only: 17-25 fps => 43-60 fps, with map entity update divider equal to 8

- SMS Olympus: local server with me only: 10-14 fps => 28-34 fps, with map entity update divider equal to 2

- SMS Olympus: local server with me only: 10-14 fps => 40-47 fps, with map entity update divider equal to 4

- SNN Cruiser: with 17 players on: 8-12 fps => 25-33 fps, with map entity divider equal to 8

- Juna: local server with map entity divider equal to 4:
Client-side: 15-19 fps => 41-47 fps
Server-side: CPU usage dropped from 24% to 8-12%


I plan on adding more performance options in case i find more ways to optimize the game.

Popular Discussions View All (5)
40
14 Dec @ 3:49am
List of items that can act weird
Evil Factory
16
11 hours ago
Suggestions & Feedback
アンジェル
2
4 Jul @ 3:55am
Any tips for optimizing my settings as the host of a server with mods?
Penguito ur BFF
691 Comments
Azure 13 Dec @ 9:57pm 
I suggest adding Projectile and TriggerComponent into High Priority Components
Projectile affects all bullets most noticeable flak cannon
TriggerComponent affects Alien Current Generator at least
Joe Mc'Murray 12 Dec @ 1:17am 
*STILL* works completely perfectly, im in a HUMONGOUS prison transport sub with a full bot crew, friends, and im docked at a huge city with Dynamic Europa on and even post update this stopped the lag completely for the host who is me and my boyfriend who is on a $200 computer. we were lagging a bit before i reinstalled this mod, we got to the city and his game was dying, so we installed it and voila its back to running perfectly. this game is made perfectly i have found no problems that i didnt cause or couldnt fix myself.
The Viral Divinity 2 Dec @ 6:24am 
Actually tweaking this mod to be less extreme makes it run better lol, maybe if you're having problems try toning this mod down or straight up removing it, seems to do more harm than good if apparently the game runs better now.
The Viral Divinity 2 Dec @ 6:15am 
The increasing amount of people complaining about massive issues only cements my point, that this game might be fun, but it's so badly made that it isn't, yet apparently my pc that only uses around 16% RAM, 35% CPU, and 9% GPU is the culprit lmao, according to any and every developer of this game, when all I smell is an echo chamber that's slowly killing this game that lots of people (also me included) love.
The Viral Divinity 2 Dec @ 6:12am 
Never seen The Great Ocean or the one past it, but since MY game doesn't lag for part of it, maybe it isn't my pc's fault, or even the mod's fault, but the game? Maybe it's that this game is so horribly optimized and wretchedly coded, every time you launch it and verify files 2 to 10 may need re-verifying, every single time you try to. No other game that I own on the steam market is this buggy or laggy, period, so it definitely isn't my computer, this is on either the game itself or their fucking 4 year old servers.
The Viral Divinity 2 Dec @ 6:12am 
Yeah this seems to do next to nothing.. It used to at least somewhat work, but I find that now it next to never improves frame rate. I've also done things in the NVIDIA control panel, etc, but after going to the Aphotic Plateau the game just completely shits itself no matter what I do.

I also love how no matter where you look, everybody either blames the mods or your own pc, when that isn't the case because a lot of people don't play with mods, and most gamers (me included) have higher end rigs, you have to for modern games. Not only that, but I play heavily modded (50+) and encounter next to zero issue until I get to this biome, or sometimes a bit before that, and then the game becomes unplayable.
Joe Mc'Murray 27 Nov @ 11:51pm 
Still works perfectly, im in a prison transport sub with terrorist, cultists, full bot crew, and friends, this stopped the lag completely
MoonShi 27 Nov @ 5:47am 
This mod doesn't mean to be working perfectly out of the box, you have to tune it manually for better results. Im using it with large amount of mods, and i doesn't encounter any lag spikes, make sure that you installed Lua Correctly.
luizbiel 17 Nov @ 3:13pm 
Lag spikes every so often (started a singleplayer campaign with just this mod, every 40 seconds or so game would freeze for a couple seconds, hadn't left first station yet)
Default settings cause eggs to often twin entities they spawn, up to 4 entities (mudraptor egg advancing stages, petraptors hatching, psilotoads, ect)
dissecthem 13 Nov @ 2:29pm 
Physics keeps going from 60-1 and I’m getting crazy lag spikes. Can anyone help please