Space Engineers

Space Engineers

Not enough ratings
Laser Welders Reloaded Configuration Guide
By Cheetah
A guideline to configuring Laser Welders Reloaded.
   
Award
Favorite
Favorited
Unfavorite
Intro
Laser Welders Reloaded comes with a comprehensive configuration system that allows to tweak almost all subsystems of the mod, from beam colors to CPU usage limitations, without touching the code.

Here's a short list of tweaks supported by the configuration system:
General tweaks:
  • Linear power consumption tweaking
  • Non-linear power consumption tweaking
  • Energy savings via "Speed Multiplier" feature
  • Drilling (enable/disable)
  • Maximum concurrent tool updates
  • Combat usage denial system (enable/disable)
Per tool tweaks:
  • Maximum supported beam length
  • Blockworking speed
  • Blockworking area of effect
  • Drilling area of effect
  • Drilling speed
  • Drilling yield
  • Maximum supported Speed Multipier
  • Beam coloring.

All these tweaks are adjusted on a per world basis through an XML-like configuration file.
After the configuration file is changed, the configuration can be updated without restarting a world using the following commands:

/laserwelders reloadsettings
or
/lw reloadsettings

Access to these commands is restricted to Admins and Owners.
The configuration file
The configuration file is separate for each savegame, and thus is located in the save's Storage folder.

The Storage folder's location is slightly different, depending on whether the mod is running on a regular game or on a dedicated server.

For most installations, the path will be:
%AppData%\SpaceEngineers\Saves\<your Steam ID>\<your world name>\Storage\1694721473.sbm_LaserWeldersV2

For dedicated servers, the path will be:
%AppData%\SpaceEngineersDedicated\Saves\<your world name>\Storage\1694721473.sbm_LaserWeldersV2

In both cases, the configuration file is an XML file resembling the game's own '.sbc' files. It can be edited with a standard Notepad; Notepad++ is preferable, though.

The configuration file will have the following format:

<?xml version="1.0" encoding="utf-16"?> <LaserSettings xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <Debug>false</Debug> <PowerMultiplier>1</PowerMultiplier> <PowerScaleMultiplier>1.2</PowerScaleMultiplier> <ToolTiers> <dictionary> <item> <Key>LargeShipLaserMultitool</Key> <Value> <ToolSubtypeId>LargeShipLaserMultitool</ToolSubtypeId> <MaxBeamLengthBlocks>8</MaxBeamLengthBlocks> <WeldGrindSpeedMultiplier>1</WeldGrindSpeedMultiplier> <WelderGrinderWorkingZoneWidth>2</WelderGrinderWorkingZoneWidth> <DrillingZoneRadius>2</DrillingZoneRadius> <DrillingVoxelsPerTick>4</DrillingVoxelsPerTick> <SpeedMultiplierMaxValue>4</SpeedMultiplierMaxValue> <DrillingYield>1</DrillingYield> <InternalBeamColor> <R>245</R> <G>245</G> <B>245</B> </InternalBeamColor> <ExternalWeldBeamColor> <R>12</R> <G>127</G> <B>242</B> </ExternalWeldBeamColor> <ExternalGrindBeamColor> <R>230</R> <G>20</G> <B>20</B> </ExternalGrindBeamColor> </Value> </item> <item> <Key>SmallShipLaserMultitool</Key> <Value> <ToolSubtypeId>SmallShipLaserMultitool</ToolSubtypeId> <MaxBeamLengthBlocks>20</MaxBeamLengthBlocks> <WeldGrindSpeedMultiplier>1</WeldGrindSpeedMultiplier> <WelderGrinderWorkingZoneWidth>2</WelderGrinderWorkingZoneWidth> <DrillingZoneRadius>2</DrillingZoneRadius> <DrillingVoxelsPerTick>4</DrillingVoxelsPerTick> <SpeedMultiplierMaxValue>4</SpeedMultiplierMaxValue> <DrillingYield>1</DrillingYield> <InternalBeamColor> <R>245</R> <G>245</G> <B>245</B> </InternalBeamColor> <ExternalWeldBeamColor> <R>12</R> <G>127</G> <B>242</B> </ExternalWeldBeamColor> <ExternalGrindBeamColor> <R>230</R> <G>20</G> <B>20</B> </ExternalGrindBeamColor> </Value> </item> </dictionary> </ToolTiers> <SpeedMultiplierPowerScaleMultiplier>0.9</SpeedMultiplierPowerScaleMultiplier> <EnableDrilling>true</EnableDrilling> <MaxToolUpdatePerTick>1</MaxToolUpdatePerTick> <PreventUseInCombat>true</PreventUseInCombat> </LaserSettings>

