[GUIDE] TShips (with PDF)

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
User avatar
Chealec
Posts: 1916
Joined: Sun, 20. Aug 06, 10:54
x3tc

[GUIDE] TShips (with PDF)

Post by Chealec » Sat, 30. Apr 11, 04:16

I'm certain someone knows this otherwise the X3 editor would not be possible... BUT, I've been looking at the raw text data for the TShips file (opening one in OpenOffice Calc (spreadsheet program) and comparing it against the data given in the TFiles Editor).

Having deconstructed the universe file previously I knew that the base unit the Egosoft use is 2mm (I've no idea WHY it's 2mm but it is) - that means if you see a big number, divide it by 500 and you'll see what's in the TFiles Editor.

I'm just taking this to bits so that if anyone else wants to know what the values actually refer to in the TShips file - this might give them a heads up. Bear in mind I've only just started looking at the file so the data thus far is quite incomplete - I'll fill in the blanks as I work them out later.

Right - it's not quite as simple as a standard CSV file where 1 column equals one specific bit of data because there are a load of rows for weapons, turrets, missiles and the like BEFORE you get to more set data at the end - the LAST piece of data on any row however is the unique ship ID code ('SS_SH_A_TL' for the Argon Mammoth for instance - I'll use the Mammoth for my example for just about everything since it's the first ship in the file).

So, having a quick look at the TShips file, first off we have:

Code: Select all

// Created with X3 Editor 2 (2.0.16.0)
// Plugin T File Editor (1.1.13.0)
50;374;
The first 2 lines are comments - '//' is used in many C-like programming languages to denote a commented line.

I've no idea what the 50 means but the 374 (is very important) and denotes the number of rows following it that contain data - so if 50;374; is on line 3 then there will be a total of 377 lines in the TShips file - effectively it tells the program how many lines of data there are in the TShips file.

Right.

So, breaking it down into columns:
The first column (A) seems to be a special 'type' column, normally this is 0, there's nothing special about ships apparently. However certain things have numbers:

Drone: 52
Spaceflies: 390
Mines (all types): 501
Navigation Relay Satellite: 502
Unknown Object: 503
Laser Tower: 504 (though there is 'patch20\terran_lasertower' in there as well - that's actually the code for it, it's not a number)
Advanced Satellite: 975
Camera Drone: 976

I think that's it - in short don't edit the first column.

Column B:
Again, this appears to be another special flag. The value is always 0 UNLESS it's either an "Unknown Biological Entity" or an "Unknown Object" in which case the value is 703.

Again, don't edit data in this column.

Column C: Yaw
The Yaw rate measured in revolutions per second. The value you see in the TFiles Editor is THIS value multiplied by 60 (to give RPM) and rounded to 1 decimal place. The actual value you see in the TShips file, for the Mammoth for instance is 0.005814 - so, multiply by 60 gives 0.34884 rounded to 0.3.

Column D: Pitch
The Pitch rate measured in revolutions per second. The same multiplying and rounding rules for the value seen in the TFiles Editor apply.

Column E: Roll
The Roll rate measured in revolutions per second. The same multiplying and rounding files for the value seen in the TFiles Editor apply.

Column F: SubType
The SubType for the ship; it's basically just a code that denotes whether it's an M1, M2, TL or whatever.

Column G: Name ID
I'm not going to swear to this but I'm fairly certain this ties into the language files and tells you that 'SS_SH_A_TL' is the "Argon Mammoth".

Column H: Speed (base)
Right - this is Egosoft's weird base unit coming into play here - the value in the TShips file is actually the basic speed of the ship measured in 2mm/s so while the base speed of the Mammoth is 58.4m/s the value you'll see in the TShips file is 29185. (as 29185/500 = 58.37; which is rounded to 58.4).

Column I: Acceleration
Again based on 2mm/s so to get the acceleration of the ship you have to divide the number in the TShips file by 500 and round to 1 decimal place.

Column J: Engine Sound
Just an ID number that denotes the noise the engine makes (e.g. 106 for TSs it seems).

Column K: ???
This one I've no idea on - it's always 1 so that doesn't help. Best guess, Average Reaction Delay (cross referencing against the TFiles Editor) but I don't even know what that means :)

