[MOD] Epic Capital Ship Shields

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

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

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

[MOD] Epic Capital Ship Shields

Post by w.evans » Mon, 19. Jan 15, 20:28

What's New:

Updated to v0.02.
  • External shield increase adjusted down considerably.
    Brought recharge rates back down to vanilla levels.
Capital ships now actually get blown up in a reasonable amount of time. (I think that the boost in v0.01 may have turned them indestructible, particularly OOZ.)

_____
What is this mod?

Got pissed off by capital ships getting one-shotted all the time OOZ, so I strengthened their shields. Interestingly, I don't yet know if it'll have any effect OOZ.* Makes capital ships a lot tougher IZ, though.

Not balanced yet, so they might rip stations to shreds. Consider yourselves warned.

* It works OOZ!

_____
Observed effects in-game: (This is NOT a feature list. These effects have both good and bad ramifications.)

* Capital ships under attack in different zones now actually survive long enough for you to respond.
* Capital ships now much more powerful than small squads of fighters, with the possible exception of the new bomber. Those still hurt.
* More capital ships get disabled, and eventually repair, than get outright destroyed. -> Since much of the freighter traffic is handled by job quotas, the freighters and miners getting disabled rather than destroyed are not replaced, and this leads to a slowing down in the economy in general.
* Since marauding Titurels now survive longer, they are able to do more damage to stations in general, thereby leading to resource sinks as prices for basic resources constantly need replenishing, but also leading to slowing down of production of intermediate and end-level goods.
* Capital ships boosting into a zone are much more vulnerable than those that have stayed in that zone long enough to fully charge their shields. -> This gives a huge advantage to defending patrols vs attackers, all other things being equal.


Other than the obvious, what this means to me as a player is that I need to build a more diverse network of stations to eventually be able to completely vertically integrate. Lots of profits to be made selling to the economy in general, and basic and intermediate resources are now more profitable. While my ships do get damaged more often, sometimes cripplingly so, I haven't gotten a destroyed capship OOZ since running this mod. (I do have a quick response squad of 3 Arawns to deal with any distress calls.) This makes my trading and mining fleets more stable, and makes handling them more manageable and less frustrating.

While it does tend to slow down the economy, it doesn't seem to do so to the point of killing the economy outright... yet, even after I modified the job file to generate double the number of pirate Titurels. Will update this if that happens.

_____
Installation:

Extract into your "extensions" directory.

_____
Uninstallation:

Disable in your in-game "Extensions" menu, or delete from your "extensions" directory.

_____
Compatibility:

Alters only the shield strength and shield recharge values (only two lines changed per file) in the following files:

shieldgenerator_size_l_mk1_macro.xml
shieldgenerator_size_l_mk2_macro.xml
shieldgenerator_size_l_mk3_macro.xml

No conflicts with any mods that I know of.

Does not alter saved games.

This mod is current as of X:R 4.00
Compatible with X:R 3.61

Compatible with Windows, Linux, and Mac versions of X Rebirth.

_____
Available for download here:

http://www.nexusmods.com/xrebirth/mods/441/?

_____
Check out my other mods for X Rebirth:
MarineRebalance,
BetterAutoAim,
SmalltalkHack,
Station Engineers,
Engineer Drone Fix,
Slightly More Useful Plot Station,
DockAllDrones,
Miscellaneous OOZ Combat Tweaks,
Miscellaneous IZ Combat Tweaks,
DifficultyHack
Last edited by w.evans on Tue, 1. Mar 16, 08:16, edited 25 times in total.

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

Post by w.evans » Tue, 20. Jan 15, 02:41

It works OOZ! Just captured myself my very first Balor in this gamestart. Was spawned by a Cartel Boss Vulnerable mission in the opposite side of Inner World from where I was, and it was still intact when I got there! After which 3 Marauding Titurels appeared, and they stayed unwrecked long enough for me to cap them one by one, then a 4th jumped in, and I got that one too. Ok, the cap shielding might be a little bit too strong with this. Might have to tweak the shields down a bit.

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

