[Resource] Vast Ship Data Spreadsheet

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

Ningyo
Posts: 16
Joined: Wed, 7. Dec 11, 08:26

[Resource] Vast Ship Data Spreadsheet

Post by Ningyo »

This likely is not the best way to share, if it does not work say something and I will go find another.

If you find any errors in the finished ships section feel free to share and I will try to fix them.

It should be noted I am using this to organize data for a mod I am working on so the last 20 or so columns are data I am playing with, they do not have any true relation to the game, though if you want to comment on improving those aspects I will likely be starting a thread for the mod within a week or so, or you can post them here.

XML version: (Finished ships sheet only)
https://docs.google.com/file/d/0B_zkf1P ... sp=sharing

ODS version: (All Sheets)
https://docs.google.com/file/d/0B_zkf1P ... sp=sharing
_______________________________________________


Ships Included in Data

275 common ships (99%+ finished data)
33 (odd ships extinct, quest, other mostly finished)
Approx 370 other ships started (mostly variants {raider, vanguard, etc..} lifeforms, goner, khaak)
Most ships from X3TC 3.1.1
Many ships from XTC 2.2
adding more ships and will update when done (1-2 weeks)
_______________________________________________


Spreadsheet has 4 sheets internally:
Finished Ships: has the 275 common ships I have 99%+ finished
All Ships: has every ship I have started work on many are only half finished
Extras: has 3 reference tables for main sheets or my use making this
Next to Do: list of next group of ships I am going to add
_______________________________________________



Fields on spreadsheet: (Using Eclipse as example)

Ship Identification Methods
17 -- #: Every ship is numbered for easy sorting
3.5 -- Size: gives a size number based on ship class, so sorting will group all M3_plus ships for instance.
Argon M3P -- Ship Type: gives Race and Ship Class
SS_SH_A_M3P -- Ship ID: same a seen in Tships
Eclipse -- Name: in game Name
7001 -- Name ID: name reference used by Tships
ships\m3\argon_M3P_scene -- Scene: Ships scene file for the 3D model used


Ship Performance Data Pulled From Tships (many of these are in odd units of measurement check next section for deciphered data)
0.376179 -- Yaw: Sidewards turn rate
0.316667 -- Pitch: Vertical turn rate
0.333333 -- Roll: Rate of spin along ship axis
29000 -- Speed: Base speed of ship
5550 -- Acceleration:
1050 -- Shield Power: used to determine shield regen rate
7300 -- Laser Energy: maximum weapon energy ship can store
0.023288 -- Laser Regen: how fast weapon energy replenishes
25000 -- Shield Type: largest type of shield ship can use by energy (1000 is tiny, 500000 is huge etc...)
6 -- Shield number: How many of these shields can be used
15 -- Speed Ext: How many speed extensions can be bought (10% faster per extension)
15 -- Steering Ext: How many steering extensions can be bought (affect Yaw, Pitch, Roll)
135 -- Min Cargo: Base amount of cargo space
305 -- Max Cargo: Maximum amount cargo space can be expanded to
0 -- Hangers: how many hangers are available (does not give type)
2 -- Cargo Class: 0=T, 1=S, 2=M, 3=L, 4=XL, 5=XXL, 6=ST
12500 -- Hull: How many hull points (armor) ship has
65630 -- Price Rel NPC:
25 -- Price Mod: These three affect ship price (not sure on formula)
65630 -- Price Rel Player:
2000 -- Notoriety: How much reputation you need to purchase ship


Ship Data Modified to Useable Format
Eclipse -- Name: Listed a few times so it easier to see which ships data you are looking at
145 -- Max Speed: Ships speed when all speed extensions are bought
11.1 -- Acceleration: is in MPS/s (meters per second / per second)
22.57074 -- Yaw: in rotations per minute
19.00002 -- Pitch: in rotations per minute
19.99998 -- Roll: in rotations per minute
12500 -- Hull: How many hull points (armor) ship has
150000 -- Max Shield: Shield strength assuming maximum number of shields for ship of the largest standard shield version it can use (using hard or military shields would raise this)
1050 -- Shield Regen: used to determine shield regen rate (same as shield power statistic)
7300 -- Laser Energy: maximum weapon energy ship can store
170.0024 -- Laser Regen: how fast weapon energy replenishes
24.1666666667 -- Base Maneuvering: (Number I made up has no in game existence)
0 -- Hangers: how many hangers are available (does not give type)


