X Rebirth

X Rebirth

30 ratings
Engineer Fix
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
12.806 KB
16 May, 2021 @ 9:37am
10 May, 2022 @ 10:19am
4 Change Notes ( view )

Subscribe to download
Engineer Fix

Description
Short version:
* Fixes the bug that leaves station hull at 99%
* Ships will be repaired to 100% instead of 60-90%
* Recalculated ship hull repair speed (component repair speed remains the same)
* Fixes ship repair speed being too slow due to Construction drones being "in use" all the time bug
* Engineers with level 0 in engineering skill will not be able to use Construction drones
* Uses engineer's engineering skill to calculate repair speed instead of combined skills
* Uses engineer's engineering skill to reduce wait time between repairs
* Fixes a bug with vanilla AI which allow engineers to slack off when ship hull is repaired to its repair limit (since v1.2)
* Changed the logic of repairing out of view ships and stations, which makes restoring components to be too quickly (since v1.2)


Long version:

Since the day this game came out, there are always problem with engineer AI, even until today. So I decided to review the code, try to debug it and finally came up with a version that can work pretty well.

If you ever used Station Engineer mod, you will eventually notice that the engineers on your stations sometime don't repair it to 100%. It's not the mod's fault, because all it does is giving you a slot to put an engineer into your station. It's actually a bug in the vanilla AI, and this mod fixes it (that doesn't mean you need Station Engineer mod to use this mod).

The vanilla AI calculation when repairing ship hull is also not really correct, and the result is that it doesn't matter if you have 1 or 100 Construction URVs (cURV), the hull repair speed is always 1% per 10 seconds. It doesn't matter if your ship has 4 million HP or 10 million HP, the repair speed is always the same (unless your ship has only around 2 million HP, and you actually have 100 cURVs on it, then the speed is around 1.45% per 10s), and it's really bugging me. So I changed the formular, and now when you have too few cURVs, your repair speed will be really slow. But it will pump up nicely when you have 50 or more cURVs.

And one thing about URVs in this game since the beginning is sometime they lost contact with your ship, and disappeared into thin air. But your ships still think these drones are being used, so it won't launch cURVs anymore, leaving your ships repair speed critically slow. And this mod fixes it also, not by recalling these missing drones, but by simply uses the total number of cURVs your ship has. However it only works when ALL of your ship's cURVs are in "In Use" state. I may fix this in the future but not sure though.

Other things that this mod does, are taking engineering skill into account when calculating repair speed and engineer's idle time. The higher the skill level, the faster the engineer works. And it just makes sense when engineers with level 0 in engineering can not use drones.


Note:
Eventually you will notice that your engineers on your cap ships sometimes will show that they are repairing something weird, like "Reparing nil", or "Reparing some_weird_macro", or just "Reparing". It's not a bug, and they are in fact repairing those components. It's just that those components are not designed to be shown up so they don't actually have a name to display (what a messy development), but they are also part of the ships, and they are destructible, so I think it just makes sense for the engineers to repair them too.


Compatibility:
* X Rebirth version 4.1 and later
* Probably not compatible with other mods that modify engineer.ai.xml (if your other mods have this file)
7 Comments
Singleton 6 Feb, 2024 @ 11:56am 
So will construction URV equipped accelerate the repair speed for capital ships?
luke0086 5 Feb, 2024 @ 3:19pm 
Just a note to anyone else, my game started crashing when I installed this mod and after removing it, my engineers who's orders should be "repair" are "none". So backup your saves and this might not be 4.3 compatible.
luke0086 2 Feb, 2024 @ 4:40pm 
Is this save game safe?
dan5tr4n63r 1 Aug, 2021 @ 11:02am 
It is compatible with skunk engineer(it has engineer.player.xml)...so no issues so far...thank you
VincentL  [author] 1 Aug, 2021 @ 1:07am 
@dan5tr4n63r It is compatible with Station Engineer. I don't know about Skunk Engineer because I couldn't find it. But if it does not have engineer.ai.xml then it is compatible.
Craig68x 24 Jul, 2021 @ 12:43pm 
Thank you for this!
dan5tr4n63r 19 Jul, 2021 @ 11:29am 
Is this compatible with skunkengineer and/or w.e.stationengineer(has npc_engineer.xml)??