[MOD] Marine Rebalance
Moderators: Scripting / Modding Moderators, Moderators for English X Forum
-
- Posts: 236
- Joined: Mon, 29. Dec 03, 15:22
w.evans:
right now here is how the boarding phases work in vanilla script minus moost of the math numbers starting from the marines have reached the target:
1 - get BR value of ship (if plot taranis set to 10 BR, if faction = ownerless set to 1 *new change from latest RC in beta testing*)
2 - pick a support mission to do (hack or destroy surface element, only hack if trojan onboard). If no surface elements left then treat as successful support mission.
3 - check if successful support mission. if not successful then lost 15 to 25% of marines present.
4 - calculate new attack strength pending support mission result and compare it to new boarding resistance (incase surface element destroyed). if defense-attack < -10 then player win, if defense-attack is between -10 and 10 then player may win but may lose but always lose 5% to 10% marines. If defense - attack > 10, player loses with the larger loss of marines based on the difference between attack and defense.
5 - add 20% progress to boarding progress if marines living > 1. If progress > 100 then end boarding with player success, otherwise go back to step 1.
Some things to note. based on the general idea of the script, if the RNG gods smile on you and give you the golden cookie, you can complete the boarding even with 5 rounds of losses if you do not lose all your marines before the end of the 5th round. As far as I can tell you only have to have one marine survive to the end to successfully board. also the boarding resistance never decreases unless the ship takes hull damage or loses a surface element that is part of the list of elements that add to the boarding resistance in the first place.
As for the hull damage, it works by using the value of the ship if sold (thus hull value). If you try and sell a ship with 20% hull the value is lower than trying to sell the exact same ship with 60% hull. This is why damaging hull makes the boarding resistance go down.
right now here is how the boarding phases work in vanilla script minus moost of the math numbers starting from the marines have reached the target:
1 - get BR value of ship (if plot taranis set to 10 BR, if faction = ownerless set to 1 *new change from latest RC in beta testing*)
2 - pick a support mission to do (hack or destroy surface element, only hack if trojan onboard). If no surface elements left then treat as successful support mission.
3 - check if successful support mission. if not successful then lost 15 to 25% of marines present.
4 - calculate new attack strength pending support mission result and compare it to new boarding resistance (incase surface element destroyed). if defense-attack < -10 then player win, if defense-attack is between -10 and 10 then player may win but may lose but always lose 5% to 10% marines. If defense - attack > 10, player loses with the larger loss of marines based on the difference between attack and defense.
5 - add 20% progress to boarding progress if marines living > 1. If progress > 100 then end boarding with player success, otherwise go back to step 1.
Some things to note. based on the general idea of the script, if the RNG gods smile on you and give you the golden cookie, you can complete the boarding even with 5 rounds of losses if you do not lose all your marines before the end of the 5th round. As far as I can tell you only have to have one marine survive to the end to successfully board. also the boarding resistance never decreases unless the ship takes hull damage or loses a surface element that is part of the list of elements that add to the boarding resistance in the first place.
As for the hull damage, it works by using the value of the ship if sold (thus hull value). If you try and sell a ship with 20% hull the value is lower than trying to sell the exact same ship with 60% hull. This is why damaging hull makes the boarding resistance go down.
-
- Posts: 2963
- Joined: Tue, 18. Nov 14, 16:23
@lubatomy
Thank you! So in my vanilla elites with 5/5/5 MO example, you could, at best, win, but with 75% casualties if you just tried to launch marines and hide. On average and worse, you'll lose.
Those are here:
and here?
Hm. Have to think about that. Knee-jerk response is to comment out the casualties from ignoring Yisha. Seems arbitrary. Have to admit though that I haven't played much, and in what little time I've played, I haven't gotten much chance to actually board anything. Does the mechanic add anything?
And is there a 1:1 relationship between hull value and defence strength (barring drones and DO multiplier)? Because DaveDee said that he whittled a Balor down to 1% hull, and it retained 43 defence strength. Particularly potentially telling here, because Balors can't have drones, so it looks like it's down to this ratio and defence officer influence.
Thank you! So in my vanilla elites with 5/5/5 MO example, you could, at best, win, but with 75% casualties if you just tried to launch marines and hide. On average and worse, you'll lose.
Those are here:
Code: Select all
<do_if value="not $SupportSuccess">
<set_value name="$losschancemin" exact="15"/>
<set_value name="$losschancemax" exact="25"/>
<include_actions ref="LoseMarines"/>
</do_if>
Code: Select all
<library name="LoseMarines">
<actions>
<do_if value="$nummarines" min="4">
<do_if value="$losschancemax" min="1">
<set_value name="$InjuredAmount" min="$nummarines / (100.0f / $losschancemin)" max="$nummarines / (100.0f / $losschancemax)"/>
<debug_text text="'Player will lose ' + $InjuredAmount + ' marines'"/>
<do_all exact="$InjuredAmount">
<set_value name="$PossibleMarines" exact="[]"/>
<do_all exact="$ArrivedMarines.count" counter="$i">
<do_if value="$ArrivedMarines.{$i}.count">
<append_to_list name="$PossibleMarines" exact="$i"/>
</do_if>
</do_all>
<do_if value="$PossibleMarines.count">
<set_value name="$KilledMarineMKIndex" min="1" max="$PossibleMarines.count" profile="decreasing" scale="2"/>
<set_value name="$KilledMarineMK" exact="$PossibleMarines.{$KilledMarineMKIndex}"/>
<set_value name="$KilledMarineIndex" min="1" max="$ArrivedMarines.{$KilledMarineMK}.count"/>
<debug_text text="$ArrivedMarines.{$KilledMarineMK}.{$KilledMarineIndex} + ' was killed'"/>
<remove_units object="$boardership" macro="$ArrivedMarines.{$KilledMarineMK}.{$KilledMarineIndex}" exact="1" unavailable="true"/>
<remove_value name="$ArrivedMarines.{$KilledMarineMK}.{$KilledMarineIndex}"/>
</do_if>
</do_all>
</do_if>
</do_if>
<do_else>
<!--Marine count too low. All of them lost.-->
<do_all exact="$ArrivedMarines.count" counter="$i">
<do_all exact="$ArrivedMarines.{$i}.count" counter="$o">
<remove_units object="$boardership" macro="$ArrivedMarines.{$i}.{$o}" exact="1" unavailable="true"/>
</do_all>
<set_value name="$ArrivedMarines.{$i}" exact="[]"/>
<debug_text text="'All marines killed'"/>
</do_all>
</do_else>
<include_actions ref="CalculateNumMarines"/>
</actions>
</library>
And is there a 1:1 relationship between hull value and defence strength (barring drones and DO multiplier)? Because DaveDee said that he whittled a Balor down to 1% hull, and it retained 43 defence strength. Particularly potentially telling here, because Balors can't have drones, so it looks like it's down to this ratio and defence officer influence.
-
- Posts: 285
- Joined: Sat, 18. Oct 14, 13:10
-
- Posts: 2963
- Joined: Tue, 18. Nov 14, 16:23
-
- Posts: 2963
- Joined: Tue, 18. Nov 14, 16:23
Starting with a rather drastic Yisha nerf. Dialed it down from 15 and 25, to 2 and 5. Let me know if anyone wants it raised back up a bit.
As per lubatomy's analysis, you would lose from 15% to 25% of your force strength per round for failure to support the boarding operation. With 5 rounds, that is, at best, 75%, at worst, 100% (actually 125%) of your boarding party. This is, unless I'm mistaken, in addition to losses incurred over the course of the battle.
With the change, you would lose at best, 10%, at worst, 25% of your force strength over the course of a whole boarding operation.
And with this, we go to v0.2 and variants. I'll stay with the naming scheme that has developed so:
v0.2xx is with the Yisha nerf,
v0.xxxl uses lubatomy's Marine Officer-to-attack strength algorithm,
v0.xxxop uses the pre-v3.0 MO algorithm,
and v0.xx1 is with the boosted veterans and elites.
As per lubatomy's analysis, you would lose from 15% to 25% of your force strength per round for failure to support the boarding operation. With 5 rounds, that is, at best, 75%, at worst, 100% (actually 125%) of your boarding party. This is, unless I'm mistaken, in addition to losses incurred over the course of the battle.
With the change, you would lose at best, 10%, at worst, 25% of your force strength over the course of a whole boarding operation.
And with this, we go to v0.2 and variants. I'll stay with the naming scheme that has developed so:
v0.2xx is with the Yisha nerf,
v0.xxxl uses lubatomy's Marine Officer-to-attack strength algorithm,
v0.xxxop uses the pre-v3.0 MO algorithm,
and v0.xx1 is with the boosted veterans and elites.
-
- Posts: 2963
- Joined: Tue, 18. Nov 14, 16:23
@DaveDee Been thinking about it, and I think I spoke too soon. Forgot that you took out your Balor's surface elements and reduced the hull before you launched marines. That means no support casualties since Yisha won't have any support missions to issue, so the support phase would be automatically won every round. And with the Balor's defence strength of 43 vs your attack strength of 72, that's a fight outcome of -29, a sure win every round with no casualties.
Been trying to wrap my head around the code, and $losschancemin/max (the variables used to compute the chance to suffer casualties) are invoked in 4 places:
where number of casualties are actually calculated per instance (random between 100/min and 100/max),
where support casualties are calculated (random between 15 and 25% per instance for support mission failure),
casualties for losing a round (relative between attack and defense strength),
and casualties for a close fight (random between 5 and 10%)
If I understand this correctly, you shouldn't have lost ANY marines, as long as they all landed; but I'm obviously missing something here.
Been trying to wrap my head around the code, and $losschancemin/max (the variables used to compute the chance to suffer casualties) are invoked in 4 places:
where number of casualties are actually calculated per instance (random between 100/min and 100/max),
where support casualties are calculated (random between 15 and 25% per instance for support mission failure),
casualties for losing a round (relative between attack and defense strength),
and casualties for a close fight (random between 5 and 10%)
If I understand this correctly, you shouldn't have lost ANY marines, as long as they all landed; but I'm obviously missing something here.
-
- Posts: 236
- Joined: Mon, 29. Dec 03, 15:22
that I believe is just a function so that instead of re-writing all the code for calculating how many marines are lost each time you will see the lines like "<include_actions ref="LoseMarines"/>" which tells the code to find the library called LoseMarines and execute that library in that spot.w.evans wrote:
Also, I did find a snippet (here [/mdscript/cues/cue/cues/cue/cues/cue/cues/cue/cues/cue/cues/cue/cues/library] if anyone wants to look it up) that deals with incurring casualties in a way I haven't taken into account yet, but I haven't figured out how it connects with the whole process yet.
in this case, any time the boarding script needs you to lose marines it will do the following:
1 - check if you have 4 marines alive. If not kill all remaining marines.
2 - check if the losschancemax value is > 1, if so go through and figure out how many marines of die in accordance with the min and max loss values.
3 - then it runs a loop for as many times as needed to kill of that number of marines. Each time through the loop it picks a marine level (rookie, vet, elite) and then picks a random marine remaining of that level. while i do not know exactly what the decreasing function with a scale of 2 means where it picks the level of the marine to kill, i do know that it makes it so that a rookie is more likely to die than a vet, and a vet is more likely to die than an elite marine.
Note - that it uses the current count of marines each time it calcs how many to kill, not the original starting amount.
Example:
start with 50 marines
round one - lose 10% of marines end with 45 (50 - 5)
round two - lose another 10% of marines to end with 41 (45 - 4 as you can not do 0.5 loops so the 4.5 is likely treated as 4)
round 3 - lose 10%, end 37
round 4 - lose 10%, end 34
round 5 - lose 10%, end 31
so 5 rounds of losing 10% each round means losing 38% overall.
Looking at the numbers, My guess is DaveDee has or had a hacking drone on board and failed some hacking missions and those loses brought his attack strength down enough that he started taking loses due to being at or near the boarding resistance value and then being well below the resistance value. That of course is only speculation as I don't know for sure what happened but looking at numbers, that is the only way to explain his loss of 41 marines over the course of the attempt when running the mod.
-
- Posts: 2963
- Joined: Tue, 18. Nov 14, 16:23
@lubatomy Thank you very much for your patience in explaining everything. I think I may have gotten in over my head; I mean, I just started learning all of this stuff last week! But it's fun, so soldier on for now.
Unless someone more competent wants to take over? I really just want a better game.
Think I'll do another variant pair, this one using Ego's MO algorithm, but with the Yisha nerf. Would be interesting to compare. (Although the number of variants is starting to get out of hand.) ETA about 12 hours (have to head out for the day.)
And didn't count on diminishing returns with the casualty hits. The Yisha nerf might be a bit excessive then. We'll wait for some feedback on it, then adjust from there.
@DaveDee do you remember if you got any missions from Yisha in your Balor encounter?
Unless someone more competent wants to take over? I really just want a better game.
Think I'll do another variant pair, this one using Ego's MO algorithm, but with the Yisha nerf. Would be interesting to compare. (Although the number of variants is starting to get out of hand.) ETA about 12 hours (have to head out for the day.)
And didn't count on diminishing returns with the casualty hits. The Yisha nerf might be a bit excessive then. We'll wait for some feedback on it, then adjust from there.
@DaveDee do you remember if you got any missions from Yisha in your Balor encounter?
-
- Posts: 285
- Joined: Sat, 18. Oct 14, 13:10
-
- Posts: 2963
- Joined: Tue, 18. Nov 14, 16:23
Thanks. I'll keep looking, but have a sinking feeling that something's either hard-coded, or in a different file. But would most certainly appreciate more data if you could spare the time.
And as if the files uploaded aren't complicated enough, I have just uploaded the hardcore set! Uses the default Egosoft v3.0 Marine Officer algorithm whereby he/she affects your attack strength by -79% (1/1/1) to 1% (5/5/5).
Happy boarding!
And as if the files uploaded aren't complicated enough, I have just uploaded the hardcore set! Uses the default Egosoft v3.0 Marine Officer algorithm whereby he/she affects your attack strength by -79% (1/1/1) to 1% (5/5/5).
Happy boarding!
-
- Posts: 285
- Joined: Sat, 18. Oct 14, 13:10
-
- Posts: 2963
- Joined: Tue, 18. Nov 14, 16:23
Thanks.
No answers yet, just thinking out loud here.
Almost same situation, with one less marine, but with more vets.
v0.12 is 20-100 MO, no marine boost, no yisha nerf.
Losses look oddly like what I'd expect from the v0.2x line though. 5% losses for 5 rounds, more or less.
5% losses could also reflect the low end of close fight casualties, but with an attack strength at or close to 78 vs 44 defence strength, that was nowhere near a close fight.
And in your last Balor situation, you lost 41 marines.
Could you send me the save right before you attack?
Did you get/succeed/fail at any of Yisha's support missions? If so, how many?
No answers yet, just thinking out loud here.
Almost same situation, with one less marine, but with more vets.
v0.12 is 20-100 MO, no marine boost, no yisha nerf.
Losses look oddly like what I'd expect from the v0.2x line though. 5% losses for 5 rounds, more or less.
5% losses could also reflect the low end of close fight casualties, but with an attack strength at or close to 78 vs 44 defence strength, that was nowhere near a close fight.
And in your last Balor situation, you lost 41 marines.
Could you send me the save right before you attack?
Did you get/succeed/fail at any of Yisha's support missions? If so, how many?
-
- Posts: 1627
- Joined: Thu, 5. Aug 04, 01:57
Well I just took on a Titeral 
Had 34 vets and 16 elites with a 5 star officer.
Used the mod that lets me choose what to hit. (forget the name)
Told it I wanted to take out all the weapons, however before I followed Yisha telling me to take out the first weapon I took out the jump drive and engines.
Then I proceeded to take out all the weapons, (Found by taking out some blue things it made taking out weapons easier (I guess they were shields))
Anyway it took me nearly 1/2 an hour to take out all weapons, by the time I finished the titeral only had about 10% hull left (yea I a lousy shot
)
Got the win, and didn't loose a marine, I even got a vet promoted to elite
I was using the "v0.121_lubatomy" one that you did for me, and personally I am happy with it even tho it did take a long time to get the ship, I was just lucky it was in the middle of no-where with nothing interfering with me, otherwise I am certain I would have failed.