Ship Size From Image Export (I used print screen on an image of the ship in GMax to get good front, side, and top views. Then put it in GIMP and removed all but the ship and used histogram to get the number of pixels for each view. Note this is NOT ship size, but that can be calculated from this)
Eclipse -- Name: for reference again
4979 -- Front Pixels: Pixels in image along ships Z axis
11158 -- Side Pixels: Pixels in image along ships X Axis
14769 -- Top Pixels: Pixels in image along ships Y Axis
235 -- Length Pixels: Length of ship in image in Pixels
160 -- Width Pixels: Width of ship in image in Pixels
90 -- Height Pixels: Height of ship in image in Pixels


Ship Size From Model Data (directly pulled from model files)
ships\m3\argon_M3P_scene -- Scene: just for reference again
ships\\m3\\argon_M3P.bod -- Model File: file the scene point to
9982 -- Scale Factor: This tells the game how large to make the model
177432 -- Length Mod: This is the distance from the furthest point to the rear of the model to the point furthest forward
120427 -- Width Mod: This is the distance between the furthest points to each side
68556 -- Height Mod: This is the distance between the furthest points to the top and bottom
72343780518 -- Surface Area Mod: added area of every face in model file


Calculated Lengths, Areas, and Volumes
35.42 -- Length: (EXACT) Length of ship in Meters
24.04 -- Width: (EXACT) Width of ship in Meters
13.69 -- Height: (EXACT) Height of ship in Meters
113.77 -- Front Area M^2: (Accurate) Area in square meters the Front Silhouette of the ship covers
255.77 -- Side Area M^2: (Accurate) Area in square meters the Side Silhouette of the ship covers
334.51 -- Top Area M^2: (Accurate) Area in square meters the Top Silhouette of the ship covers
2883 -- Surface Area: (Accurate) would be exact except rarely a face extends into the model, or is internal
7.17% -- Portion of Box Filled: (Reasonably Accurate) If you made a rectangular box that perfectly fit the ship. This is how much of that box the ship would fill. (Close approximation likely 0-5% off except in rare cases)
835 -- Volume: (Reasonably Accurate) How many cubic meters of space the ship fills


Ship Part Sizes (This is all data I am working with in an effort to make ship sizes and loadouts make more sense and be more balanced these have nothing to do with the game {until I mod it :roll:})
1010.98 -- Eng Plasma: Plasma engines, using this term to refer to engines on most small ships
-- Engine Ion: Using this for capital and transport ships
60.65 -- Maneuvering: How much space maneuvering engines add (main engine gives some maneuvering in my present formulas)
42.95 -- Shield: how much space shield power generation and other shield related technology consume
323.62 -- Laser Energy/Regen: Space taken up by weapon energy generation and storage
132.01 -- Hull Space: How much physical space the hull takes up
-- Used Cargo: forgot to delete
-- Hangers: How much space Hangers consume(barely started)
-735.20 -- Total Empty: How much volume is not used by these parts in cubic meters (if negative the ships do not have enough space using these formulas)
-88.05% -- % Empty: Percent of the ships volume empty


Racial Modifications to Ship Part Sizes (These are computed referencing a table in Extras Sheet) {Also so far near everything is a 1 which has no affect}
Eclipse -- Name: Again for reference
1 -- R Eng Mod: How big this races engines are compared to standard
1 -- R Manu Mod: How big this races Maneuvering engines are compared to standard
1 -- R Shield Mod: How big this races shield systems are compared to standard
1 -- R Laser Mod: How big this races weapon systems are compared to standard
1 -- R Hull Mod: How big this races hulls are compared to standard
117059 -- Ship Hanger Size: How big of an internal hanger this ship uses (trying very hard to make this large enough that carriers in there present form make any sense, right now trying ships (Length*Width*Height * 10)+500 and it still way too small hehe)


% Percent of Volume Used (These are same as in Ships Part Sizes except by % of ships total Volume)
121.08% -- Eng Plasma
0.00% -- Engine Ion
7.26% -- Maneuvering
5.14% -- Shield
38.76% -- Laser Energy/Regen
15.81% -- Hull Space
0.00% -- Used Cargo
0.00% -- Hangers
-88.05% -- Total Empty
Last edited by Ningyo on Tue, 24. Sep 13, 11:11, edited 4 times in total.
Ningyo
Posts: 16
Joined: Wed, 7. Dec 11, 08:26

Post by Ningyo »

Still trying to figure out a way to switch it to XML format without losing all the embedded formulas since it won't save correctly for me.

