X4: Foundations
0 of 0

File information

Last updated

Original upload

Created by

PLS

Uploaded by

PLillystone

Virus scan

Safe to use

Tags for this mod

About this mod

The bailing extension mod improves the base game bailing logic and enables NPC vs NPC bailing.

Requirements
Permissions and credits
Changelogs
BAILING EXTENSION

This mod is a complete rewrite of the base bailing system in X4: foundations, which improves the logic behind bailing and enables NPCs to cause other NPCs to bail. Additionally large and x-large ships will now bail a reasonable numbers of crew, and non-military ships may even fully abandon ship. Finally the player will receive a notification of an abandoned ship if the player has an advanced satellite in the sector the ship bailed in. 

BAILING LOGIC

Bail checks run on any ship (including those attacked by NPCs) whose shields and hull drop below 20% and 75% respectively, much like in the base game. However rather than checking if a ship will bailing every 30s, if the player is involved in the combat the checks will now run every 5s. To compensate for this increased frequency each check has a lower probability of triggering crew to bail**.

The probability a ship will bail crew is now determined by the logic below:

Prob(Will Bail) = BASE + SIZECOMP + FIGHTCOMP + MORALCHECK
For players max(Prob(Will Bail)) = 20% and min(Prob(Will Bail)) = 3%
For NPCs max(Prob(Will Bail)) = 10% and min(Prob(Will Bail)) = 1%

  • BASE: Base chance for a ship to bail.
    = 10% when a player triggered bailing conditions (including player owned ships*)
    = -5% for NPC vs NPC bailing events
  • SIZECOMP: Size comparison between attacker and target:
    = 5*(min( (Attacker max HP/Target max HP) -1, 1). I.e. for ships with equal size = 0%. Small attacker/large target = -5%. Large attacker/small target = 5%
  • FIGHTCOMP: Relative ability to fight between attacker and target.
    = min(5, 10*((Attacker time-to-kill/target time-to-kill)/2 - 1)). Similar to size comparison, however -ve bias when target has a chance to fight back.
  • MORALCHECK
    = +10% for the least skilled crew possible, -10% for the most skilled crew.

The bail chance is then halved if the target can escape (target max speed > 1.2*attacker max speed).

Pilot panic:
Each time a player triggers a bailing event the target's "panic level" will increase. On subsequent bailing checks this panic is added to the final probability to bail, 0.5% each check to a maximum of 10%. This has been included to reduce the probability that you spend ages trying to get a ship to bail, which won't bail because of bad rolls on the bail check.

EJECTING CREW
The base game would only ever eject 1-3 crew at a time, which is incredible considering: How many crew even a medium transport ship has. That the bail checks ran at most every 30s. The probability of bailing could be as low as 1%. All without ever telling you this, those "panic" dialogs have no impact on the logic. 

In the Bailing Extension mod between 20% to 100% of the crew will bail when the eject chance is passed. L and XL military ships will only bail crew up-to their (crew capacity)*(hull percentage/2)*** and the pilot will never bail (captain always goes down with his ship). For example if a military L ship's capacity is 100 crew and the hull percentage is 40% then 20+ crew will be left after the ship bails.

BAILED SHIPS AND CLEAN-UP

If the player has a advanced satellite in a sector where a ship is abandoned, the player will receive an notification and a log message.
Bailed ships will be deleted after roughly 2 hours, unless the player is in the same sector as the bailed ship. 
Ships from factions who can claim abandoned ships (Yaki in vanilla X4) will only attempt to capture a ship every 5 minutes with a 1 in 4 chance. I implemented this change because in vanilla X4 if a yaki ship found an abandoned ship it would spam all its marines to claim the ship.

INSTALLATION AND COMPATIBILITY

To install extract the .zip into X4's /extension folder and make sure it is activated in the extension menu in game.

The mod is compatible with X4 6.0+, it's probably compatible with older versions too but I haven't tested it. The mod is also safe to add to an on-going save, and remove from a save game.

I actually built this mod primarily for Star Wars Interworlds, and it is compatible with at least SWI 0.72/0.73. 
Any other bailing mods (better piracy/improved bail chance/enhanced bailing etc) will almost certainly conflict with this mod.

ACKNOWLEDGEMENTS

This is my first mod, so firstly a big thanks to everyone in the modding community. I used as many references as possible to learn how to mod the game, even scouring over other mods code on github. So big props to those who've published their code online!

I started this mod by reading and learning the Star Wars Interworlds mod code, so huge appreciation and thanks to everyone on that team. Really awesome mod, can't recommend highly enough. From this I learnt the Interworlds bailing logic is a modified version of the "Enhanced Bailing" mod (https://www.nexusmods.com/x4foundations/mods/741) and while it hasn't been updated for the latest version of X4, I learnt a huge amount by looking through MoonShadowFan's code.


* - Semi-interesting fact: in the base game player owned ships can cause other ships to bail, however it is extremely rare and you really have to work hard to get the right conditions for it to occur (I tested it by setting the probability of a ship to bail to 100%).
** - The base game chance of bailing could actually be 0%, so if you ever found yourself endlessly trying to get a ship to bail (that wasn't story related) this is probably why.
*** - Due to the way the game ejects crew, the remaining crew can sometimes drop below this threshold by 1 or 2 crew. However subsequent bails will respect this limit and the pilot shouldn't bail. Please let me know if you see a mil ship fully bail, as I'm not sure why the game ejects more crew than the code tells it to.