[MOD] Marine Rebalance

The place to discuss scripting and game modifications for X Rebirth.

Moderators: Moderators for English X Forum, Scripting / Modding Moderators

w.evans
Posts: 2963
Joined: Tue, 18. Nov 14, 16:23
x4

Post by w.evans » Mon, 15. Dec 14, 23:18

@DaveDee camus' Boarding Options mod helps. Gives you more information, and more control over the support aspect of the boarding operation.

You can get it here, I think:

http://forum.egosoft.com/viewtopic.php?t=373089

DaveDee
Posts: 285
Joined: Sat, 18. Oct 14, 13:10
x4

Post by DaveDee » Tue, 16. Dec 14, 18:57

Yeah, know about it. That was rock in direction of vanilla game.

Another one:

My newbie boarding power - 36 points (50 marines total, 11 vets 4/5/5 MO)

Balor - 74 from begining, 43 after stripping it almost to carcass.
So i cant even capture it in vanilla? Wtf? By the way, that is weakest ship, as i can see for now...

With your mod it was win, but but i got 49 marines dead... and only one vet back. Don't know how to get more vets now.

w.evans
Posts: 2963
Joined: Tue, 18. Nov 14, 16:23
x4

Post by w.evans » Tue, 16. Dec 14, 19:15

Come to think of it, the Balor might not be a good choice for training up recruits. Too fragile. You could try a Sucellus, they pop up sometimes in Cartel Boss missions. I'll look into the figures to try and explain your result though. And thanks! Data is always welcome.

w.evans
Posts: 2963
Joined: Tue, 18. Nov 14, 16:23
x4

Post by w.evans » Tue, 16. Dec 14, 19:21

Was the win with v0.12? And did you reduce the Balor's defence strength at all? Without defence strength reduction, fight outcome would be 2. (74-72) That would be a close fight, possibly getting 5 to 10 casualties per round.

49 casualties works out to 5 to 10 rounds. Possibly more if the random number generator gave you some of the rounds. Haven't looked into how the number of rounds per boarding action is calculated yet though.

DaveDee
Posts: 285
Joined: Sat, 18. Oct 14, 13:10
x4

Post by DaveDee » Tue, 16. Dec 14, 19:33

Sry, not only one vet, my mistake.

8 recruits+1 vet, after 39/11.
Balor was at 1% hull without surafce elements. Even without radar, don't know does it even count =_=

Thx for info about Sucellus. Forgot about them, cause my DV doesn't have any L or XL ships atm, don't know why.

w.evans
Posts: 2963
Joined: Tue, 18. Nov 14, 16:23
x4

Post by w.evans » Tue, 16. Dec 14, 19:57

Hm. Going from your vanilla figures, stripping that Balor should have dropped the defence strength down to around 43. If you launched your marines after stripping the Balor down, that should have been a sure win (-29 fight outcome) with absolutely no casualties.

Sorry, man. No explanation for that yet. Will have to see if ignoring Yisha's missions affects the outcome one way or another. (But if the Balor was stripped, Yisha shouldn't have any missions left to issue.)

User avatar
NZ-Wanderer
Posts: 1623
Joined: Thu, 5. Aug 04, 01:57
x4

Post by NZ-Wanderer » Tue, 16. Dec 14, 20:04

Well I really don't know which way to vote yet, cause I really suck at maths etc :P

But from what I can sorta figure out I would probably lean towards the 0.121 variation (no I haven't voted yet)

Personally, I am wondering if it could be something like:

1/1/1
50 recruits vs Balor heavy losses lose if ship not damaged enuff
50 veterans vs Balor Medium Losses lose if ship not damaged enuff
50 veterans vs Rahanas Medium Losses lose if ship not damaged enuff
50 elite vs Balor Light losses but Win as long as important parts of ship taken out (engines/jump drive)
50 elite vs Rahanas Light losses but Win as long as important parts of ship taken out (engines/jump drive)
50 elite vs Taranis Light losses but Win as long as important parts of ship taken out (engines/jump drive)

5/5/5
50 recruits vs Balor Medium Losses lose if ship not damaged enuff
50 veterans vs Balor Light losses but Win as long as important parts of ship taken out (engines/jump drive)
50 veterans vs Rahanas Light losses but Win as long as important parts of ship taken out (engines/jump drive)
50 elite vs Balor 0 to 5 losses (depending on ship type) but Win as long as important parts of ship taken out (engines/jump drive)
50 elite vs Rahanas 0 to 5 losses (depending on ship type) but Win as long as important parts of ship taken out (engines/jump drive)
50 elite vs Taranis 0 to 5 losses (depending on ship type) but Win as long as important parts of ship taken out (engines/jump drive)

I did it this way cause I understand it, I am sure you could put it into your number thingie :)

Probably not much help, but that's what I think anyway..

What really gets me out of the whole boardng thing tho is "having" to do the Yisha missions (but you probably already seem that in other threads :) )
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.

DaveDee
Posts: 285
Joined: Sat, 18. Oct 14, 13:10
x4

Post by DaveDee » Tue, 16. Dec 14, 20:34

