Graphics modding - understanding a scene-file

The place to discuss scripting and game modifications for X²: The Threat.

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

User avatar
Earthpilot
Posts: 917
Joined: Sun, 23. Feb 03, 19:43
x3tc

Graphics modding - understanding a scene-file

Post by Earthpilot » Fri, 6. Aug 04, 18:49

Hi,

you may know my thread concerning the body-files from the v-folder:


http://www.egosoft.com/x2/forum/viewtopic.php?t=50079


Now we know that these bodies are put together to ships/stations/whatever by using so-called scenes.

Example:
An Argon Nova consists of 2 wings, 2 guns, 1 Cockpit, 1 rear turret, the engine trails and the position lights.
All these are the different bodies.

a typical line of a scene would look like this:

P 3; B 15000;
{ 2; 0; 0; 0; 0.000000; 0.000000; 0.000000; -5.000000; -1; -1; } // 0


ok now in detail (as far as i know it):

P3: this is just the number of the part in the scene ( it has X parts);

B 15000 : this is the body-file from the v-folder (this one is just an example)
2: i have no idea

0;0;0; the position relatively to the center of the scene (x-right/left;y-up/down;z-forward/backward)

0.000000; 0.000000; 0.000000; the rotation of the object (roll; dive;yaw)

-5.000000; : i have no idea

-1; -1; } : i have no idea

the rest is still unknown/uncertain, especially the units used for measurement. (and especially the rotation values)


so why this thread?

simple:
making a completely new modelled ship requires 3dsmax and egosoft's plugin.
Making a new ship just by using existing parts from X2 only needs a text editor! (and that saves money ;) )

BUT!

You need to understand how a scenefile is built precisely.
And that's what i want to know/ to learn and to share with the rest of the community.

So please, help, if you can!
Last edited by Earthpilot on Sun, 8. Aug 04, 20:45, edited 1 time in total.

User avatar
InvrSmall
Posts: 717
Joined: Wed, 6. Nov 02, 20:31
x3tc

Post by InvrSmall » Fri, 6. Aug 04, 19:09

Yeah , it would be nice if we got another update to the X2_GFX_Modding.pdf.

User avatar
Earthpilot
Posts: 917
Joined: Sun, 23. Feb 03, 19:43
x3tc

rotating animation

Post by Earthpilot » Wed, 11. Aug 04, 19:29

ok i finally got Rei Ayanami and was able to extract some more information on that scene stuff:

(let's hope I get the correct stuff)

rotating stuff
this is for things like the sensor arrays, radar dish or other things, that do rotate.

example:

P 4; B 810;
{ 2; 69300; 46000; -105700; 0.167339; 0.047752; -0.904281; 0.424260; 3333; 1; } // 0
{ 18; 0.498611; -0.390061; 0.908194; -0.151775; 3333; 2; } // 1
{ 18; 0.498611; -0.390061; 0.908194; -0.151775; -1; -1; } // 2
das sind 3 schlüsselpunkte, die erste zeile is die ausgangposition,die nächste is der nächste schlüsselpunkt,wo die animtion sich hinbewegt,die 3. das selbe,und nach der 3. wird die animtion von der ersten zeile an wiederholt
die erste animtion bleibt 3333 millisekunden,um von der vorigen position in die angegebene position zu kommen (zu erkennen an der 3.letzten zahl), und das ist der erste schlüsselpunkt (zu erkennen an der 1 hinter der 3333)
also die animtion von der 3. position zurück an die erste dauert 3333 ms
....
die letzte zeile einer animtion MUSS die selben werte haben,wie eine zeile darüber
....
nur muss die Dauerzahl -1 sein,und die schlüsselpunktnummer auch -1 (beides bedeutet=ende der animation,wiederholung von ersten schlüsselpunkt)
it seems that the red marked numbers mark keyframes of the animation with the 2 being the original position and the other ones beeing other keyframes.
note that only the first one has position koordinates whilst the others only have rotating information.
The Yellow marked part is the time in milliseconds the body needs to get from the previous position to its actual position.
The cyan colored one marks the number of the keyframe.
The values -1 indicate that the animation end is reached and that it will be repeated from the beginning.
also it is important that the rotating information of the last line is identical to the previous line.



Again: For the sake of all the community: please correct me if i am wrong.

User avatar
Earthpilot
Posts: 917
Joined: Sun, 23. Feb 03, 19:43
x3tc

Post by Earthpilot » Thu, 12. Aug 04, 16:20

ok and the next one:

cockpits and weapons:

P 3; B 919; C 1;
{ 2; 3300; 1300; 1200; 0.251333; 0.000000; 0.000000; -1.000000; -1; -1; } // 0

P 4; B 15000; C 1;
{ 2; 0; 0; 0; 0.000000; 0.000000; 0.000000; 0.000000; -1; -1; } // 0

P 9; B 919; C 1;
{ 2; -3300; 1300; 1200; 0.251333; 0.000000; 0.000000; -1.000000; -1; -1; } // 0


this is what you all are waiting for :D :D

ok the yellow ones are the bodies of guns.
(in my case the lasers of the split mamba).

the green behind marks the cockpit the weapon shall be assigned to (in my case the cockpit of a fighter - C1)

the red one is the body where the cockpit shall be.
this time C1 indicates that this body IS the cockpit.


ok that's all concerning the scene-file. now a little excursion to the tships-file.

this is the passage where the gun is mentioned (in my case it is position 57 starting:
...........1;1;919;2;111;1;................

1; index of the gun (this is gun number 1 used in this cockpit)
1; number of guns
919; the laser body from the v-folder
2; the path id
111; (not sure) a body
1; path id of body 111

you may have noticed that above the first laser has path number 3 (P3)
but in tships 2 has to be entered to get it working.
or, to be more generic: P X-1 (partnumber of laser -1)

I figured this out by testing so don't ask me why this is the way it is.

OK that's it from me.
More when i get more information.
Last edited by Earthpilot on Thu, 12. Aug 04, 16:38, edited 1 time in total.

Firedancer
Posts: 632
Joined: Wed, 13. Aug 03, 15:45
x3

wow - damn good info /nt

Post by Firedancer » Thu, 12. Aug 04, 16:28

wow, damn good info :)

User avatar
Earthpilot
Posts: 917
Joined: Sun, 23. Feb 03, 19:43
x3tc

Post by Earthpilot » Sat, 14. Aug 04, 21:46

not really


ok got something about that rotating thingy from Rei (thanks, mate)


-1 is 360 grad einmal rum,+1 is 360 grad andersherum,-0,5 is um 180grad gedreht,-0,25 um 90,etc

{ 2; 69300; 46000; -105700; 0.167339; 0.047752; -0.904281; 0.424260; 3333; 1; } // 0


that means the equal of a full 360° circle would be one, 180° would be 0.5 and so on.


Unfortunately i haven't been able to figure out how the docking stuff works.
I tried to dock with a nova to my ship. that was ok, but when undocking i was just floating around in space and the nova was still listed as "docked".

ShadowX
Posts: 173
Joined: Wed, 24. Mar 04, 20:49
x2

Post by ShadowX » Sat, 14. Aug 04, 22:47

This is very interesting, I have actually done a new ship which probably is M0 class or larger since it's almost 7KM long and can barely fit the gate(jumpdrive is almost essential).

I have very little HD space so I have been unable to unpack all files so I cannot check how the docking thing is made. However, I have a theory:

As I experienced with putting weird 3D Bodies to the viewpoint section in Tships, some end up with game crash.

-so the main point-

Maybe those docking positions are defined by certain 3D bodies(maybe some invincible ones) in the scene file, eg. amount of defined *whatever 3d body it is* will be set with "-" in tships to provide external docking points. If there are 8 defined invincible 3d bodies outside the ship, you would put -8 in tships to make them usable.
----------------this is just a theory-------------



I probably test this tomorrow or the next day...

User avatar
Some Strange Man
Posts: 2997
Joined: Sat, 20. Mar 04, 20:50
x3

Re: Graphics modding - understanding a scene-file

Post by Some Strange Man » Sun, 15. Aug 04, 00:03

Earthpilot wrote:0;0;0; the position relatively to the center of the scene (x-right/left;y-up/down;z-forward/backward)
That seems highly unusual.

In the British/American convention, x - forward positive, y - right positive, z - Down positive.

In the Russian convention, x - forward positive, y - left positive, z - up positive.
0.000000; 0.000000; 0.000000; the rotation of the object (roll; dive;yaw)
Is this contradicting what you've just done?
Roll is about the X axis, but X should be forward/back
dive should be called pitch, and is about the Y axis, but the y axis is left/right
yaw is about the Z axis, and the z axis is up/down.


are these assumptions(?) accurate? If so, some programmers chose a bizarro way of doing it.

ShadowX
Posts: 173
Joined: Wed, 24. Mar 04, 20:49
x2

Re: Graphics modding - understanding a scene-file

Post by ShadowX » Sun, 15. Aug 04, 13:00

Some Strange Man wrote:
Earthpilot wrote:0;0;0; the position relatively to the center of the scene (x-right/left;y-up/down;z-forward/backward)
That seems highly unusual.
Nevertheless it's correct information. I've been making a ship which is very very large and currently consists of almost 130 parts, yet all turrets, viewpoints and docking things are to be made. I can say I used a lot of these dimensional coordinates.

User avatar
Earthpilot
Posts: 917
Joined: Sun, 23. Feb 03, 19:43
x3tc

Post by Earthpilot » Sun, 15. Aug 04, 13:06

ok maybe i should have said how i get to know about these things:

i take a 3d body and put it into scene-file many times.
i'll then manipulate the values, save the file and then spawning it in X2
i'll then just look at the ship that has just appeared.

and from there i get what the values are. this is a bit of a clumsy approach, but since i can't afford to by 3dsmax.... :(

here is the test scene for the rotation:
P 0; B -1;

{ 8; 6000; 3200; -3400; 0; 0; 2200; 0.000000; -1; -1; } // 0

P 2; B 940; (this body marks where the center of the scene is)

{ 2; 0; 0; 0; 0.000000; 0.000000; 0.000000; -1.000000; -1; -1; } // 0


P 3; B 15000; (object in original position - now following the rotation tests)

{ 2; 15000; 0; 0; 0.000000; 0.000000; 0.000000;-1.000000; -1;-1; } // 0

P 4; B 15000;

{ 2; 30000; 0; 0; 0.100000; 0.00000; 0.000000; -1.000000; -1; -1; } // 0

P 5; B 15000;

{ 2; 45000; 0; 0; 0.000000; 0.100000; 0.000000; -1.000000; -1; -1; } // 0

P 7; B 15000;

{ 2; 60000; 0; 0; 0.000000; 0.000000; 0.100000; -1.00000; -1; -1; } // 0




@ShadowX:
Can you dock and undock from your ship?
if yes , please post the scene-file in here (if it is the text-version and not the binary one)

ShadowX
Posts: 173
Joined: Wed, 24. Mar 04, 20:49
x2

Post by ShadowX » Sun, 15. Aug 04, 18:16

I can dock but cannot undock.

I couldn't find any scene files(.bod) of M2s except the Khaak M2 which is irrelevant because it cannot be docked.

If someone could post a full text version of for example Boron Ray(which has 5 docking points) I could investigate my theory...

ShadowX
Posts: 173
Joined: Wed, 24. Mar 04, 20:49
x2

Post by ShadowX » Mon, 16. Aug 04, 01:50

Earthpilot wrote:you may have noticed that above the first laser has path number 3 (P3)
but in tships 2 has to be entered to get it working.
or, to be more generic: P X-1 (partnumber of laser -1)
Just adding that there is one exception:

if main gun or turret would be part 0:
eg.
P 0; B 944; C 1;
...

path number in tships is 0 instead of -1

1;1;944;0;-1;-1;.


...and this should be right: green numbers which represent the 3d body of hardpoint must be same in scene file and tships.
This applies also to viewpoint of turret 3d bodies:

scene file:
P 121; B 939; C 3;
...

tships file viewpoint section:
3;4;939;120;

blue numbers=works same as in turrets X-1 for tships
cyan numbers=turret/cockpit/viewpoint

...on top of that all turret 3d bodies and viewpoint 3d bodies must be ones ment to be used with them, otherwise following might happen:

-ship doesn't spawn in at all when scripting it
-game crashes when pressing F1 to select invalid viewpoint
-weapons do not fire due to turret 3d body mismatch in tships/scene file

these 3d bodies will work:

944=small hardpoint for capital ships(should be usable in all ships)
939=turret cockpit(should be usable in all ships)

ShadowX
Posts: 173
Joined: Wed, 24. Mar 04, 20:49
x2

Post by ShadowX » Wed, 18. Aug 04, 16:36

Making your ship INTERNALLY dockable(and undockable):

Allrighty then,

i wanted before find the solution for external docking so badly that I didn't remember to try the internal docking at all.
And as I already knew that all Khaak ship scene files are to be found in text version, Khaak M1 included, which provided enough information to do this.

So this is how you make your ship dockable internally(like all M1s):

only thing required in scene file is to put one 875 body at the location of your choice

P 100; B 875;
....

875 is body of airlock

IMPORTANT:
When you exit the ship, your fighter will allways point at the rear end of dockable ship, which means that you have to turn airlock to face backwards for proper use.

TShips modifications:
You can enter any positive number to amount of dockable ships to determine docking capability of your ship.


My theory is correct so far, but external docking is yet to be found, which I think only needs certain (possibly invisible) 3d bodies to be put outside the ship alongside negative number in tships.
Last edited by ShadowX on Wed, 18. Aug 04, 22:33, edited 1 time in total.

User avatar
Earthpilot
Posts: 917
Joined: Sun, 23. Feb 03, 19:43
x3tc

Post by Earthpilot » Wed, 18. Aug 04, 16:38

that is also my theory.

But which of the invisible ones is it?



Great job, man.
Thank you very much

ShadowX
Posts: 173
Joined: Wed, 24. Mar 04, 20:49
x2

Post by ShadowX » Fri, 20. Aug 04, 19:03

Making your ship EXTERNALLY dockable/undockable:


Heh, it seems if you try hard enough you can do anything :wink:


Without further explanations here is how you do it:

this time the number of 535 bodies in scene file determines how many docking points your ship has at the locations of your choice

This example is for 3 external docking points.

Scene file:

P 3; B 535;
....

P 6; B 535;
....

P 45; B 535;
....


535 is apparently the body of invisible external docking point :)