Post by w.evans » Fri, 23. Jan 15, 12:49

What's New:

Updated to v0.02.
  • External shield increase adjusted down considerably.
    Brought recharge rates back down to vanilla levels.
Capital ships now actually get blown up in a reasonable amount of time. (I think that the boost in v0.01 may have turned them indestructible, particularly OOZ.)

Archaeosis
Posts: 328
Joined: Sat, 3. May 14, 12:36
x4

Post by Archaeosis » Fri, 23. Jan 15, 13:06

Could you give us some idea of what degree you've changed things by? 2x as much, 5x? Is it different for each type?

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

Post by w.evans » Fri, 23. Jan 15, 13:21

Yup, sorry. v0.01 was * 100 for all external capship shields, and * 10 for recharge rates. Was mostly to see if it would work, and what effect it would have on the economy, OOZ combat, IZ combat, boarding, etc.

v0.02 strengthens all capship shields * 10, and recharge rates brought back down to vanilla levels.

Still ballpark figures. Would appreciate any feedback on if it should be tweaked up or down from * 10. Ideally, I think, it would just be enough to give us some time to respond to "Help! Being attacked!" notifications, but with minimal impact on the economy via station ravaging.

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

Post by w.evans » Thu, 29. Jan 15, 23:17

added some observed in-game effects to the OP.

Rubini
Posts: 452
Joined: Mon, 7. May 07, 05:17
xr

Post by Rubini » Mon, 2. Feb 15, 16:23

Hi w.evans,

Thanks by this mod!
Do you know if we have also any other fix/workaround/mod for the OOZ issue?

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

Post by w.evans » Mon, 2. Feb 15, 16:27

Unfortunately, I haven't found the file/s where OOZ calculations are done. Wanted to do that shortly after doing Marine Rebalance. This mod does, however, make all cap ships survive longer OOZ. (But this applies to ALL capital ships, including marauder Titurels. So stations everywhere incur more damage on average.)

edit: forgot to add that I suspect that the OOZ calculations are scattered among the various fight.x.y.z.xml files in aiscripts. I'm not very familiar with those scripts, though, so haven't touched them outside of modding cicero111's stuff for my personal amusement.

Rubini
Posts: 452
Joined: Mon, 7. May 07, 05:17
xr

Post by Rubini » Mon, 2. Feb 15, 19:47

w.evans wrote:Unfortunately, I haven't found the file/s where OOZ calculations are done. Wanted to do that shortly after doing Marine Rebalance. This mod does, however, make all cap ships survive longer OOZ. (But this applies to ALL capital ships, including marauder Titurels. So stations everywhere incur more damage on average.)

edit: forgot to add that I suspect that the OOZ calculations are scattered among the various fight.x.y.z.xml files in aiscripts. I'm not very familiar with those scripts, though, so haven't touched them outside of modding cicero111's stuff for my personal amusement.
Probably this issue could not be difficult to fix, perhaps the original files have few lines that calculate the OOZ combat - as it is probably just numbers - perhaps some missing valour about shields/armour there.
The difficulty will be find these lines... :twisted: 8)

UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Post by UniTrader » Mon, 2. Feb 15, 20:00

<apply_attackstrength /> is it iirc
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)

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

Post by w.evans » Mon, 2. Feb 15, 22:12

Thanks, UniTrader.

from fight.attack.object.capital.xml:

Code: Select all

