[#1760][6.20] Ships with minimum loadout can yield more raw scrap than with a full loadout - Fix in a future build.

Ask here if you experience technical problems with X4: Foundations.

Moderator: Moderators for English X Forum

Post Reply
Mookau
Posts: 108
Joined: Tue, 8. Sep 20, 05:31
x4

[#1760][6.20] Ships with minimum loadout can yield more raw scrap than with a full loadout - Fix in a future build.

Post by Mookau » Wed, 7. Feb 24, 08:47

OS: Linux
Version: 6.20
Language: English
Modified: No
Game Start: Any

Problem:
In certain cases, destroying all the components of a L/XL ship before destroying it will yield less scrap than the same ship with a lesser loadout.

How to Reproduce:
Load up a Wyvern (Mineral) with:
8x PAR M Tracking Turret Mk1s
2x TEL L Mining Turret Mk1s
7x ARG M Shield Generator Mk1s
1x SPL L Shield Generator Mk1
3x ARG L All-round Engine Mk1s
L All-round Thrusters Mk1

Load up a second Wyvern (Mineral) with:
3x ARG L All-round Engine Mk1s
L All-round Thrusters Mk1

Destroy all surface modules on each of them, and then destroy the ship.
Check the raw scrap values of each wreck.

The save file linked is a custom game with this setup.

Save File:
https://drive.google.com/file/d/1j_xiT1 ... sp=sharing

Research:
Raw scrap yields for L/XL/Stations are based on a combination of hull and material costs, with the hull being caclulated as the max hull of ship chassis + the hull of all surface components at the time the ship is destroyed.

The formula looks like this:

Code: Select all

Total ship scrap value (chassis + surface components) * (Combined max hull values (chassis + surface components) - Lost hull amount of all components) / Combined max hull values (chassis + surface components)
Because a component may be contributing a higher percentage of hull than scrap value to the ship, having it destroyed or damaged means that it loses a greater portion of the potential scrap yield.

Solution:
Separate the concerns of the ship chassis's hull and scrap values from component hull and scrap values.

The calculations should be something like:

Code: Select all

Ship chassis scrap value + sum_of (scrap value of individual component * component hull value / component max hull value)
Where it treats each component separately, rather than all of them as though they were a single object.
This would let the ship have a minimum value (that is the scrap value of the chassis), and destroyed components would only affect the added value that they bring.
Last edited by Tranxalive on Tue, 27. Feb 24, 15:14, edited 1 time in total.

Mookau
Posts: 108
Joined: Tue, 8. Sep 20, 05:31
x4

Re: [6.20] Ships with minimum loadout can yield more raw scrap than with a full loadout.

Post by Mookau » Mon, 19. Feb 24, 12:36

I know this "bug" is less of a bug, and more just math inconsistency. But given that you'd expect a ship with more on it to generate more scrap, or at minimum the same amount. I do think it's worth looking into.

If anyone is interested in the math behind how scrap values are actually calculated, I added a section on it to my guide/FAQ.

User avatar
BurnIt!
EGOSOFT
EGOSOFT
Posts: 5075
Joined: Wed, 6. Nov 02, 20:31
x4

Re: [#1760][6.20] Ships with minimum loadout can yield more raw scrap than with a full loadout.

Post by BurnIt! » Tue, 12. Mar 24, 16:12

This has been fixed for an upcoming update.
BurnIt!
In der Ruhe liegt die Kraft. / In peace lies strength.

Mookau
Posts: 108
Joined: Tue, 8. Sep 20, 05:31
x4

Re: [#1760][6.20] Ships with minimum loadout can yield more raw scrap than with a full loadout.

Post by Mookau » Wed, 13. Mar 24, 05:13

BurnIt! wrote:
Tue, 12. Mar 24, 16:12
This has been fixed for an upcoming update.
Awesome! Thanks for looking into it.

I don't mind if I have to wait until the update is released, but would it be possible to share the finer details on the fix? (Namely how the raw scrap formula has changed?)

I'd like to eventually reflect the changes in my steam guide and make the knowledge a bit more accessible to the player-base.
Not having to reverse engineer the formulas again would make it easier.

User avatar
BurnIt!
EGOSOFT
EGOSOFT
Posts: 5075
Joined: Wed, 6. Nov 02, 20:31
x4

Re: [#1760][6.20] Ships with minimum loadout can yield more raw scrap than with a full loadout - Fix in a future build.

Post by BurnIt! » Wed, 13. Mar 24, 08:26

In a nutshell, the issue was that when you actively destroy e.g. a turret you do that by bringing its hull down to 0 whereas the hull value is not changed when the turret is destroyed as a result of the entire ship exploding. Until the next update is released Raw Scrap content is based on the resource costs of the ship and all equipment relative to the hull percentage of all parts of it. So the more turrets, shields, engines... you manually blow up first, the more parts were contributing 0% to the overall thus reducing the percentage used for the Raw Scrap amount.

While individually destroyed surface elements have 0 hull, the main hull is treated a little differently. When a ship is destroyed the hull value of the wreck is (internally) set to a %-value indicative of the original state before the ship (or station module) was destroyed - so a ship that was flying around would have 100% but a ship that was destroyed while it was still under construction may only be at 67%.
This is not done for surface elements (it actually was initially but it caused problems for construction and surface element repair logic, so it was disabled. Unfortunately we missed the side-effect that had on the scrap value calculation)

The new logic simply sticks to the percentage of the main hull wreck alone, proportionally applied to the resource costs of ship and equipment. There's an additional modifier that reduces the amount you get out of it so it's not Raw Scrap value = 100% ship costs. We have reduced this modifier a little to compensate for the now net increase in Raw Scrap you get from ship/station wrecks.
BurnIt!
In der Ruhe liegt die Kraft. / In peace lies strength.

Mookau
Posts: 108
Joined: Tue, 8. Sep 20, 05:31
x4

Re: [#1760][6.20] Ships with minimum loadout can yield more raw scrap than with a full loadout - Fix in a future build.

Post by Mookau » Wed, 13. Mar 24, 10:42

I managed to figure out almost everything (see Wreck Scrap Values if you have the time). The exception being that a half built ship/station module being destroyed only gives an amount of scrap based on the build percent, that was a scenario I hadn't thought to test.

BurnIt! wrote:
Wed, 13. Mar 24, 08:26
There's an additional modifier that reduces the amount you get out of it so it's not Raw Scrap value = 100% ship costs. We have reduced this modifier a little to compensate for the now net increase in Raw Scrap you get from ship/station wrecks.
For the current scrap values I calculated it as: material cost * (1 / 225) - I assume that 1/225 value is the modifier that will decrease to balance things out again.

BurnIt! wrote:
Wed, 13. Mar 24, 08:26
When a ship is destroyed the hull value of the wreck is (internally) set to a %-value indicative of the original state before the ship (or station module) was destroyed
There was actually a small issue relating to this as well, the "original state" of the ship/station module here doesn't take into account ship mods changing the hull value.
The new calculation looks like it will fix/sidestep this problem as the new scrap value will be more static. So changing hull values through ship mods will no longer matter/mismatch the values.

Post Reply

Return to “X4: Foundations - Technical Support”