Crappy freighters accumulating in my game and eating out FPS badly [AP]

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
kurush
Posts: 4320
Joined: Sun, 6. Nov 05, 23:53
x3tc

Crappy freighters accumulating in my game and eating out FPS badly [AP]

Post by kurush » Tue, 5. Jun 12, 09:21

Some time ago I started noticing ships with names like "Split Caiman Super Freighter" in various sectors that just sit there with 0 speed and don't do anything, or, sometimes idle around. Today I discovered that these ships in fact are busy eating my FPS. They dropped it from ~45 to 15-20.
How I discovered it? I wrote a script that gets the ship list for each sector and destroys ships with names matching that template. There were 162 of them in the entire universe. Surprisingly, these ships were not visible in the get ship array: of race function. Only get ship array from sector seems to return them. Now my FPS went back to (almost) what it was in a new game (45 vs 60). Did anybody else notice such ships in their games?
I am running (almost) vanilla with just a PHQ mod and a change to globals for comm range.

User avatar
LV
Sith Lord
Posts: 8255
Joined: Wed, 6. Nov 02, 20:31
x3tc

Post by LV » Tue, 5. Jun 12, 10:14

what is their job id? :idea:

User avatar
Charon_A
Posts: 105
Joined: Wed, 6. Nov 02, 20:31

Post by Charon_A » Tue, 5. Jun 12, 12:07

Interesting find, kurush. I'd like to check my game as well. Noticed that fps is getting worse slowly.
Could you please share your script or describe in more details the culprits? Are those only Caimans or other races TS can causes this for you too ?
Be careful about reading health books. You may die of a misprint.
---Mark Twain---

Aegyen
Posts: 245
Joined: Sat, 31. May 08, 19:33
x4

Post by Aegyen » Tue, 5. Jun 12, 12:47

If they have stalled jobs, that was something that came up a long while back. Lucike made this: http://www.xuniversum.info/download/x3_ ... _V3100.zip to deal with it. Reboots their job.

He also made this which deals with the ones that have no jobs, or commands, and fill up the docks: http://www.xuniversum.info/download/x3_ ... _V3101.zip. That will clean them up. No job, no command, good-bye.

Hope this helps.

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

Post by Sam L.R. Griffiths » Tue, 5. Jun 12, 12:47

This sounds like a long-standing issue that also exists in TC. I only work-around for this issue that I know of is to modify the jobs file (c/f vkerinav's Job Scripts for Xtra/SRM).

Other causes I know of is if the gate-routing to their destination is broken. This can occur in Modded TC with the Random Sector Management (RSM) mod/script if more than one gate with the same direction designation exists in a sector (e.g. two North Gates)
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

kurush
Posts: 4320
Joined: Sun, 6. Nov 05, 23:53
x3tc

Post by kurush » Tue, 5. Jun 12, 18:39

I guess I will have to wait until I get more of them before I can check their job ID :) Where do I do it btw? Do I need to activate the script editor for it or is there just a script command to get the ID that I can plug in into my script? They were of all races, including "Pirate" and "Yaki" and considering their name template of <Race> <Ship type name>, they looked like leftovers from the Destroy Convoy missions. They also appeared in sectors in 1-2 jumps from where I was doing some massive amount of UFJD jumps. Lucike's script clears docked ships and these ones were free floating. I used the following code to clear them up:

Code: Select all

$X = 0
$Y = 0
while $X < 30 AND $Y < 30
  
  $Sector = get sector from universe index: x=$X, y=$Y
  if $Sector->exists
    $shipar =   $Sector -> get ship array from sector/ship/station
*: of race $raceobj class/type={TS 2031}
    $count = size of array $shipar
    while $count
      dec $count =
      $obj = $shipar[$count]
      $name = $obj->get name
      $sector = $obj->get sector
      $homebase = $obj->get homebase
      $Type = $obj->get ware type code of object
      $raceobj = $obj -> get owner race
      if $obj -> is of class {TS 2031}
        $totalFreighters = $totalFreighters + 1
        
        $racename = ''
        if $raceobj == {Argon}
          $racename = 'Argon'
        else if $raceobj == {Boron}
          $racename = 'Boron'
        else if $raceobj == {Split}
          $racename = 'Split'
        else if $raceobj == {Paranid}
          $racename = 'Paranid'
        else if $raceobj == {Terran}
          $racename = 'Terran'
        else if $raceobj == {Teladi}
          $racename = 'Teladi'
        else if $raceobj == {Yaki}
          $racename = 'Yaki'
        else if $raceobj == {ATF 17}
          $racename = 'ATF'
        else if $raceobj == {Pirates}
          $racename = 'Pirate'
        end
        
        $junkname = sprintf: fmt='%s %s', $racename, $Type, null, null, null
        if $junkname == $name
          inc $totalIdleFreighters =
          write to log file 778  append=1  printf: fmt='%s ship %s from %s in %s', $name, $junkname, $homebase, $sector, null
          $obj->destruct: show no explosion=1
        else
*write to log file 778  append=1  printf: fmt='%s != %s ', $name, $junkname, null, null, null
          
          
        end
      end
    end
  end
  if $X == 29
    $X = 0
    inc $Y =
  else
    inc $X =
  end
end

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

Post by X2-Illuminatus » Tue, 5. Jun 12, 18:43

In the Fly Commands there is the command <RetVar/IF><RefObj> get job id.
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!

kurush
Posts: 4320
Joined: Sun, 6. Nov 05, 23:53
x3tc

Post by kurush » Tue, 5. Jun 12, 21:34

I got some new ones and they all have Job ID = 0 . Should it tell me something? I half-suspect it happens because of UFJD jumps that make something in MD script for Destroy Convoy mission go awry.

User avatar
Charon_A
Posts: 105
Joined: Wed, 6. Nov 02, 20:31

Post by Charon_A » Wed, 6. Jun 12, 09:24

You must be right. I've not used unfocused jump in my game so far and your script only found one ship matching the name pattern. It was not really idling though, its pilot was offering to buy the ship. I am sure once the mission timeouts the ship will disappear by itself.
Be careful about reading health books. You may die of a misprint.
---Mark Twain---

User avatar
apricotslice
Posts: 14129
Joined: Sun, 16. May 04, 13:01
x4

Post by apricotslice » Wed, 6. Jun 12, 11:23

I dont use the UFJD and I've never seen this problem in the game. TC or AP.

Post Reply

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