In the mean time I did fix the Ship Surface Area to be near exact. Now it is the area of every face in the ship model files highest LoD added together. It should be noted a small fraction of faces may be partially or completely inside the model but this should be close to 0% and might never exceed 1%.

Also I am inserting here the very very badly coded "R" script I made to rip the data I grabbed from the Ship *.bod files in case anyone want some of this data for ships not in vanilla or XTC.
(There is a programming language called R, this is not a X3TC script. R is free and likely is on your computer in some form.)

I would like to note that this is not optimized at all it takes 15 seconds to 1 minute per model file so if you do a list of 647 model files like I did, do it overnight or such. (took me about 3-4 hours)

Code: Select all

options(digits=20)
# fileNamea="complete path to file model paths are saved in, requires the double slash"
fileNamea="C:\\Games\\X3 Terran Conflict unpacked\\Z My Mod\\Ship File Paths.txt"
pfile=file(fileNamea,open="r")
# fileNamed="complete path for file to write output to"
fileNamed="C:\\Games\\X3 Terran Conflict unpacked\\Z My Mod\\Ship outputs.txt"
dfile=file(fileNamed,open="w")

# loop for each file
# for (j in 1: NUMBER OF FILES TO ACCESS)
for (j in 1:5) {
	fileNameb<-readLines(pfile, n = 1)
	a <- numeric(14)
	parray <- matrix(0, nrow = 70000, ncol = 3, byrow = TRUE)
	b <- c(1,2)
	t <- numeric(4)
	fp <- matrix(0, nrow = 3, ncol = 3, byrow = TRUE)
	sarea = 0
	u <- numeric(50)
	i <- c(1)
	fileNamec=fileNameb
	conn=file(fileNamec,open="r")
# find Scale factor, Number of points and go to beginning of points list
	while (i != 1000){
	 i <- i+1
	 a[i] <- i
	 ctable<-readLines(conn, n = 1)
	 if (ctable == "// beginning of body 1") {b[1] <- scan(conn, list(numeric(0)), sep = ";", nlines = 1)
	  b[2] <-readLines(conn, n = 1)
	  a2 <- scan(conn, list(character(0),character(0)), sep = "(", nlines = 1)
	  X <-chartr(old = ")", new = "0000000000000" , x= a2[2])
	  x2 <- as.integer(X)
	  v <- x2/10
	  for (n in 1:v) {t <- scan(conn, list(numeric(0),numeric(0),numeric(0),character(0)), sep = ";", nlines = 1)
# make array containing points furthest to front, back, sides, top, bottom
	   if (t[1] <= a[4]) {a[4]<-as.numeric(t[1])}
	   if (t[1] >= a[5]) {a[5]<-as.numeric(t[1])}
	   if (t[2] <= a[6]) {a[6]<-as.numeric(t[2])}
 	   if (t[2] >= a[7]) {a[7]<-as.numeric(t[2])}
	   if (t[3] <= a[8]) {a[8]<-as.numeric(t[3])}
	   if (t[3] >= a[9]) {a[9]<-as.numeric(t[3])}
# make array containing all points
	   parray [n,1] <- as.numeric(t[1])
	   parray [n,2] <- as.numeric(t[2])
	   parray [n,3] <- as.numeric(t[3])
	  }
	  i=1000
	  b[2] <-readLines(conn, n = 1)
	  b[2] <-readLines(conn, n = 1)
	  fc <- scan(conn, list(character(0),character(0)), sep = "(", nlines = 1)
	  fcount <- as.integer(chartr(old = " faces) -----", new = "                                  ", fc[2]))
	  
	  for (n in 1:fcount) {u <- scan(conn, list(numeric(0),numeric(0),numeric(0),numeric(0),character(0),character(0),character(0), character(0),character(0),character(0),character(0),character(0), character(0),character(0),character(0),character(0),character(0), character(0),character(0),character(0),character(0),character(0), character(0),character(0),character(0),character(0),character(0), character(0),character(0),character(0),character(0),character(0)), sep = ";", nlines = 1)
# find lengths of each side of present triangle
	   for (o in 1:3) { 
	    fp [o,1] <- parray[as.numeric(u[o+1])+1,1]
	    fp [o,2] <- parray[as.numeric(u[o+1])+1,2]
	    fp [o,3] <- parray[as.numeric(u[o+1])+1,3]
	   }
# calculate area of triangle
	   fs1 <- abs(fp [1,1]-fp [2,1])+ abs(fp [1,2]-fp [2,2])+ abs(fp [1,3]-fp [2,3])
	   fs2 <- abs(fp [1,1]-fp [3,1])+ abs(fp [1,2]-fp [3,2])+ abs(fp [1,3]-fp [3,3])
	   fs3 <- abs(fp [2,1]-fp [3,1])+ abs(fp [2,2]-fp [3,2])+ abs(fp [2,3]-fp [3,3])
	   ft <- (fs1+fs2+fs3)/2
	   fsize <- (sqrt(ft * (ft - fs1) * (ft-fs2) * (ft-fs3)))
	   sarea = sarea + fsize
	  }
	  
	  a[2] <-as.numeric(b[1])  # scale factor
	  a[3] <-as.numeric(v)  # number of points in model
	  a[10] <- as.integer(a[5]-a[4]+1)  # width
	  a[11] <- as.integer(a[7]-a[6]+1)  # height
	  a[12] <- as.integer(a[9]-a[8]+1)  # length
	  a[13] <- as.integer(fcount)  # number of faces in model
	  a[14] <- sarea}  # total surface area of all faces combined
	}
# output data on this file deignated output file
	writeLines(c(paste(fileNamec,";", a[2],";", a[3],";", a[10],";", a[11],";", a[12],";", a[13],";", a[14])), con = dfile, sep = "\n", useBytes = FALSE)
	close(conn)
}
closeAllConnections()
The text file containing model path names should have a format looking like: (double slashes are required)
C:\\Games\\X3 Terran Conflict unpacked\\objects\\ships\\XTC\\aldrin\\XTC_aldrin_m6.bod
C:\\Games\\X3 Terran Conflict unpacked\\objects\\ships\\lc\\lc_M3.bod
C:\\Games\\X3 Terran Conflict unpacked\\objects\\ships\\lc\\lc_M6.bod
C:\\Games\\X3 Terran Conflict unpacked\\objects\\ships\\m7\\argon_m7s.bod
C:\\Games\\X3 Terran Conflict unpacked\\objects\\ships\\XTC\\argon\\XTC_argon_drone.bod