Had 34 vets and 16 elites with a 5 star officer.
Used the mod that lets me choose what to hit. (forget the name)
Told it I wanted to take out all the weapons, however before I followed Yisha telling me to take out the first weapon I took out the jump drive and engines.
Then I proceeded to take out all the weapons, (Found by taking out some blue things it made taking out weapons easier (I guess they were shields))
Anyway it took me nearly 1/2 an hour to take out all weapons, by the time I finished the titeral only had about 10% hull left (yea I a lousy shot

Got the win, and didn't loose a marine, I even got a vet promoted to elite

I was using the "v0.121_lubatomy" one that you did for me, and personally I am happy with it even tho it did take a long time to get the ship, I was just lucky it was in the middle of no-where with nothing interfering with me, otherwise I am certain I would have failed.
Link to the list of Mods working in X4-Foundations and also Link to the list of Mods working in X-Rebirth
NOTE: I play with a modded game, so any reports I make outlining suggestions/problems/bugs/annoyances, are made with mods installed and running.
NOTE: I play with a modded game, so any reports I make outlining suggestions/problems/bugs/annoyances, are made with mods installed and running.
-
- Posts: 2963
- Joined: Tue, 18. Nov 14, 16:23
Nice to hear from you, Wanderer.
With that many elites using the v.121_lubatomy, you'd be OP! You'd have an attack strength of 717.4, assuming a Marine Officer with 5/5/5 skills. You could have just hit the engines launched marines and relaxed. You'd have taken casualties from not doing the support missions from Yisha though.
Glad that your happy with it. But if you want, v0.201_lubatomy over at the Nexus uses the exact same math as v0.121 except ignoring or failing some of Yisha's support missions won't hurt you as much. Won't be as exciting, though.
With that many elites using the v.121_lubatomy, you'd be OP! You'd have an attack strength of 717.4, assuming a Marine Officer with 5/5/5 skills. You could have just hit the engines launched marines and relaxed. You'd have taken casualties from not doing the support missions from Yisha though.
Glad that your happy with it. But if you want, v0.201_lubatomy over at the Nexus uses the exact same math as v0.121 except ignoring or failing some of Yisha's support missions won't hurt you as much. Won't be as exciting, though.
-
- Posts: 1627
- Joined: Thu, 5. Aug 04, 01:57
Thanks, might have to give that one a go 
What I used to do in the old days, was to take out the weapons underneath, then the jump drive and engines, then let my marines loose from under the ship where I had taken out the guns, then either just wait or do a couple of things Yisha told me to do, but I wasn't really happy about taking down things I didn't really need to..
In the example I gave a couple of messages above, I did NOT take out the drone bay and ended up with 3 nice little drones to help my engineer to start repairs..

What I used to do in the old days, was to take out the weapons underneath, then the jump drive and engines, then let my marines loose from under the ship where I had taken out the guns, then either just wait or do a couple of things Yisha told me to do, but I wasn't really happy about taking down things I didn't really need to..
In the example I gave a couple of messages above, I did NOT take out the drone bay and ended up with 3 nice little drones to help my engineer to start repairs..
Link to the list of Mods working in X4-Foundations and also Link to the list of Mods working in X-Rebirth
NOTE: I play with a modded game, so any reports I make outlining suggestions/problems/bugs/annoyances, are made with mods installed and running.
NOTE: I play with a modded game, so any reports I make outlining suggestions/problems/bugs/annoyances, are made with mods installed and running.
-
- Posts: 1627
- Joined: Thu, 5. Aug 04, 01:57
Ooo another version to play with..w.evans wrote:v0.21x set out!
(Heads over to Nexus to get my v0.211_lubatomy to see what happens)

Hmmm little confused here, after installing it Nexus is saying my version is "0.211l" but then it telling me the latest version is "0.21" - Ohwell, I gonna ignore that.
Link to the list of Mods working in X4-Foundations and also Link to the list of Mods working in X-Rebirth
NOTE: I play with a modded game, so any reports I make outlining suggestions/problems/bugs/annoyances, are made with mods installed and running.
NOTE: I play with a modded game, so any reports I make outlining suggestions/problems/bugs/annoyances, are made with mods installed and running.
-
- Posts: 2963
- Joined: Tue, 18. Nov 14, 16:23
-
- Posts: 1627
- Joined: Thu, 5. Aug 04, 01:57
Yup, it does, although since I know what I after I don't usually take notice of the descriptionsw.evans wrote:Yup, sorry about that. Nexus only allows one version as the "latest version." Could cause a bit of confusion since we have several variants per version. Hoping that the short descriptions attached to the files themselves could clear that up though.
Does it?

All I do is bring up files, then look for the magic word "lubatomy" then download, as I know the latest is always first - real easy
Link to the list of Mods working in X4-Foundations and also Link to the list of Mods working in X-Rebirth
NOTE: I play with a modded game, so any reports I make outlining suggestions/problems/bugs/annoyances, are made with mods installed and running.
NOTE: I play with a modded game, so any reports I make outlining suggestions/problems/bugs/annoyances, are made with mods installed and running.
-
- Posts: 2963
- Joined: Tue, 18. Nov 14, 16:23
Sorry, boys and girls! Found a bug on v0.21x
Fixed it, and uploaded the better, slightly more bug-free version set designated v0.22x
If you were one of the few people who downloaded v0.21x, please download the corresponding v0.22x file. And you have my apologies.
edit: well, that sucks. Just wrote a let's play, and this bug fix announcement covered it up! Hmph.
Fixed it, and uploaded the better, slightly more bug-free version set designated v0.22x
If you were one of the few people who downloaded v0.21x, please download the corresponding v0.22x file. And you have my apologies.
edit: well, that sucks. Just wrote a let's play, and this bug fix announcement covered it up! Hmph.
Last edited by w.evans on Sat, 20. Dec 14, 11:28, edited 1 time in total.