Diagnosing creeping slowdown

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
Fnord Lightbringer
Posts: 57
Joined: Sun, 25. Dec 11, 16:04
x4

Diagnosing creeping slowdown

Post by Fnord Lightbringer » Mon, 7. Oct 19, 22:54

My game is getting slower and slower as I progress. I have several potential culprit mods installed. How do I find out which one it is?

I am playing x3ap with terran plots, and I remember a patch at some point fixing some slowdown after a while. So I am not ruling anything out at the moment.

I usually end up abandoning the game because it gets too slow. For a while I thought it is because later in the game I get access to capital ships with beam weapons (I'm using Naval Shuffle where you can just buy them at equipment docks), and since I have heard they make things slow I patched in a mod called awesomified beam weapons or so, but as soon as a khaak destroyer shows up in the final fury plot, the game turns into a slide show.

Now, for testing, I started a new game, used the cycrow cheat tools to make myself a khaak destroyer with full gamma emitter setup, warp it into a xenon sector and watch the fireworks. It's all butter smooth! I add a second one, huge battle on screen, still all smooth like a baby's ass.

So I am assuming it is one of my other mods. How do you go about diagnosing this? Is there a tool to dump save games as XML to see if they amassed a huge amount of dead objects that might be eating up CPU time? I have enabled the script editor and looked at the global scripts, but I really don't know what I am looking for.

Potential culprit mods could be:
- The Salvage Command software (not sure why it would be)
- the Anarki mods (defense system, yaki armada and pirate guild)
- NPC bailing (one of my lead suspects at the moment because I can see it creating lots of astronauts, maybe they are not cleaned up properly?)
- sell blueprints mission director addon
- ok traders (I have maybe 2-3 dozen of those deployed)
- Logain FDN lite (installed this to find out if my many traders made things worse)

I suspected the marine repairs mod but when I did a playthrough without it, I still got the massive slowdown.
So it is not it.

I am using a hacked up version of the UFJD mod from Roguey. Maybe I broke it in the process. Could that be it?

Thanks in advance!

SirNukes
Posts: 546
Joined: Sat, 31. Mar 07, 23:44
x4

Re: Diagnosing creeping slowdown

Post by SirNukes » Tue, 8. Oct 19, 05:56

The stock TC/AP plots mod includes outdated copies of generic missions that were later updated by egosoft to reduce lag from non-terminating scripts. Some of the later posts in the TC plots thread updated/debugged a few of the files, iirc, even if that just meant copying over the stock generic mission scripts.

Some mods suffer from undocumented engine behavior that leads to a bunch of orphan spaceflies in the null sector, accumulating a dozen or so each time you load. If you pull up the lists of running scripts in game and see hundreds/thousands of the spacefly ones, you have an infestation.

Lasers generally perform really poorly due to prolific collision detection for all the segments of the beam against complex geometry of capital ships or stations. If your game is pretty clean of other cruft, it might have enough breathing room to handle a few beams okay. With other cruft, adding beams on top of that can make for a very noticeable framerate hit.

There is also a problem with complex construction kits causing accumulating sector loading lag which persists even if you delete the hub and stations, but that's not what you are asking about.

I can give more suggestions on fixes for these problems, if needed.

Fnord Lightbringer
Posts: 57
Joined: Sun, 25. Dec 11, 16:04
x4

Re: Diagnosing creeping slowdown

Post by Fnord Lightbringer » Tue, 8. Oct 19, 15:37

Thanks for the help!

I'm pretty sure I updated the TC/AP plot generic missions. Is there a way to tell in game if there are still zombies from that around?

The spaceflies sound intriguing. I can see 28 ship.cmd.idle.spacefly on stack and 363 ship.cmd.follow.spacefly. The global count is 4 and 5 digits respectively. That sounds like the scenario you describe. Do you have a link on how to fix this in the UFJD sector mod?
SirNukes wrote:
Tue, 8. Oct 19, 05:56
There is also a problem with complex construction kits causing accumulating sector loading lag which persists even if you delete the hub and stations, but that's not what you are asking about.
I definitely have several huge complexes and noticed increasing sector loading lag.
If there is something I can do to fix this, I would be most interested!

SirNukes
Posts: 546
Joined: Sat, 31. Mar 07, 23:44
x4

Re: Diagnosing creeping slowdown

Post by SirNukes » Wed, 9. Oct 19, 08:17

I don't know of a good way to check for zombie mission scripts. The bad way that I used years ago was to edit addon/director/3.01 Generic Missions.xml and comment out the section that links to the individual missions. That hard kills all lingering generic missions, though skips any in-script cleanup (like removing icons from stations). It is best to set spawn chances for all missions to 0, hop through a gate a few times to clear out any live mission offers, and also cancel out any generic missions in your log, before doing a hard kill that you will continue playing from. However, you can skip that setup just for a fast test run to see if this helps reduce game lag.

For spaceflies, I put a fix in the X3 Customizer (link in sig). Take a look at Kill_Spaceflies and Prevent_Accidental_Spacefly_Swarms. There might be patched versions of some offending mods floating around that don't need the latter option, though I don't remember offhand which mods had the spacefly problem.

For complex loading lag, there is a tentative fix in the customizer, Remove_Complex_Related_Sector_Switch_Delay. That removes a call to the lagging function when loading sectors, though I don't know if there are any bad side effects. I haven't played a lot of X3 since then with that fix in place.

Fnord Lightbringer
Posts: 57
Joined: Sun, 25. Dec 11, 16:04
x4

Re: Diagnosing creeping slowdown

Post by Fnord Lightbringer » Thu, 10. Oct 19, 13:39

I have a new data point.

I switched to mass drivers from beam weapons for testing, and I still got an enormous fps drop at the time of impact on the victim ship.
How does this work in the engine? Can you register callbacks for when a ship got hit?

Can those be registered dynamically and maybe I have a ton of them registered?
This issue is not there if I start a fresh game.

SirNukes
Posts: 546
Joined: Sat, 31. Mar 07, 23:44
x4

Re: Diagnosing creeping slowdown

Post by SirNukes » Thu, 10. Oct 19, 20:55

I think on-hit signals only fire on the first hit when a ship enters combat, or something like that. Someone else will need to answer that one.

Post Reply

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