X4: Foundations

X4: Foundations

41 ratings
Bailing Extension
2
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
60.918 KB
Mar 27 @ 8:52am
1 Change Note ( view )

Subscribe to download
Bailing Extension

Description
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

Nexus mod page: https://www.nexusmods.com/x4foundations/mods/1342/

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.
29 Comments
King DaMuncha 56 minutes ago 
The bail chance is realy high now, and pilots bail from ships that are perfectly combat ready (50+% Hull)
Corrancarpenter Jun 20 @ 2:24pm 
Interesting mod. From the comments, it seems it still needs a bit of tweaking so it doesn't completely unbalance the game, but I'll keep on eye on it.
Dex Jun 19 @ 5:57am 
Hi Vindicator,

Please take this as a constructive comment.

Tried your mod because it seems like you are addressing some of the missing or not so refined bail mechanics in the base game.

What happened in my game was that every battlefield was full of abandoned ships and you could easily find them even outside the main battle areas.

It seems that with some tweaks on the chance of bailing caused by other NPCs and in general, and as suggested, in a mechanic for NPCs to also claim some of the ships would make the mod more balanced.

As it is, I have decided to not use the mod because it makes it too easy to get abandoned ships, to the extent that it would be easier, and less of a shore, to just use a cheat mod to spawn the ships you want.
ShaggyRecluse Jun 12 @ 11:40am 
Came here to see if there were settings I could adjust because I don't feel like ships bail enough for the amount of war going on in my game, and I see some comments saying it happens too much in their game.
Snuggl May 31 @ 4:30am 
In any case, i love this mod! However, in my game it feels unbalanced. I can get rich so quick by just scouting around and collecting abandoned ships as they bail often enough - in terms of galaxy.

Would be amazing if the NPC factions had special salvaging ships that do the same. Or if you'd get a reputation penalty for stealing their ships (which you actually do, you know). :)
Snuggl May 19 @ 6:25am 
@Desert: Read the mod description again. It says that captains never bail, they die with their ship. Yet they do in my game. So how about taking a deep look into the mirror instead of getting offensive on the internet and writing lol lmao after almost every sentence?

Quote:
> and the pilot will never bail (captain always goes down with his ship)
@Snuggl You're crying because the mod is doing what it's suppose to really lol? Please don't delete the mod lol, not everybody's crazy we appreciate the work you're doing on this mod.
I like that the fact your stealing there ship, and leaving them in the cold of space but when they get murdered quickly instead of slowly freezing to death that's a no no lmao.
Random Tank May 13 @ 4:03pm 
Is there a way to get npc's to stop attacking the escape pods? They seem to go out of their way to do it, and it's pretty harsh... especially when they ignore stuff like satellites most of the time.
Snuggl May 6 @ 8:36am 
Now even an XL bailed. A Hatram. 10 members, pilot included, ejected when i attacked them.