Column L: Engine Effect Colour
It's another ID number - I've not checked but I guess it corresponds to an entry in the Effects.pck file. The best way to "play" with this is to make the changes using the TFiles Editor - though if you're a bit of a code monkey you could do a batch alteration using something like a Perl Regular Expression to alter the value across all ships of a given SubType or Race.

Column M: Engine Glow Effect
Again it's an ID number referring to an entry in another file (see Engine Effect Colour).

Column N: Power
I'm not quite sure what this actually refers to, the placement in the TShips file tends to imply it's to do with engine power, perhaps the intensity of the effect but where it appears in the TFiles Editor tends to imply it affects shield regen rates... I'll see if I can get a handle on it tomorrow... it's getting late :)

Column O: Sound Volume (minumum)
The volume of your engine noise when stopped.

Column P: Sound Volume (maximum)
The volume of your engine noise when gunning it.

Column Q: Ship Scene
References the Scene file which determines the ship model IIRC.

Column R: Cockpit Scene
References the Cockpit file which determines your view from the cockpit.

Column S: ???
Not sure yet... suspect it's to do with cockpit placement - I'll check in the model viewer tomorrow.

Column T: ???
Again - not sure yet.

Column U: Weapons Energy
This is your total battery power for your weapons (in Kw apparently).

Column V: Weapons Recharge Rate Multiplier
The Kw/s recharge rate for your weapons is determined by multiplying your Weapons Energy by this number - therefore in an Argon Nova the Weapons Energy is 5600Kw; the recharge multiplier is 0.024994, so the recharge rate is 5600 * 0.024994 = 139.9664 rounded to 140.

Column W: Shield Type Index
This is another ID number but a simple one, it's a zero-based index that references TShields so for 1Mj shields this is 0 and for 200Mj shields it's 3 and so on.

Column X: Max Shield Count
Simply denotes the number of shields the ship has.

Column Y: ???
Haven't worked out yet.

Column Z: ???
Haven't worked out yet.

Column AA: Speed Extensions
The number of steps it takes to upgrade from minimum speed to maximum (i.e. the number of speed extension you can fit to the ship).

Column AB: Steering Extensions
The number of steps it takes to upgrade from minimum to maximum handling (i.e. the number of steering extensions you can fit to the ship).

Column AC: Cargo Capacity (minimum)
The base amount of cargo a ship comes with - i.e. no cargo bay extensions fitted.

Column AD: Cargo Capacity (maximum)
The maximum amount of cargo available when a ship has had all the cargo bay extensions fitted.

Column AE: Ware List ID
References the WareLists file to determine the extensions installed on the ship by default (built in).

Columns AF - AQ
Not sure yet but I think these are to do with turrets.

Column AR: Hangar Size
Simply the number of ships that can be docked on the ship.

Column AS: Max Cargo Size
Seems to be an index, 1 = S to 5 = Station Containers.

Column AT: Race
The Race index, 1 for Argon, 3 for Split and so on. I'm not sure whether this number references another file or is hard-coded.

Column AU: Hull Strength
The strength of the ships hull - bigger = better.

Column AV: Explosion Effect
Determines what the Kaboom looks like - I think it references the effects file.

Column AW: Body Explosion Effect
I think this determines the shrapnel that's flung out from the ship exploding and again I think it references the effects file.

Column AX: Particle Emitter
Again a bit of a guess but I think this is to do with the engine effect - the sort of jet trail emitted by the ships engines. I'd guess it references Particles3.

Column AY: Variation Index
Determines which variant model of ship it is, whether it's a Tanker, Hauler or Vanguard... whatever. I'm not sure whether this is hard-coded or references another file.

Column AZ: Angular Acceleration
Considering Yaw, Pitch and Roll are covered... I'm not entirely sure what this actually does unless it's to do with the Strafe engines.

Column BA: Class(?)
After this it gets messy. I'm not entirely sure what the difference is between this and the SubType - a ship with SubType 'SG_SH_TS' will have the class 'OBJ_SHIP_TS' - I'd gues this value defines an index in an Objects file in one of the Cat files.

Columns.... Turret Data
Right - there are now a whole shedload of columns (depending on the ship) that determine the turret data and cameras. There's no fixed amount of these so from here on column numbers are meaningless.

