[Mod] OOS Rebalance v2 (v2.10 - 04.06.11)

The place to discuss scripting and game modifications for X³: Terran Conflict and X³: Albion Prelude.

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

User avatar
Gazz
Posts: 12430
Joined: Fri, 13. Jan 06, 17:39
x3tc

[Mod] OOS Rebalance v2 (v2.10 - 04.06.11)

Post by Gazz » Thu, 26. May 11, 01:34

English / Deutsch

The intention of this mod is to "fix" OOS combat without being the performance hog that OOSR v1 had to be.
I won't go into detail on why OOS combat needs an overhaul. Use the links in the 2nd post if you're interested.

  • Compatibility: X3:TC vanilla ONLY

    Other mods will have to wait.
    No special coding required for other mods but I'll only tweak one laser set at this time.

    This script / mod will not run unless custom made TLasers / TBullets are detected.

    Several vanilla scripts will be overwritten.
    The new versions are actually improved even without the OOSR script but if you want to keep the originals, back them up.
    • !turret.swaptask.adv.pck
    • !fight.attack.object.std.pck
    • !plugin.acp.fight.attack.object.pck
    • !fight.attack.object.owp.pck
  • Mod Files
    • \types\Globals.txt
    • \types\TBullets.txt
    • \types\TLaser.txt
    These files are dropped into \types\ as unpacked files, giving them priority over the equivalent files in CAT archives.

    That makes them easier to edit... and delete.

    SG_OOS_FIGHT_MODE is enabled. That is why Globals.txt is one of the modded files.
  • Script Compatibility

    Custom turret scripts like MEFOS will not switch lasers back to the IS versions.

    Those that currently work are:
    • all vanilla turret scripts
    • Missile Defense Mk2 (be sure to DL the latest version)
    • MARS (be sure to DL the latest version)
    If scripts (CODEA?) use custom fight scripts instead of the ones I provided, these ships will not switch IS/OOS lasers correctly.
  • Used IS Laser Values (Changes)

    Flamer: 90 %
    CIG: 135 %
    IPG: 130 %
    ISR: 130 %
    MAM: 130 %
    All Flak: 95 %

    The "slow" mid-sized lasers now do more damage than Flak so they aren't always a worse choice.
    M6 can now do somewhat serious damage to make up for their sluggishness. Energy consumption not increased.
  • Used OOS Laser Values (Changes)

    Unless otherwise stated, all OOS lasers do 5 % of their IS damage.

    Flamer: about 75 % of HEPT damage

    IBL / IC / GC / PSP / PPC: 15 % of their IS damage

    PSG: 8 % more shield damage than PPC, only 1/3 of PPC hull damage.
  • OWP use their lasers OOS.
  • Ammo Consumption

    Lasers do not use ammo when OOS. (no, calm down!)
    Laser energy and bullet speed have no effect on OOS combat. These are the only advantages of ammo-based lasers.
    At their current damage values they have no advantage when OOS.

    In order to justify ammo consumption, their OOS damage would need to be increased.

    AI ships also do not have any kind of supply system, resulting in the capital ships usually having run out of ammo long before the player ever encounters them.
  • Logging is enabled by default.

    Lots of logging.
    If logging happens or not is controlled in setup.plugin.gz.oosr.

    If disabled, the logging script is not called at all, giving an accurate impression of the CPU load of this script's "normal" operation.

    Logging uses the exact same a.fight.script.fire26, that has been used for the original investigation of all OOS damage.
    Since now "real" turrets and lasers are fired, this script does exactly the same thing as before.
  • OOS Combat

    The setup script controls if classic behaviour (fire all turrets) is used or if ships only fire one random turret.

    Installation default is:
    Half the ship's turrets fire at it's attack target.
    Remaining turrets may fire at another target, provided it is "the" closest enemy.


ImageDownload: ZIP