All these settings will be explained further.
Debug setting
This setting makes the Laser Welders provide a verbose log output. Set this to true when logging mistakes or incorrect behavior.
EnableDrilling
Sometimes, server owners don't want the Tools to be able to mine, mostly because of performance and/or balancing reasons. If this is set to false, the Tools will ignore voxels completely.
PowerMultiplier, PowerScaleMultiplier and SpeedMultiplierPowerScaleMultiplier
The Tools use a very complex function to determine their power demands.

First, the Tool calculates a speed-based power consumption multiplier based on the "Speed Multiplier" slider, hereinafter 'SB'. The formula is as follows:

SB = SpeedMultiplier * ((SpeedMultiplierPowerScaleMultiplier ^ SpeedMultiplier) / SpeedMultiplierPowerScaleMultiplier)

where the 'SpeedMultiplier' is the slider's numerical value, and '^' is the operation of raising into power.

With the default value of 'SpeedMultiplierPowerScaleMultiplier' and 'SpeedMultiplier' from 1 to 4, the values are as follows:

  • 1: 100%
  • 2: 90%
  • 3: 81%
  • 4: 72.9%

The power discount is provided based on the fact that a single tool working in x4 mode will consume considerably less CPU resources than 4 tools working in x1 mode. However, if you are a server owner and you expect that players will use walls of Laser Welders, the opposite is true: because of the load balancing system, 25 tools working in x1 mode will consume less CPU resources than 25 tools working in x4 mode; therefore, you might consider introducing a power consumption penalty for the overuse of the Speed Multiplier setting. E.g. a value of 2 will provide the following results:

  • 1: 100%
  • 2: 200%
  • 3: 400%
  • 4: 800%

You can use this link[www.wolframalpha.com] to plot a nice graph showing how the power demand rises at the maximum x4 speed multiplier. Replace 4 with 2 or 3 to see the multipliers for lower speeds. B^1/B is always 1.

After the power bonus (or penalty) for using the Speed Multiplier is calculated, this value is used to calculate the power consumption using this formula:
PowerMultiplier * SB * (PowerScaleMultiplier ^ BeamLengthM)
where 'BeamLengthM' is the laser beam's length in metres.

You can use this link[www.wolframalpha.com] to see how the power consumption changes with different settings. In the link's formula, B is 'SpeedMultiplierPowerScaleMultiplier', S is 'SpeedMultiplier', R is 'PowerScaleMultiplier' and the beam range is specified as L from 1 to ...

As you can see from the plotted formula, the power consumption is non-linear, and becomes even more so should you tweak the settings. For example, if you change the 'PowerScaleMultiplier' from 1.2 to 1.3, the power consumption at 20 metres range and x1 speed will rise from 38 MW to 190 MW, and at 20 metres range and x4 speed will spike from 111 to 554 MW. Should you decide that extra speed costs extra power, and set the 'SpeedMultiplierPowerScaleMultiplier' to 1.2, then the 20m beam at x4 speed will cost you "only" 264 MW with a 'PowerScaleMultiplier' of 1.2, but a whopping 1.3 GW with a 'PowerScaleMultiplier' of 1.3; be careful with numbers.
MaxToolUpdatePerTick
This governs the number of Laser Tools which can concurrently work in a single tick, and thus, the performance impact of each.

Unlike with vanilla tools, there is no rigid working frequency for Laser Tools. Each tool spreads its workload across several ticks instead of trying to accomplish everything in a single tick; depending on the type of work (blockworking or drilling) this can range from 3-7 ticks to 20-30 ticks.

After a working cycle has been completed, the tool waits for up to 10 ticks to start a new one, if it is the only one working in the world. However, if it is not, then 'MaxToolUpdatePerTick' imposes a hard limit on the number of tools which can work simultaneously. If the limit is 4, and there are 8 tools which are attempting to start their work, only the first 4 will start it, with the other 4 starting as soon as the first 4 finished their work. This effectively halves their total working speed, but they do not harm the simspeed more than 4 tools would do.
PreventUseInCombat
The Laser Tools make for a very strong self-repair subsystem: unlike vanilla welders, they don't have to be placed adjacently to the block they have to repair, and can be buried in armor instead; and their speed multiplier allows for repairs to happen very quickly, allowing to keep blocks online even under sustained fire. Some server owners can deem this an overpowered feature; therefore, there is an option to prevent using Laser Tools in combat.

