[MOD] [IDEA] I wonder how I could implement ship refits

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

Post Reply
Overwatch
Posts: 21
Joined: Wed, 18. Jun 14, 19:29

[MOD] [IDEA] I wonder how I could implement ship refits

Post by Overwatch » Sun, 29. Jun 14, 00:56

I'm a long time Bethesda game modder, who is new to the X series of games. I've been poking around the modding scene here for a few days and I have an idea for how I might build a mod. I'm not sure I'll ever do it, because it might just be too tedious to create without some way to automate the process, but let me run the details by you all to see if I'm even understanding it correctly.

Here is how I understand ships to work
  • Object files define
    • Ship 3d model to use
    • Turret numbers, placements, and firing arcs
    • Docking bay/point placements
    • Camera placements
    • (More than 1 ship can use the same object file)
  • Tships has an entry for each Ship model. This Entry defines things like and compatible weapons
    • What Object file to use
    • Ship Name
    • Price
    • Base Speed/Acceleration/Turning/Cargo Space
    • Maximum number of Cargo/Engine/Steering tunings allowed
    • Maximum hull points
    • Shields Number/Type/Recharge
    • Weapons allowed on each turret
    • Weapon Capacitor/Recharge
    • Compatible missiles
    • Other visual and audio options
  • This means only things that can be changed while in game are
    • Tunings (it seems more than the 'max' can be applied if you use a script to do it)
    • Weapons installed in each Turret. Must be from the allowed list in Tships
    • Ship Equipment/Software
So if this is my characters situation (in character)
  • Owns a Terran Cutlass
  • Terran Cutlass has hardpoints for Terran weapons
  • Character wants to install Commonwealth weapons on his ship
Then he has 2 options (in character)
  1. Character Brings his Cutlass to a mechanic who modifies the ship hardpoints to fit stock Commonwealth weapons. Ship would no longer accept Terran weapons.
  2. Character brings Commonwealth weapons to a mechanic who modifies the mounting plates on them to fit Terran hardpoints. Weapons would now only work on Terran ships, and character would need to get every weapon modified that he wants installed.