TFiles are included for english and german.
Starting a new game is not required if you had been using vanilla (or similiar) lasers.
Turret scripts on player ships may need a restart.


  • - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  • I copied the entirety of TLasers and TBullets and create a complete alternate set for all "fighting lasers".
    The "other" IRE is simply the OOS IRE.

    Ammo usage, size, ware transport class, price, etc.... all the same.

    The big difference is, that these OOS lasers only do a tiny fraction of their IS damage, solving the issue that a single volley almost always end any OOS fight.
    It also fixes the issue that an M7 can all-too-often one-shot a much heavier ship. The heavier ship would get to round 2, bringing it's much heavier firepower to bear on the M7...

    Lasers that do not have an OOS version (like the tractor beam) will never be removed from a turret by the automated switching and will never be changed to a different laser type.
  • Since every OOS laser is now a unique item, it's stats can be adjusted up or down as needed.
  • The SG_OOS_FIGHT_MODE switch does not only decouple the turrets from always firing all at the same time, it also fixes a few bugs, leading to weapons doing OOS damage in proportion to their listed IS damage.
    That's a huge improvement over the "old" vanilla system already.
  • Some features of the old OOS-Rebalance script will certainly be worth revisiting, such as the counterfire / reactive counterfire system.
    It will have to have a very different structure but the basic idea that an M2 can engage (and destroy) more than a single fighter drone in one full combat turn still has merit.
  • Of course there will be... issues.
    Like... what do we do if the player cheats? How carefully do ships verify that the OOS mode is in effect? The player could just re-load the much more powerful regular lasers once the ship had switched to the OOS versions.
    My answer is: who cares? If the player wants a fleet of super ships, nothing, absolutely nothing can prevent that from happening.
  • Auto-loadout of newly created ships.
    AI ships (jobs) will all spawn with OOS weapons.

    Right now this is solved by hacking into the vanilla fight scripts.
    When the script intends to fire, it first checks if this ship has been set to the correct IS/OOS mode.
    This should eliminate all loadout issues.

    Turret scripts also do one such check on startup.
    When a ship enters "IS", all of it's turret scripts are automatically restarted by the engine.

    Lasers in the cargo bay are always carried as their IS versions so AI traders will be unaffected.
    Only the installed lasers are switched and traders don't sell these.
Last edited by Gazz on Thu, 22. Dec 11, 13:30, edited 14 times in total.
My complete script download page. . . . . . I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.

User avatar
Gazz
Posts: 12430
Joined: Fri, 13. Jan 06, 17:39
x3tc

Post by Gazz » Thu, 26. May 11, 01:35

Last edited by Gazz on Sun, 29. May 11, 11:12, edited 2 times in total.
My complete script download page. . . . . . I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.

User avatar
Gazz
Posts: 12430
Joined: Fri, 13. Jan 06, 17:39
x3tc

Post by Gazz » Thu, 26. May 11, 01:36

** reserved **
My complete script download page. . . . . . I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.

User avatar
Mizuchi
Posts: 803
Joined: Thu, 10. Feb 11, 06:48

Post by Mizuchi » Thu, 26. May 11, 02:06

If the player cheats, then that shouldn't really be your concern, nor part of the design methodology.

As you said: if a player wants to break their game, then that's entirely their perogative, and not your problem. :3

User avatar
Gazz
Posts: 12430
Joined: Fri, 13. Jan 06, 17:39
x3tc

Post by Gazz » Thu, 26. May 11, 02:19

I'm more concerned about perfectly normal trading.

Trader starts IS, buys a cargo hold full of PRG.
Then tries to sell them OOS at some dock... but finds out that the dock doesn't trade the "OOS PRG" it is now carrying.
My complete script download page. . . . . . I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.

Osiris454
Posts: 741
Joined: Tue, 4. Jan 11, 23:03
x3tc

Post by Osiris454 » Thu, 26. May 11, 03:31

Well, a trader cannot trade unless he's docked. So how about putting in a check to see if he is docked. If he is, then switch out the weapons. If not, then switch to OOS weapons.

EDIT: Actually, nevermind. I just realized that this would need to be run constantly on all traders throughout the Universe, checking to see if anyone has docked. The CPU cycles would be astronomical.