Your output file will look like: (but with no line wrapping)
C:\\Games\\X3 Terran Conflict unpacked\\objects\\ships\\XTC\\aldrin\\XTC_aldrin_m6.bod ; 16725 ; 1842 ; 143535 ; 56319 ; 200001 ; 3460 ; 63755726002.5316
C:\\Games\\X3 Terran Conflict unpacked\\objects\\ships\\lc\\lc_M3.bod ; 5172 ; 10311 ; 180241 ; 93761 ; 200001 ; 18469 ; 105168069523.405
C:\\Games\\X3 Terran Conflict unpacked\\objects\\ships\\lc\\lc_M6.bod ; 44530 ; 8683 ; 129369 ; 64341 ; 200001 ; 16361 ; 58180019609.1326
C:\\Games\\X3 Terran Conflict unpacked\\objects\\ships\\m7\\argon_m7s.bod ; 107899 ; 14021 ; 57793 ; 56213 ; 199336 ; 27445 ; 68267644957.2415
C:\\Games\\X3 Terran Conflict unpacked\\objects\\ships\\XTC\\argon\\XTC_argon_drone.bod ; 5020 ; 3648 ; 68549 ; 42371 ; 199610 ; 7066 ; 37305638856.3791


It should be easily movable into a spreadsheet using the ; as separators. The columns will be
Filename ; Scale ; # of Points ; Width ; Height ; Length ; # of Faces ; Total surface area of faces

to convert Width, Height, Length to Meters multiply them by scale, then divide by 50 million.

to convert total surface area to square meters multiply by Scale^2 (squared) then divide by 50 million^2
User avatar
X2-Illuminatus
Moderator (Deutsch)
Moderator (Deutsch)
Posts: 25130
Joined: Sun, 2. Apr 06, 16:38
x4

Post by X2-Illuminatus »

Added to the Tutorials and Resources Index, so it doesn't get lost.
Nun verfügbar! X3: Farnham's Legacy - Ein neues Kapitel für einen alten Favoriten

Die komplette X-Roman-Reihe jetzt als Kindle E-Books! (Farnhams Legende, Nopileos, X3: Yoshiko, X3: Hüter der Tore, X3: Wächter der Erde)

Neuauflage der fünf X-Romane als Taschenbuch

The official X-novels Farnham's Legend, Nopileos, X3: Yoshiko as Kindle e-books!

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