If I understand correctly, in order for this to happen in game, These things would have to happen behind the scenes. These would need to be done BEFORE it was needed in game. Probably needing a fresh game.
  1. To refit Cutlass hardpoints to accept Commonwealth weapons
    • A new ship would need to be created in Tships
    • This new ship would have different allowable weapons
  2. To refit weapons to accept old hardpoints
    • New weapons would need to be created in Tlasers (Just clone the Commonwealth ones. In this case with a new name)
    • All Terran ships would need to be modified in Tships to add the newly created weapons to their permitted weapons list
    • (This seems like a poor option because
      • it may break scripts that rely on weapons
      • It requires me to modify every ship in Tships in addition to modifying Tlasers
      • It limits me to only making weapon changes, even though I have to modify ships
Along with the background edits, in order to actually get these items into the game. A script (or mission?) would need to be created that took your item (Ship or weapons depending on which option you wanted) and then gave you back a brand new item in exchange.

Does this just about explain how it would be done?
Last edited by Overwatch on Sun, 29. Jun 14, 01:56, edited 1 time in total.

Overwatch
Posts: 21
Joined: Wed, 18. Jun 14, 19:29

Post by Overwatch » Sun, 29. Jun 14, 01:55

Since making new ships seems the best way to do this. Why not extend the current ship variations while we are at it? Currently we have ship 'trim packages' like Raider and Vanguard. Why not get more granular? I could do stuff like...
  • Mass Modifications
    • Mass Reduction - L
      • +Acceleration/Turning
      • -Hull
      • Incompatible with other Mass Modifications
    • Heavy Armor - H
      • +Hull
      • -Acceleration/Turning
      • Incompatible with other Mass Modifications
    • Fiber-Reinforced Armor - F
      • +Acceleration/Turning
      • No change in hull but MUCH more expensive (Which I think will make it more expensive to repair too?)
      • Incompatible with other Mass Modifications
  • Power System Modifications
    • Oversized Engines - E
      • +Max Speed
      • -Cargo space
    • Heavy Shielding - S
      • Extra Shield mount(s)
      • Some sort of negative. With a reasonable explanation. Maybe
        • -Laser Capacitor, Power diverted from weapon capacitors
        • -Max Speed, Power diverted from Engines
        • -Weapon hardpoints, Install a shield on a weapon mount?
    • Oversized Reactors - R
      • +Shield/Laser Recharge
      • -Cargo space
  • Weapon System Modifications
    • Commonwealth Hardpoints - C
      • Allow Commonwealth Fighter class Weapons
      • Disallow Terran/Kha'ak Fighter class Weapons
      • Incompatable with Terran/Kha'ak/Universal Hardpoints
    • Terran Hardpoints - T
      • Allow Terran Fighter class Weapons
      • Disallow Commonwealth/Kha'ak Fighter class Weapons
      • Incompatible with Commonwealth/Kha'ak/Universal Hardpoints
    • Kha'ak Hardpoints - K
      • Allow Kha'ak Fighter class Weapons
      • Disallow Commonwealth/Terran Fighter class Weapons
      • Incompatible with Commonwealth/Terran/Universal Hardpoints
    • Universal Hardpoints - U
      • Allow Terran Fighter class Weapons
      • Allow Commonwealth Fighter class Weapons
      • Allow Kha'ak Fighter class Weapons
      • I'll have to think of a negative. Maybe one of...(Determined beforehand, not player choice)
        • Much higher cost
        • Less total hardpoints (even if this makes sense, universal mounting points would take up more space, I can't EVER see anyone using this unless there is some overpowered Commonwealth/Terran/Kha'ak weapon combination I am not seeing)
        • Lower laser recharge
      • Incompatible with Commonwealth/Terran/Kha'ak Hardpoints
    • Oversized Hardpoint - O
      • Trade 4x front Fighter sized hardpoints for 1x Corvette sized one (or some other ratio that makes sense)
The letter code identifies the upgrade. Example
  • Nova - FEO
    • Take a Nova and add...
    • Fiber-Reinforced Armor
    • Oversized Engines
    • Oversized Hardpoint
I realize that this will require me to pre-make a ship for every possible combination of modifications to a base ship before hand, but even one base ship is enough work that I may as well design a tool to do it.
I could probably simplify the process a bit by saying that multiple types of 'Input' ships would result in the same 'Output' ship.

For example. If you want a...
  • Nova - FEO

...you can bring the mechanic a...
  • Nova
  • Nova Prototype
  • Nova Raider
  • Nova Sentinel
  • Nova Vanguard
  • Pirate Nova
  • Pirate Nova Raider
...and the output ship would be the same. Without crunching the numbers, I'm unsure if this part would work because the variants already do some of these things, and they may do them to a similar degree as the mod intends (Although with FAR less options).

Overwatch
Posts: 21
Joined: Wed, 18. Jun 14, 19:29

Post by Overwatch » Sun, 29. Jun 14, 02:09

Hrm. I did a little math. Turns out that there are 256 unique combinations of modifications I listed above. Not a TERRIBLE thing considering I would already have to be using a tool to make them BUT...

...Does anyone know how the X3 engine would handle a Tships file with 20,000 ships in it? Because that is how many there would be if I did this on each base model M5/M4/M4+/M3/M3+/M6/M6+.

User avatar
Jack08
Posts: 2993
Joined: Sun, 25. Dec 05, 10:42
x3tc

Post by Jack08 » Sun, 29. Jun 14, 02:25

Overwatch wrote:Hrm. I did a little math. Turns out that there are 256 unique combinations of modifications I listed above. Not a TERRIBLE thing considering I would already have to be using a tool to make them BUT...

...Does anyone know how the X3 engine would handle a Tships file with 20,000 ships in it? Because that is how many there would be if I did this on each base model M5/M4/M4+/M3/M3+/M6/M6+.
There are loops in the engine that loop through TShips so i'd be wary of adding that many entries, that being said your major performance problems will likely be not with the engine but rather every and any 3rd party script that uses ships. The jobs engine is going to throw a fit too if you dont configure it correctly, you may be forced to manually define every single ship in the jobs and job-wings file (not fun!).

Also, the max entry's in a TFile is 32,767 (the extent of a signed 16 bit int), You also cannot re-order Tships without running into nasty predefined index problems within the engine.
[ external image ]
"One sure mark of a fool is to dismiss anything that falls outside his experience as being impossible."
―Farengar Secret-Fire

Overwatch
Posts: 21
Joined: Wed, 18. Jun 14, 19:29

Post by Overwatch » Sun, 29. Jun 14, 03:41

Yeah I was afraid of that.

It is pretty clear that while some developers may ALLOW modding, they certainly don't write their game engine with it in mind.

Frankly I find it ludicrous that the developers did not design the ships as objects (the programming definition) in the first place. How silly is it to make 8 different versions of the same ship?

Oh well. It matters not anyway. In my lust to delve into the hidden depths of my X3 modding options. I MAY have tried to install AP through steam, then realized that it was overwriting my TC folder, and in a panic hit cancel. Which promptly removed everything in the TC directory other than my SweetFX files. So now I'm starting again from scratch and I'm unsure of the route I should even take now that I know better. I'll be making a post on it asking for suggestions.

Post Reply

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