User avatar
TrixX
Posts: 2022
Joined: Wed, 18. Aug 10, 14:28
x3tc

Post by TrixX » Thu, 26. May 11, 05:23

Couldn't you just attack a check to the docked signal?
"If you’re not prepared to be wrong, you’ll never come up with anything original."
Sir Ken Robinson

HotSake
Posts: 472
Joined: Sun, 3. Jan 10, 23:15
x3tc

Post by HotSake » Thu, 26. May 11, 05:53

Why would lasers in the cargo hold be affected at all? The script just needs to swap equipped lasers when entering combat. Put IS laser in cargo, create and install OOS laser, go pew pew, destroy OOS laser, install IS laser. The OOS lasers should never hit the cargo hold.

I would think a check in the OOS script for the absence of enemies would signal the end of combat and give you a good place to reinstall IS lasers while the ship is still OOS, preventing some cases where their removal might be skipped by accident.

Additionally, the FIXMEUP script can be attached to multiple signals: ATTACKED, LOADWARE, and DOCKED, come to mind. These all provide good points to check the installed/in cargo lasers and make sure no OOS lasers remain inappropriately.

What really concerns me is the potential to see 2 entries for each laser in the compatibility section of the ship info panel. I suppose I could live with it if the new OOS combat was brilliant enough, but it would be annoying. Also, OOS combat takes place in 30 second rounds, correct? Is this value hardcoded or can you adjust the timing, because dropping the damage by a factor of 10 means battles could take an absurdly long time. Finally, this approach breaks compatibility somewhat by requiring every laser mod to double their entries in order to work with it. They'd basically have to include two versions to account for players using vanilla OOS scripts, right?

User avatar
Gazz
Posts: 12430
Joined: Fri, 13. Jan 06, 17:39
x3tc

Post by Gazz » Thu, 26. May 11, 07:01

A check or signal if docked is only halfway there.
Some trading scripts, like CAG, check stations along the way for a better deal and obviously they refer to their current cargo bay.

I also don't know if the signal is... fast enough. You can't fully trust the signals in X3.

HotSake wrote:Why would lasers in the cargo hold be affected at all? The script just needs to swap equipped lasers when entering combat.
Only changing installed lasers is the general idea but I can't know if another script might do some OOS weapon changing.
Would still have to do some basic check if a certain laser is installed.


I would think a check in the OOS script for the absence of enemies would signal the end of combat
That goes against the premise of not doing a lot of bulky calculations.

What really concerns me is the potential to see 2 entries for each laser in the compatibility section of the ship info panel. I suppose I could live with it if the new OOS combat was brilliant enough, but it would be annoying.
Nature of the beast.
Make a better suggestion that eliminates this necessity.

Also, OOS combat takes place in 30 second rounds, correct? Is this value hardcoded or can you adjust the timing, because dropping the damage by a factor of 10 means battles could take an absurdly long time.
With absurdly long you mean that the defender might get to shoot back at all?
Right now the defender usually dies from the first shot.
My complete script download page. . . . . . I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.

HotSake
Posts: 472
Joined: Sun, 3. Jan 10, 23:15
x3tc

Post by HotSake » Thu, 26. May 11, 07:11

Gazz wrote:
I would think a check in the OOS script for the absence of enemies would signal the end of combat
That goes against the premise of not doing a lot of bulky calculations.
The script interpreter isn't the fastest, but using the find ship command with the enemy flag can't be that slow. I suspect the performance hit of doing it at the end of each combat round is negligible.
Also, OOS combat takes place in 30 second rounds, correct? Is this value hardcoded or can you adjust the timing, because dropping the damage by a factor of 10 means battles could take an absurdly long time.
With absurdly long you mean that the defender might get to shoot back at all?
Right now the defender usually dies from the first shot.
You didn't answer the timing question. Also, by absurdly long, I mean 10 times as long just like I said. If you divide damage by 10, and don't change fire speed, you've divided DPS by 10 and effectively extended the length of all battles by 10 times. 1 minute for a pair of M2s to duke it out IS vs. 10 minutes OOS is a noticeable disparity. I'm not saying it's a deal breaker; I'm pointing it out as an issue and asking if it can be avoided by altering the combat timing to maintain roughly similar DPS for IS and OOS ships.