<!-- For each enemy, apply strength-->
<do_while value="$enemies.count" min="1">
  <debug_text text=" ' unknown. fight. enemies: ' + $enemies " chance="$debugoutputchance" />

  <do_all exact="$enemies.count" counter="$i" reverse="true">
    <!-- Search/Attacking waiting time -->
    <set_value name="$waittime" min="500ms" max="10s" profile="decreasing" />
    <wait exact="$waittime"/>

    <do_if value="@$enemies.{$i}.isoperational">
      <set_value name="$target" exact="$enemies.{$i}" />
      <!-- exclude the player ship in OOS case, this scenario wouldn't make any sense anyway -->
      <do_if value="$target != player.primaryship">
        <!-- Get and apply strengths-->
        <do_if value="$target.isoperational" chance="[this.combinedskill, 90].max" comment="chance of succeed">
          <!-- do not attack objects that are too far away, gravidar range can be 50km+ !! -->
          <do_if value="this.ship.distanceto.{$target} lt ($FiringRange + $target.size/2.0)">
            <!-- Get the strength in 'result'-->
            <get_attackstrength object="this.ship" target="$target" result="$result" />
            <!-- Apply the strength to target -->
            <apply_attackstrength object="$target" attacker="this.ship" strength="$result * ($waittime)f" result="$isdead" />
            <debug_text text="'%1 OOS. Apply strength of %2 against %3 is: %4(%5|%6). Is killed: %7'.[player.age,this.ship.knownname,$target.knownname,$result * ($waittime)f,$target.hull,$target.shield,$isdead]" chance="$debugoutputchance" />
          </do_if>
          <do_else>
            <debug_text text="'%1 OOS. Apply out of range of %2 against %3. Distance %4, fire range %5'.[player.age,this.ship.knownname,$target.knownname,this.ship.distanceto.{$target},$FiringRange]" chance="$debugoutputchance" />
          </do_else>
        </do_if>
        <do_else>
          <debug_text text="'%1 OOS. Apply attack fail of %2 against %3'.[player.age,this.ship.knownname,$target.knownname]" chance="$debugoutputchance" />
        </do_else>
      </do_if>
    </do_if>
    <do_else>
      <remove_value name="$enemies.{$i}" />
    </do_else>
  </do_all>
  <!-- Avoid an infite loop-->
  <do_if value="player.age" min="$attacktime">
    <break/>
  </do_if>
</do_while>
from fight.attack.object.station.xml

Code: Select all

<!-- Attack while there are enemies.  -->
<do_while value="$enemies.count" >
  <!-- Iterate in reverse and remove if neccesary -->
  <do_all exact="$enemies.count" counter="$i" reverse="true">
    <do_if value="@$enemies.{$i}.isoperational">
      <!-- Check object -->
      <check_object result="$result" object="$enemies.{$i}" maybeattackedby="this.station" functional="true">
        <match_distance object="this.station" max="$stationfirerange + $enemies.{$i}.size/2.0" />
      </check_object>
      <!-- If is enemy and is in range -->
      <do_if value="$result">
        <do_if value="$enemies.{$i} != player.primaryship">
          <!-- exclude the player ship in OOS case, this scenario wouldn't make any sense anyway -->
          <set_value name="$target" exact="$enemies.{$i}" />
          <!-- Get and apply strengths-->
          <get_attackstrength object="this.station" target="$target" result="$result" />
          <apply_attackstrength object="$target" attacker="this.station" strength="$result" result="$isdead" />
          <!-- simulate OOS ammo usage for NPCs, TODO: improve -->
          <do_if value="not this.station.isplayerowned">
            <remove_ammo object="this.station" macro="macro.missile_turret_dumbfire_macro" amount="2" chance="2" />
            <remove_ammo object="this.station" macro="macro.missile_turret_swarm_macro" amount="2" chance="2" />
          </do_if>
          <debug_text text="'%1 OOS. Apply strength of %2 against %3 is: %4(%5|%6). Is killed: %7'.[player.age,this.station.knownname,$target.knownname,$result,$target.hull,$target.shield,$isdead]" chance="$debugoutputchance" />
        </do_if>
      </do_if>
      <do_else>
        <!-- Remove from enemy list -->
        <remove_from_group group="$enemies" object="$enemies.{$i}" />
      </do_else>
    </do_if>
    <!-- Search/Attacking waiting time -->
    <wait min="1s" max="5s" profile="decreasing" />
  </do_all>
  <!-- Avoid an infite loop-->
  <do_if value="player.age" min="$attacktime">
    <debug_text text="' unknown. break attack loop because attacktime is more than ' + $attacktime" chance="$debugoutputchance" />
    <break/>
  </do_if>
