X3 crashes after adding ships to the game

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
BlackArchon
Posts: 1016
Joined: Wed, 4. Feb 04, 17:37
xr

X3 crashes after adding ships to the game

Post by BlackArchon » Thu, 3. Dec 15, 21:49

I'm currently adding ships to LU. Here I encountered an annoying problem: The game crashes sometimes when I start a new game. When it starts ok, it would sometimes crash when I create the ship by using Cycrow's cheat package. The X3Crash.log looks like this on start-crashing:

Code: Select all

Crash event occurred on Tue Dec 01 23:08:06 2015
E:\X3 LU Schiffe\X3AP_n.exe
The exception "Access violation" (0xc0000005) was caused at address 0023:004f4f1d

Process owned by user: blackarchon

Story call stack dump:
[000000]->[0139fd]#150[150].Run(-1)
[014221]->[015e80]#150[150].EnterSector(-44)
[015e8c]->[09fa5c]#-44(2001)[2001].Activate()
[09fe56]->[0ed1c6]#-122923(2027)[2033].Activate()
[0ed1cf]->[0c5bf8]#-122923(2027)[2004].Activate()

Stack dump:
...
The fact that it doesn't always crash tells me that I'm not doing something completely wrong. If the game runs, I can use the ship just fine - it looks perfectly as expected, it gets equipped with the correct stuff, and I can fire all the weapons.

I also traced X3AP_n.exe with Sysinternals' Process Monitor to see if there are missing files, but I can't find suspicious entries there. The fact that tracing X3 makes it even more likely to crash isn't helping either.

How can I debug this problem further?

User avatar
X2-Illuminatus
Moderator (Deutsch)
Moderator (Deutsch)
Posts: 24961
Joined: Sun, 2. Apr 06, 16:38
x4

Post by X2-Illuminatus » Thu, 3. Dec 15, 21:55

What kind of ships do you add? How do you add them? Are you sure that the ships itself are functional and don't pass one of the game limits (polygon count, speed limits etc.) in any way?
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!

Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 22226
Joined: Sun, 14. Nov 04, 23:26
x4

Post by Cycrow » Fri, 4. Dec 15, 09:49

Crashes like that are usually down bad data somewhere. The entersector routine basically loads all the ships and models for that sector. So its not likely one of them in the sector.

not sure why it would work sometimes and not others thou.

i assume the game runs fine if you remove the troubled ship ?

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

Post by BlackArchon » Fri, 4. Dec 15, 17:06

X2-Illuminatus wrote:What kind of ships do you add? How do you add them? Are you sure that the ships itself are functional and don't pass one of the game limits (polygon count, speed limits etc.) in any way?
I'm using ships from XRM (which are working fine there).