The Tools will refuse to work if any of the following conditions are met:
  • the grid the tool is mounted on is firing any weapons (fixed guns or turrets)
  • the grid the tool is pointed at is firing any weapons.

Note that only conventional weapons block the Tools. Mass Drivers are excluded from this list for obvious reasons.

Also note that this feature may prevent your Mass Drivers from reloading in CQB. If you don't like this and you have a "no self-repair" rule on your server that everybody follows (or you are okay with self-repair), you can disable this feature.

Modded weapons are supported to a limited extent. As long as the weapon in question does not have any modscripting in its functionality, it will work; if it has scripts, it might not. This solely depends on whether the scripted gun sets the
IMyUserControllableGun.IsShooting
flag when firing.
Tool configuration
The Tools have the following configuration:
<ToolSubtypeId>LargeShipLaserMultitool</ToolSubtypeId> <MaxBeamLengthBlocks>8</MaxBeamLengthBlocks> <WeldGrindSpeedMultiplier>1</WeldGrindSpeedMultiplier> <WelderGrinderWorkingZoneWidth>2</WelderGrinderWorkingZoneWidth> <DrillingZoneRadius>2</DrillingZoneRadius> <DrillingVoxelsPerTick>4</DrillingVoxelsPerTick> <SpeedMultiplierMaxValue>4</SpeedMultiplierMaxValue> <DrillingYield>1</DrillingYield> <InternalBeamColor> <R>245</R> <G>245</G> <B>245</B> </InternalBeamColor> <ExternalWeldBeamColor> <R>12</R> <G>127</G> <B>242</B> </ExternalWeldBeamColor> <ExternalGrindBeamColor> <R>230</R> <G>20</G> <B>20</B> </ExternalGrindBeamColor>

'MaxBeamLengthBlocks' is, well, the setting for limiting the beam's max length. Note that this is measured in blocks; if you set 10, then the equivalent for the small ship tool should be 50.

'WeldGrindSpeedMultiplier' is the general speed multiplier for the tool. '1' means roughly equivalent to a single vanilla tool.

'WelderGrinderWorkingZoneWidth' defines the area of effect for blockworking (welding or grinding). The area of effect is a cuboid with the length equal to the beam's visible length, and the height & width of the cuboid calculated as (n*2+1)*0.5, where n is 'WelderGrinderWorkingZoneWidth'. With the default settings, the area of effect is 2.5m x 2.5m tall and wide, which is exactly enough to cover a 5x5 wall of small blocks. Note that this field permits only integer values.

'SpeedMultiplierMaxValue' determines the maximum value of the "Speed Multiplier" slider. Note that this field permits only integer values.

'DrillingZoneRadius' defines the voxel cutout size in metres. The area of effect when drilling is a sphere centered at the point where the tool's beam intersects the voxel.

'DrillingVoxelsPerTick' essentially defines the drilling speed and the performance impact of the tool. Unlike vanilla drills and all other drills using vanilla mechanics, the Laser Tools do not try to harvest a certain volume in a single tick. Instead, they work in cycles, resembling the miners in Eve Online.
The cycle starts with fixing the area of effect (it does not move with the tool until the cycle is finished) to certain coordinates and calculating the AoE's volume. With the default radius of 2, the volume is ~33.5 cubic metres, and because the cutout shape usually resembles a hemisphere, the effective volume to be cut is usually around 16-17 cubic metres.
The cycle consists of two primary operations: determining the voxel contents of the area of effect and destroying the voxels within it. Surprisingly enough, the former is much more performance-expensive; the drilling process is a several ticks long process exactly for this reason.
The first operation is what is limited by 'DrillingVoxelsPerTick'. This value sets the maximum volume that can be checked for contents in a single tick; '4' means four cubic metres. Because of this, you can crank 'DrillingZoneRadius' all the way up with little to no impact on performance — just don't be surprised when the tools' harvesting process starts resembling a Strip Miner.
Note that this field permits only integer values.

'DrillingYield' modifies the amount of resources acquired from mining voxels. 1 is very roughly equal to vanilla drills, the exact percentage is usually in the range of 90-110% because of differing mining functions.

'InternalBeamColor', 'ExternalWeldBeamColor' and 'ExternalGrindBeamColor' are all pretty straightforward: they define the beam's colors. All components are integer numbers ranging from 0 to 255; 0-0-0 means black, 255-255-255 means white, 0-0-255 means pure blue, etc.
Conclusion
This guide covers almost all settings and mechanics of Laser Tools. If you have any questions left, feel free to PM me on Discord. I'm available on KeenSWH's Discord server.