The last 9 columns
The last 9 columns are, in order:
  • Production rel. value (NPC) - determines cost
  • Price modifier (1) - buying IIRC
  • Price modifier (2) - selling IIRC
  • Size (for drones and the like to determine if they'll go in your hold)
  • Production rel. value (Player) - determines cost/build time
  • Minimum Notoriety required to purchase
  • Video index (for those advertising "beacons")
  • Skin index
  • Finally the unique ship ID

So there you have it - information that is probably only useful if you're going to build a tool to edit that file; since I'm contemplating building a tool that allows me to say tweak ship properties in batches (e.g. "Increase the cargo hold on all Teladi ships by 10%" or "Up the container size on M5 Haulers to M") I thought I'd scribble it down here and share it ;)


---- EDIT ----
I've put this together into a PDF reference guide now:
http://www.xenotaph.net/lib_pdf/X3_TShips_Guide.pdf
Last edited by Chealec on Sat, 30. Apr 11, 23:38, edited 1 time in total.
[ external image ]

... old skool

User avatar
Litcube
Posts: 4254
Joined: Fri, 20. Oct 06, 19:02
xr

Post by Litcube » Sat, 30. Apr 11, 05:30

You can copy, edit, take, rape, from this if you'd like:

http://forum.egosoft.com/viewtopic.php?p=3536083

User avatar
Chealec
Posts: 1916
Joined: Sun, 20. Aug 06, 10:54
x3tc

Post by Chealec » Sat, 30. Apr 11, 11:01

Oooh :)