With the help of Cycrow's Package Creator, I extract a ship and create a ZIP file of it. It contains the ship's textures from the dds directory and the objects directory (the ship scene, and things like the the ship's propulsion effect). I copy both of these directories into my X3 LU folder. Then I'm appending the ship's TShips entry to LU's TShips.txt (I'm correcting the indexes to TCockpits, because the Package Creator changes them) and increase the entry counter. Now I modify the other files under \types: Bodies.txt (here I append the effects to their correct place if necessary and I correct the entry counters), Components.txt (basically the same - can somebody please explain what the purpose of this file is, besides listing all objects with their possible positions?), and Dummies.txt (usually I don't have to do much here, because most of the entries are already there). Last but not least, I create their text entries in a t file (which I load with a setup script).

Since the ships are working fine in XRM, I don't think that I break any game limits.


User avatar
X2-Illuminatus
Moderator (Deutsch)
Moderator (Deutsch)
Posts: 24961
Joined: Sun, 2. Apr 06, 16:38
x4

Post by X2-Illuminatus » Thu, 10. Dec 15, 12:42

An old explanation by DeadlyDa can be found here.
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!

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

Post by BlackArchon » Fri, 11. Dec 15, 17:25

Thank you, so I assume that missing entries in CutData.txt shouldn't be responsible for the crashes.

Ok, I will now test ship by ship which is the source of the crashes. I thought that tracing X3 with Process Monitor is enough to find missing files, but I guess it's not.

User avatar
Killjaeden
Posts: 5366
Joined: Sun, 3. Sep 06, 18:19
x3tc

Post by Killjaeden » Mon, 14. Dec 15, 02:09

From memory: errors in Components.txt, Dummies.txt, Bodies.txt can cause crashes
[ external image ]
X-Tended TC Mod Team Veteran.
Modeller of X3AP Split Acinonyx, Split Drake, Argon Lotan, Teladi Tern. My current work:
Image

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

Post by BlackArchon » Mon, 14. Dec 15, 17:56

Ok, from these files I understand the file Components.txt at least. If a ship has its own entries in Components.txt, I copy them to the end of the corresponding section of LU's file and change the entry counter. But what the real purpose of this file is - I really do not know. From what I have googled so far, it is simply a list of all used objects in the game. Has this file any further meaning?

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

Post by BlackArchon » Mon, 14. Dec 15, 19:12

Cycrow wrote:Crashes like that are usually down bad data somewhere. The entersector routine basically loads all the ships and models for that sector. So its not likely one of them in the sector.

not sure why it would work sometimes and not others thou.

i assume the game runs fine if you remove the troubled ship ?
Now I know which ship is the source of the problems, it's an Argon M7. This may also explain why the game crashes sometimes when I start a new game: Sometimes this M7 got spawned in Argon Prime (probably by a job) which causes the crash. If the game ran fine, it didn't get spawned in Argon Prime.

I also cannot find a reason for the problem, but I will look further into it during the holidays.

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

Post by BlackArchon » Sun, 20. Dec 15, 16:49

I really don't know what I'm doing wrong. Earlier I extracted the Boron Oceanus (M2) from XRM to a ZIP file with the help of the Package Creator, then appended its TShips entry to LU's and increased the entry counter by 1. Then I set some of its settings to the values of the already existing Boron Ray, these are: Volume, Size, Engine effect, Engine glow effect, Explosion effect, Ware list ID. I'm using X3 Editor 2 for that.

Additionally:
- I copied dds\-117.dds
- I copied objects\effects\engines\fx_engine_killerog_Dblue_large.pbb to my X3LU directory (so that the path is X3LU\objects\effects\engines\fx_engine_killerog_Dblue_large.pbb)
- I appended

Code: Select all

effects\engines\fx_engine_killerog_Dblue_large;
to the file X3LU\addon\types\Bodies.txt in section SBTYPE_JET and increased the section counter by 1
- I skipped the following already existing file (in LU's cat/dat files) from X3LU\objects:
-- objects\ships\boron\cockpits\boron_m2_cp_scene.bod
- I copied the following files to X3LU\objects:
-- objects\ships\Cadius\ATF\Prop\Absolution_body.pbb
-- objects\ships\Cadius\ATF\Prop\Absolution_Dummy.pbb
-- objects\ships\Cadius\ATF\Prop\Absolution_scene.pbb
-- objects\ships\Cadius\ATF\Prop\Absolution_weapon.pbb
-- objects\ships\Cadius\ATF\Prop\Absolution_Socket.bob (I had to copy this file manually from XRM to LU because the Package Creator seems to have missed it)
-- objects\ships\Cadius\ATF\Prop\Scatterfire_body.pbb
-- objects\ships\Cadius\ATF\Prop\Scatterfire_Dummy.pbb
-- objects\ships\Cadius\ATF\Prop\Scatterfire_scene.pbb
-- objects\ships\Cadius\ATF\Prop\Scatterfire_weapon.pbb
-- objects\ships\LAN\BORON_M2L.pbb
-- objects\ships\LAN\BORON_M2L_scene.bod
-- objects\ships\props\new_535_ExtDock_dummy.bod
- I edited X3LU\addon\types\Components.txt and appended

Code: Select all

ships\Cadius\ATF\Prop\Scatterfire_Weapon; 1;
NULL; 0.064764;0.011209;0.212867; 0.000000;0.000000;0.000000;
ships\Cadius\ATF\Prop\Absolution_Weapon; 2;
NULL; 0.054858;-0.002675;0.351776; 0.000000;0.000000;0.000000;
NULL; -0.054858;-0.002675;0.351776; 0.000000;0.000000;0.000000;
to section SCTYPE_LASER and increased its section counter by 2
- I edited X3LU\addon\types\Dummies.txt and appended

Code: Select all

ships\props\new_535_ExtDock_dummy;ANIMATEDF_DOCKPORT_FIGHTER|ANIMATEDF_DOCKPORT_UDDOWN|ANIMATEDF_DOCKPORT_BELOW30;0;
to section SDTYPE_ANIMATED and increased its section counter by 1 and I appended

Code: Select all

ships\Cadius\ATF\Prop\Absolution_Dummy;GUNF_ROTATE;1;GUNSTATUS_INITIAL;ships\Cadius\ATF\Prop\Absolution_scene;2;ships\Cadius\ATF\Prop\Absolution_body;GUNPARTF_ROTATEALPHA;ships\Cadius\ATF\Prop\Absolution_weapon;GUNPARTF_ROTATEALPHA|GUNPARTF_ROTATEBETA;
ships\Cadius\ATF\Prop\Scatterfire_Dummy;GUNF_ROTATE;1;GUNSTATUS_INITIAL;ships\Cadius\ATF\Prop\Scatterfire_scene;2;ships\Cadius\ATF\Prop\Scatterfire_body;GUNPARTF_ROTATEGAMMA;ships\Cadius\ATF\Prop\Scatterfire_weapon;GUNPARTF_ROTATEGAMMA|GUNPARTF_ROTATEBETA;
to section SDTYPE_GUN and increased its section counter by 2

Then I start a new LU game. With the help of Cycrow's cheat package (the zipped version), I create the new ship in Argon Prime. As soon as it creates the ship (after the question if the default wares should be installed), X3 crashes.
If I create this ship OOS, it works - but as soon as I enter this sector, X3 crashes.

I'm really out of ideas what I'm doing wrong. Please, I appreciate any hint on this! :)

Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 22226
Joined: Sun, 14. Nov 04, 23:26
x4

Post by Cycrow » Mon, 21. Dec 15, 10:14

The game doesn't load the model/textures of a ship when its created OOS. So it sounds like the crash it happening when it attempts to load the ship.

once thing you could try is running your game with XRM as a fake patch. This would basically load all the model files from xrm. Then if it works, you know its because you are missing some files. If it still crashes its more likely a problem in the files/entries that you have added

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

Post by BlackArchon » Mon, 21. Dec 15, 18:01

I just copied the entire "dds" and "objects" folders from XRM to my LU install (and I could see a difference, the title screen and the gates looked like from XRM).
The problem hasn't changed - as soon as I create the Oceanus IS, the game crashes. But what am I doing wrong?

Post Reply

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