</do_while>
I wonder how attackstrength is calculated. UniTrader, do your experimental ships do ok OOZ? Is their attackstrength calculated sensibly? (Would give us a clue as to whether this is a calculation on actual working weaponry on board, or hard-coded depending on ship hull.)

Are these commands (get_attackstrength, apply_attackstrength, repair_component) hard-coded?

It looks like a turn-based you-punch-me-I-punch-you with alpha strikes? (Everyone fires everything they can at range.) I wonder how initiative is decided, other than range. So fast glass cannons (high initiative ships with lots of long range powerful guns) ought to win all the time?

Anyone care to build something like that as a test case? (Say, with a single Mk1 shield generator, but lots and lots of something long-range and hard-hitting like JET/LR?)

UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Post by UniTrader » Mon, 2. Feb 15, 22:30

well, it does not work ok with my ships, but thats not related to some hard code but to how i add surface systems to a Ship :P

from what i know the value depends on which Weapon Systems are installed, but only these defined in the macro are actually taken into account - same applies to the dps valueok, you can consider it a bug with the Hardcode, but its not something you will ever encounter in Vanilla
(not that this matters for the usual stuff, its just one of the hindrances for my plan with dynamic Ship Upgrades))
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)

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

Post by w.evans » Mon, 2. Feb 15, 22:59

@UniTrader, I don't think it's a bug. Just, I don't know, disappointing? Not a whole lot we can play with here. And it raises a lot of questions. How is range determined? Is it per weapon, or an average of the whole ship, or pre-set? Is the Balor's range nerfed OOZ because it has HIT/MA turrets? Is damage taken into account? Will a fully-disabled Fulmekron have the same dps OOZ as a fully-functioning one? If a station's HIVI/MA turret ranges and gravidar range were increased, would it be able to fire at everything in the whole zone with all of it's HIVI/MA turrets? Every round? Would it fire first?

From the capship script, $FiringRange is defined as:

Code: Select all

<set_value name="$FiringRange" exact="this.ship.maxcombatrange.all"/>
Does that mean that a Sucellus fires all of it's turrets at the range of the IHC OOZ? (Which begs the question: why then does the Sucellus seem to suck vs Taranis OOZ?) If all of those HIT/MA turrets were changed to Hailstorms, would it fire all of those Hailstorms at IHC range OOZ?

Sorry, had a rush of questions. Don't mind me. Just thinking out loud.

Rubini
Posts: 452
Joined: Mon, 7. May 07, 05:17
xr

Post by Rubini » Tue, 3. Feb 15, 00:45

get_attackstrength/apply_attackstrengh must be the result of some combined details of each ship: hull, shield, weapons and crew skill among others.

If we not find how to modify this "attackstrength" calc directly we could think in cheating it adding a "fake" number into the above calc just for player´s ships and this could do the trick. I´m not experienced into the game yet, but after read about it seems that the main problem is that the AI ships/armadas are frequently more strong than player´s ones when in OOZ combat.

Edited: something like this (not in correct syntax, just an example):

Code: Select all

 <get_attackstrength object="this.station" target="$target" result="$result" /> 

if this ship belongs to player than set get_attackstrength = get_attackstrength * 2 comment="make it 100% major"

<apply_attackstrength object="$target" attacker="this.station" strength="$result" result="$isdead" /> 

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

Post by w.evans » Tue, 3. Feb 15, 01:10

Rubini wrote:I´m not experinced into the game yet, but what i read i understood that the main problem is with player´s ships/armadas OOZ. The Ai ships/armadas are frequently more strong.
I don't see a preference for NPC-owned ships anywhere, though; nor a coded disadvantage for player-owned assets. Certainly not in the capship script, nor in the fighter script. There are several

Code: Select all

<do_if value="(this.station.trueowner != faction.player) or @this.$config_attackenemies">
conditions in the station script, but those would then return true (and stations with HIVI/MA turrets should fire first) if the station-based defence officers were all simply set to attack rather than defend.