IMPORTANT:
-your fighter points at the same way as dockable ship
-your fighter will be launched downwards of its position when undocking
-number of 535 bodies must be equal to the number in TShips which would be this time -3
-docking point has to be outside ship hull or the result will be crash.
-you can make only 5 external docking points by using 535 body

TShips modifications:
You can enter any(determined by the number of 535 bodies in scene file) negative number to amount of dockable ships to determine docking capability of your ship.


Q/A

Q: Why scene file info has P3, P6, P45 positions?

A: It's only to imply that those bodies do not have to be in certain sections of scene file or one after another(eg P1,P2,P3).


Just one other thing...:

I haven't figured out what determines whether the docking point is for M5 class or all fighters...yet. However I think it would be either ship class of the dockable ship determined by TShips ---or--- there is another invisible body for that.
Last edited by ShadowX on Sun, 22. Aug 04, 13:58, edited 1 time in total.

Skyroguen
Posts: 12
Joined: Thu, 18. Mar 04, 13:26
x4

Post by Skyroguen » Sat, 21. Aug 04, 06:51

I'm having rrouble geting bodies to rotate in pitch and yaw.
it isn't that i want them to spin, just to be placed at another angle other than front, like for turrets.

I can adjust Roll with no problem but only if i set the blue number to -1