User avatar
Gazz
Posts: 12430
Joined: Fri, 13. Jan 06, 17:39
x3tc

Post by Gazz » Thu, 26. May 11, 09:24

OOS combat timing is controlled by the navigation instructions and cannot be altered without completely rewriting the combat scripts.


And I don't know how long long needs to be.
Right now long is too short because when you get the message that one of your ships is under attack, it's already gone.
The duration of most fights is < 1ms but 30 sec per additional ship.
Every 30 sec one ship dies. That's why fighter swarms are so effective OOS. An M2 can have all the firepower in the universe but it can still only kill one M5 every 30 sec.

That system is just borked.
My complete script download page. . . . . . I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.

paulwheeler
Posts: 8127
Joined: Tue, 19. Apr 05, 13:33
x3tc

Post by paulwheeler » Thu, 26. May 11, 09:47

As an added bonus, this script might enable us to reorder the second set of TLaser entries to influence AI weapon spawning without breaking saves.

I don't think any duplicate entries in TBullets are required - only TLasers since multiple lasers can fire the same bullet.

User avatar
Gazz
Posts: 12430
Joined: Fri, 13. Jan 06, 17:39
x3tc

Post by Gazz » Thu, 26. May 11, 12:08

You practically need extra bullets to fine tune the shield/hull damage of the OOS lasers.

But yes, the 2nd laser set can be sorted every which way. They'd have to automatically look up their parent laser anyway so it wouldn't matter which ID either had.
My complete script download page. . . . . . I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.

User avatar
wyvern11
Posts: 1702
Joined: Sat, 15. Jul 06, 20:59
x3

Post by wyvern11 » Thu, 26. May 11, 21:08

Well there definitely are long long fights - where some m5 attack some heavy freighter and leech him away (This is done by grep-sed-awk of some 10000 Combats. I have 80000-samples as well and they basically look the same )

Code: Select all

Starting Defender success-analysis - This may take some time
Number of Defenders : 12923
Returned fire count : 721  
Instant death count : 8303
Fight round statistics :
Rounds survived : 1 8529
Rounds survived : 2 1561
Rounds survived : 3 754
Rounds survived : 4 460
Rounds survived : 5 313
Rounds survived : 6 211
Rounds survived : 7 134
Rounds survived : 8 120
Rounds survived : 9 110
Rounds survived : 10 81
Rounds survived : 11 69
Rounds survived : 12 56
Rounds survived : 13 41
Rounds survived : 14 46
Rounds survived : 15 36
Rounds survived : 16 31
Rounds survived : 17 22
Rounds survived : 18 24
Rounds survived : 19 20
Rounds survived : 20 27
...
Rounds survived : 71 4
Rounds survived : 72 2
Rounds survived : 76 1
Rounds survived : 78 2
Rounds survived : 79 2
Rounds survived : 85 1
Rounds survived : 87 1
Rounds survived : 88 1
Which means some poor sucker survives some 40 Minutes (and there are significant numbers of them). Return fire would fix this issue though... poof
Redest du noch - oder denkst du schon ?

User avatar
Gazz
Posts: 12430
Joined: Fri, 13. Jan 06, 17:39
x3tc

Post by Gazz » Thu, 26. May 11, 23:28

Yeh, the "fire back" thing works... often.

When the ship for some reason has a priority 100+ script on task 0, it cannot fire back on any attackers while OOS.

Some return fire feature is relatively easy to do because it can be tied directly into the attacker's laser fire.
Just how... I haven't decided, yet.
My complete script download page. . . . . . I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.

Post Reply

Return to “X³: Terran Conflict / Albion Prelude - Scripts and Modding”