I would venture a guess that smallships would always have the initiative as long as they're within range. And since damage seems to apply to only one target at a time, a group of fighters could destroy a single heavy capship since they would all fire first, and all of their fire would hit, while the capship could only hit them (and most likely destroy a fighter per round) one at a time. However, this should already be lessened by a lot by either this mod increasing capship shields, or Nidaren's mod increasing hull strength.

edit:
Rubini wrote:Edited: something like this (not in correct syntax, just an example):

Code: Select all

 <get_attackstrength object="this.station" target="$target" result="$result" /> 

if this ship belongs to player than set get_attackstrength = get_attackstrength * 2 comment="make it 100% major"

<apply_attackstrength object="$target" attacker="this.station" strength="$result" result="$isdead" /> 
That's certainly doable. Something like:

Code: Select all

  <remove sel="/aiscript/attention/actions/do_while[@value='$enemies.count']/do_all/do_if/do_if/do_if/do_if/apply_attackstrength"/>

  <add sel="/aiscript/attention/actions/do_while[@value='$enemies.count']/do_all/do_if/do_if/do_if/do_if">
    <do_if value="this.owner == faction.player">
      <apply_attackstrength object="$target" attacker="this.ship" strength="$result * ($waittime)f * 10" result="$isdead" />
    </do_if>
    <do_else>
      <apply_attackstrength object="$target" attacker="this.ship" strength="$result * ($waittime)f" result="$isdead" />
    </do_else>
  </add>
in aiscripts/fight.attack.object.capital.xml, for example, should give a huge advantage to player-owned capships; but a large enough number of smallships, or, say, four Marauder Titurels vs a single Arawn, would still tear it down, because the capship would be applying all of that strength at a single target each round. I think that might be the bigger problem. Capships firing at one target at a time is simply not what we observe in-game, but it looks like that's what's happening OOZ.

I could be wrong, of course. And I need to emphasize that I'm not at all familiar with the vanilla fight scripts.

edit 2: also, defence officers set to "defensive" would most likely always fire only after they're hit. If they're hit hard enough in the first round, then they're gone.

edit 3: come to think of it, this might be much improved with Ego's improved escort scripts. I noticed that capships set to escort now actively have an attack command active when the ship that they're escorting is attacked. So they shouldn't try to just maintain formation with the ship that they're escorting and fire when a hostile ship is in range anymore. They should actively try to maneouver and attack hostile ships. (And, mechanically, the fight scripts should be activated on them.)

Rubini
Posts: 452
Joined: Mon, 7. May 07, 05:17
xr

Post by Rubini » Tue, 3. Feb 15, 01:41

Isn´t possible then to, when in OOZ combat, also cheat the rounds to make the player ship fire more times per rounds or make the small ships less powered/less shielded and also make the DO always stay in offensive instance when in OOZ combat? :?:

Edit: unless we can find a more "refined" solution.

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

Post by w.evans » Tue, 3. Feb 15, 02:03

Or make it possible to engage multiple targets, like IZ. Preferably with a sort of calibrated response. That could then be reasonably applied on all ships rather than just the player-owned ships. Hmm.

Rubini
Posts: 452
Joined: Mon, 7. May 07, 05:17
xr

Post by Rubini » Tue, 3. Feb 15, 02:49

w.evans wrote:Or make it possible to engage multiple targets, like IZ. Preferably with a sort of calibrated response. That could then be reasonably applied on all ships rather than just the player-owned ships. Hmm.
Seems that we will have a new cake soon... :D :D

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

Post by w.evans » Sun, 28. Jun 15, 09:02

Compatibility update - should now be compatible with Linux and Mac versions.

Windows users need not re-download.

However, I am unable to verify compatibility since I don't have access to a box running Linux or whatever they're calling the Mac OS at the moment, so feedback on this would be greatly appreciated.

Post Reply

Return to “X Rebirth - Scripts and Modding”