P 6; B 939;

{ 2; 0; 0; 0; 0.000000; 0.000000; 0.000000; -1.000000; -1; -1; } // 0

can anyone help?

Skyroguen
Posts: 12
Joined: Thu, 18. Mar 04, 13:26
x4

Post by Skyroguen » Sat, 21. Aug 04, 08:19

It seems that the program will support a maximum of 5 external docking points.

User avatar
Earthpilot
Posts: 917
Joined: Sun, 23. Feb 03, 19:43
x3tc

Post by Earthpilot » Sat, 21. Aug 04, 18:24

WOA! :o :o

Thank you very much, folks.

As I was starting this thread i was not sure whether someone would help me or not.

ok about that section thingy. Maybe you're right but i have the funny feeling that there has to be some sort of hierarchy when it comes to the terms of lasers and assigning them to turrets. eg having the turret part x and the lasers assigned to that turret shall follow before going to the next turret but i didn't figure it out yet.
(I experimented i little bit)

lLongshanks
Posts: 273
Joined: Sat, 20. Mar 04, 23:46
x3tc

Post by lLongshanks » Sat, 21. Aug 04, 18:47

I want to learn to mod the graphics. Is there any websites you guys can point me to get started ?
Scripts I use.

ShadowX
Posts: 173
Joined: Wed, 24. Mar 04, 20:49
x2

Post by ShadowX » Sat, 21. Aug 04, 19:13

Skyroguen: I have actually the same problem, however, I haven't spent much time looking into it. I got it working somehow by entering values to every section(roll/pitch/yaw).
You're right, only 5 external points are allowed, for now at least. There maybe is possibility to get more if M6 docking points have different bodies than M2 docking point.


Earthpilot: My current test ship has it's main gun(C1) parts at positions 0,3, 131-136 and first turret(C2) parts at positions 127-130 and they work.
It seems, however, that the quantity of hardpoints is limited to 4 per turret, as you can see I tried with 8 main gun hardpoints. I got 8 weapon slots to main guns in game and also installing/uninstalling of weapons work just fine, however, those 4 extra harpoints do not fire.
First I thought also that there might be some sort of hierarchy, but then I realised that viewpoints and turrets are defined quite accurately(by position-1) in tships.


|Longshanks: Unless you have 3dsmax 5 or 6 and modelling skills this thread is the best place to begin with.

Post Reply

Return to “X²: The Threat - Scripts and Modding”