Well - looks like I was on the right track then... are you sure about the first 2 columns being model and picture though? I had a feeling they had something to do with the AL - behaviour or some such (e.g. if it's a mine, it goes boom when you get near it).

Anyway - I'll roll this into a "handy PDF guide" format so that anyone with a coding bent can use it for information... sort of like TShips API documentation I guess.

Ta muchly for the work you've done - saves me some headscratching! :D
[ external image ]

... old skool

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

Post by TrixX » Sat, 30. Apr 11, 11:09

Columns A and B seem to be legacy from X2. Can't be 100% certain on this though. Icon and model designation changed from just numeric to being referenced in other files or by location and file name in TC.
"If you’re not prepared to be wrong, you’ll never come up with anything original."
Sir Ken Robinson

User avatar
Carlo the Curious
Posts: 16999
Joined: Mon, 5. Mar 07, 22:03
x4

Post by Carlo the Curious » Sat, 30. Apr 11, 11:45

TrixX wrote:Columns A and B seem to be legacy from X2. Can't be 100% certain on this though.
Looks that way:
http://xwiki.chaos.net.nz/TShips_file_%28X2%29
http://xwiki.chaos.net.nz/TShips_file_%28X3%29

User avatar
Sam L.R. Griffiths
Posts: 10522
Joined: Fri, 12. Mar 04, 19:47
x4

Post by Sam L.R. Griffiths » Sat, 30. Apr 11, 12:26

You need not compare the data manually... just open any of the TFiles with the XEditor2 TDebugger.
Lenna (aka [SRK] The_Rabbit)

"Understanding is a three edged sword... your side, their side... and the Truth!" - J.J. Sheriden, Babylon 5 S4E6 T28:55

"May god stand between you and harm in all the dark places you must walk." - Ancient Egyption Proverb

"When eating an elephant take one bite at a time" - Creighton Abrams

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

Post by Jack08 » Sat, 30. Apr 11, 12:38

Carlo the Curious wrote:
TrixX wrote:Columns A and B seem to be legacy from X2. Can't be 100% certain on this though.
Looks that way:
http://xwiki.chaos.net.nz/TShips_file_%28X2%29
http://xwiki.chaos.net.nz/TShips_file_%28X3%29
that is outdated - so don't use it as a base for anything - and yeah A/B are legacy, however, this is taken directly from X3 Editor 2:

it helps to look at it from this perspective instead of in the editor self that way you can see exactly how it works, including the grouping and repeating

Code: Select all

// X3E TDebugger template for TShips ver. 50

parseFlags = tfile;

objectName = id;

structure
{
	value int version;
	value int recCount;
	
	"Ship" {
		value string "Model file";
		value int "Picture ID";
		value float "Rotation X";
		value float "Rotation Y";
		value float "Rotation Z";
		value string "Subtype";
		value int "Description";
	
		value int "Speed";
		value int "Acceleration";
		value int "Engine sound";
		value int "Average reaction delay";
		value int "Engine effect";
		value int "Engine glow effect";
		value int "Power";
		value int "Sound volume min.";
		value int "Sound volume max.";
		value string "Model scene";
		value string "Cockpit scene";
		value int "Laser mask";
		value int "Gun count";
		value int "Laser energy";
		value float "Laser recharge rate";
		value int "Shield type";
		value int "Max. number of shields";
		value int "Missile mask";
		value int "Max missile count (NPC)";
		value int "Speed extensions";
		value int "Steering extensions";
		value int "Cargo min.";
		value int "Cargo max.";
		value int "Ware list ID";
		"Turret descriptor" {
			"Turret entry" {
				value int "Cockpit index";
				value int "Turret position";
			} repeat 6;
		};
		value int "Docking slots";
		value int "Max. cargo size";
		value int "Race";
		value int "Hull strength";
		value int "Explosion definition";
		value int "Explosion body definition";
		value int "Particle emitter";
		value int "Variation index";
		value int "Rotation acceleration";
		value string subType "Sub type";
		value int turretCount "Turret count";
		"Turret" {
			value int "Index";
			value int "Turret index";
			value string "Model name";
			value int "Scene node";
		} repeat turretCount;
		
		value int gunGroupCount "Gun group count";
		
		"Gun group" {
			value int "Initial gun index";
			value int "Laser count";
			value int "Index";
			value int numWeapons "Weapon count";
			"Weapon" {
				value int gunIndex "Gun index";
				value int laserCount "Laser count";
				value string "Model name 1";
				value int "Scene node";
				value string "Model name 2";
				value int "Scene node";
			} repeat numWeapons;
			
		} repeat gunGroupCount;
		
		value int "Volume";
		value int "Relative value";
		value int "Price modifier 1";
		value int "Price modifier 2";
		value int "Size";
		value int "Relative value (player)";
		value int "Minimum notoriety";
		value int "Video ID";
		value int "Skin index";
		value string id "ID";
	} repeat;
}
[ external image ]
"One sure mark of a fool is to dismiss anything that falls outside his experience as being impossible."
―Farengar Secret-Fire

User avatar
Chealec
Posts: 1916
Joined: Sun, 20. Aug 06, 10:54
x3tc

Post by Chealec » Sat, 30. Apr 11, 23:27

Oooh - thanks for that peeps; I've rolled the information I've managed to glean into a PDF guide now, this should pretty much cover everything that's in the TShips file with explanations as to what it does (as far as I could work it out, I'm a little vague on how weapons relate to scenes but I've taken "educated guesses" ;) )

It's probably only useful as a reference guide for people who're writing scripts or tools to hack about with the TShips file but here it is, do with it what you will.

http://www.xenotaph.net/lib_pdf/X3_TShips_Guide.pdf
[ external image ]

... old skool

Bad Debt
Posts: 8
Joined: Fri, 27. Jul 12, 09:25
xr

Post by Bad Debt » Thu, 25. Dec 14, 18:01

Sorry for the necro but I have an important question. Where in Tships can I find the compatibility info between turret and laser?

Bad Debt
Posts: 8
Joined: Fri, 27. Jul 12, 09:25
xr

Post by Bad Debt » Fri, 26. Dec 14, 17:13

Answering my own question, turret (cockpit) laser compatibility info is found in the TCockpits file, as stated here. :)

BlackArchon
Posts: 1016
Joined: Wed, 4. Feb 04, 17:37
xr

Post by BlackArchon » Wed, 21. Jan 15, 23:29

As I understand this, Column C, D and E (Yaw, Pitch and Roll) are responsible for the ship's base steering value. Multiplying these values with 60 should give me the ingame values of the base steering property of a ship. However, neither of these three values multiplied by 60 results in the exact value the game shows me in the encyclopedia entry of a certain ship.

Why is this? How can I exactly calculate the ship's base steering value?

Post Reply

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