At least i found how to upgrade marines.

Hav'nt noticed that drones have now HUGE affect on defence strength.
Even Rahanas has about 120 def points, but mostly because of cargo lifters (why?!).

For examle, Sanahar has about 155 points, but 2/3 of that part goes from drones. After destroing all surface elements and hull up to 5%, i got 6(!!) total defence poins, making it very easy to capture. At the cost of all drones.

Balor just does not have drone bay. So, logically, i think it's even more easy to capture larger ships, like Taranis, cause you can reduce total poinst dramatically.

Now i just don't know how to balance it smart...

w.evans
Posts: 2963
Joined: Tue, 18. Nov 14, 16:23
x4

Post by w.evans » Tue, 16. Dec 14, 21:40

@NZ-Wanderer Sorry about that. I love math, and used to be pretty good at it; but haven't been able to indulge in a loooooong time. (Probably close to 20 years now.) Got a bit carried away (and also found that I kinda suck at it now.)

It might be helpful to note that the numbers don't take any damage caused into account, mostly because I couldn't find anything in the code about how defence strength is computed. Not saying it's not there, just that I haven't found it.

So target's defence strength minus your attack strength equaling anything less than -10 should be a sure win without casualties, without having to do anything. (And I say should because DaveDee's recent report just threw my code interpretation off. Still looking for anything signifying failure of Yisha's missions leading to casualties or decreasing of attack strength, and haven't yet found anything.) That is, when attacking a Balor with 50 elites led by a 5/5/5 Marine Officer in vanilla v3.0 (or now 3.10 RC2), one should only have to blow the engines, blow the jump drives, launch marines, and wait.

From your description of your preferred balance points, it looks like you'd prefer something like v0.121, but toned down a bit. The distinction between losses, light losses, and 5-10 losses will require writing an additional casualty category (in the code that I've analyzed so far, your team could suffer heavy casualties, 5-10 casualties, or no casualties per round.) Maybe a lubatomy v0.121. Could cook that up for you tonight.

It will be hard to adjust the Balor up though, because it's defence strength is so low because it doesn't have any drones, but is hard to capture with inexperienced marines because it's so fragile.


@DaveDee Yup, that and defence officer skill accounts for the sometimes huge difference in defence strength in same class ships. (I remember seeing two ships of the same class -- think they were Titurels, but couldn't be sure -- with one having a defence strength of around 200, the other around 400.) But yeah, blowing up the drone bay should lower the defence strength by quite a bit, at the cost of depriving you of drones from your capture.

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.


Thanks for the feedback! Keep it coming!

w.evans
Posts: 2963
Joined: Tue, 18. Nov 14, 16:23
x4

Post by w.evans » Tue, 16. Dec 14, 21:54

@DaveDee In your Balor encounter, do you remember if you stripped the Balor down before you launched marines, or after?

lubatomy
Posts: 234
Joined: Mon, 29. Dec 03, 15:22
x4

Post by lubatomy » Tue, 16. Dec 14, 22:25

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.

w.evans
Posts: 2963
Joined: Tue, 18. Nov 14, 16:23
x4

Post by w.evans » Tue, 16. Dec 14, 22:51

@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:

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>
and here?

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>
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.

DaveDee
Posts: 285
Joined: Sat, 18. Oct 14, 13:10
x4

Post by DaveDee » Tue, 16. Dec 14, 23:06

@w.evans

Before, for sure. It was abour 43 points of def right before launching pods

w.evans
Posts: 2963
Joined: Tue, 18. Nov 14, 16:23
x4

Post by w.evans » Tue, 16. Dec 14, 23:10

@DaveDee And from this new data from lubatomy, it looks like your 9 were lucky to get out alive. I do believe that a Yisha nerf is in order. (Poor Yisha. I do realize that it isn't her fault.)

w.evans
Posts: 2963
Joined: Tue, 18. Nov 14, 16:23
x4

Post by w.evans » Tue, 16. Dec 14, 23:37

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.

w.evans
Posts: 2963
Joined: Tue, 18. Nov 14, 16:23
x4

Post by w.evans » Wed, 17. Dec 14, 01:49

@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.

lubatomy
Posts: 234
Joined: Mon, 29. Dec 03, 15:22
x4

Post by lubatomy » Wed, 17. Dec 14, 03:35

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.
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.

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.

w.evans
Posts: 2963
Joined: Tue, 18. Nov 14, 16:23
x4

Post by w.evans » Wed, 17. Dec 14, 08:28

@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?

DaveDee
Posts: 285
Joined: Sat, 18. Oct 14, 13:10
x4

Post by DaveDee » Wed, 17. Dec 14, 12:31

There was only 1 hacking stage, did it good. So i really dont see reason to loose 4/5 of all marines.
Save file is already overwritten... i'll try to catch another one, to provide more data.

w.evans
Posts: 2963
Joined: Tue, 18. Nov 14, 16:23
x4

Post by w.evans » Wed, 17. Dec 14, 20:53

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!

Post Reply

Return to “X Rebirth - Scripts and Modding”