SETA stopping Autopilot commands

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

User avatar
Cadius
Posts: 979
Joined: Fri, 5. Dec 08, 12:41
x3tc

SETA stopping Autopilot commands

Post by Cadius » Sat, 27. Feb 10, 08:28

Lately i've noticed that whenever I switch on SETA, some ships stop moving. It only affects ships running various combat commands like Attack all enemies/protect and follow. Patrol, Idle and other move commands aren't affected. Anyone else had this happen before?

Scripts i'm using at the moment

==Lucike==
- Prospector
- CODEA
- Personal Transporter
- Security and Rescue
- EST
- CAG
- CLS

==Others==
- Community Plugin Config
- Hotkey Manager
- Ware Manager
- Cycrow's cheat script
- Auto-Rename Player Property
- Improved Boarding
- Satellite Early Warning Netwok
- Improved Races
- Bounty Boost
- Ejon Tech PSS
- Missile Defense Mk2
- Safe undocking
- Advanced Hyper Drive
- Apricot Beam Dock
- Apricot Cbam
- NPC Bailing Addon
- Salvage Commands and NPCs
- Uberex's Board Station
- Tatakau's Marine Repairs
- Nvidium's Auction Services

I've checked for compatibility issues but so far only Lucike's Libraries v3406 seem to have modified some of the stock scripts, but i've heard no complains from other users.

Catra
Posts: 7754
Joined: Mon, 12. Oct 09, 21:54

Post by Catra » Sat, 27. Feb 10, 08:43

not a script problem, but a technical problem. too much going on + acclerated speed is going to delay the AI on its processes.

User avatar
X1000
Posts: 896
Joined: Mon, 22. Jun 09, 16:59

Post by X1000 » Sat, 27. Feb 10, 08:44

No.. Never heard of it.

Only thing i can think of, is SETA is making the game run to fast, and the engine cant compute all the info for all your combat scripts controlling the ships, so while its computing the ships pause.

What speed are you running SETA at, and how much RAM do you have?

User avatar
Cadius
Posts: 979
Joined: Fri, 5. Dec 08, 12:41
x3tc

Post by Cadius » Sat, 27. Feb 10, 08:57

4GB RAM, 3.25 used

Had SETA running at X6

User avatar
X1000
Posts: 896
Joined: Mon, 22. Jun 09, 16:59

Post by X1000 » Sat, 27. Feb 10, 09:04

Odd. i run CODEA, MEFOS, and MARS, with 4 GBs, at 10x without a problem.

Is this on all your ships, or just the ones controlled by the scripts?

User avatar
Cadius
Posts: 979
Joined: Fri, 5. Dec 08, 12:41
x3tc

Post by Cadius » Sat, 27. Feb 10, 09:15

Only happens on ship i command to Attack all Enemies or Follow/Protect and NPC patrols. It's strange, theres no stutter or slowdown, ships just set their drives to 0.

EDIT:
Played with SETA abit, seems higher the SETA the more apparent the problem. At X2 it never occurs, X3/X4 it takes a while, X5/X6 a 2 - 3 seconds. X10 effects all ships, in sector ships stop immediately, OOS takes about 5 seconds.

I'm gonna try remove some of the scripts, see if that would help

Oh I'm also using Logain Ablers FDN/PM/SSDN/GPR scripts

EDIT:
Confirmed it's a script issue. I removed some, turned off some and started a new game. I can go X10 SETA with no problem. Gonna try turning them on one by one.

User avatar
Cadius
Posts: 979
Joined: Fri, 5. Dec 08, 12:41
x3tc

Post by Cadius » Sat, 27. Feb 10, 11:55

Ok I found the problem. It only happens when I use Logain's Production Modules. I'll direct my questions to him.

User avatar
enenra
Posts: 7150
Joined: Fri, 8. Apr 05, 19:09
x4

Post by enenra » Sat, 27. Feb 10, 13:42

As it was said, this doesn't directly concern only one script.

Many Scripts == big CPU load == slowdown == problems with AI

Of course scripts which draw a lot of CPU will make this problem appear more quickly but in the end you won't solve it by simply uninstalling that script. If you installed two other scripts amounting to the same CPU load later in place of it, the same would happen.

User avatar
Cadius
Posts: 979
Joined: Fri, 5. Dec 08, 12:41
x3tc

Post by Cadius » Sat, 27. Feb 10, 16:12

LI PM must've been hogging a whole lot of CPU load then, because I uninstalled that script (only that script btw) and can now run SETA X10 no problem. I kept the game running on SETA X10 for half an hour for testing purposes and everythings running fine.

Logain Abler
Posts: 2255
Joined: Mon, 31. Oct 05, 08:44
x4

Post by Logain Abler » Tue, 23. Mar 10, 15:00

Looking into this :( If it's PM I will cancel the next release and see what I need to do.

It may need a re-design or scrap as I don't want to break the game for people.


LA

User avatar
Gazz
Posts: 13244
Joined: Fri, 13. Jan 06, 16:39
x4

Post by Gazz » Tue, 23. Mar 10, 18:37

I wrote a library to make FPS known to scripts.
Very useful to know when the player has activated SETA or the engine is generally struggling with combat or graphics.
Scripts that don't have urgent business can then use a longer wait and go into chill mode. =)
My complete script download page. . . . . . I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.

Logain Abler
Posts: 2255
Joined: Mon, 31. Oct 05, 08:44
x4

Post by Logain Abler » Wed, 24. Mar 10, 13:55

Gazz wrote:I wrote a library to make FPS known to scripts.
Very useful to know when the player has activated SETA or the engine is generally struggling with combat or graphics.
Scripts that don't have urgent business can then use a longer wait and go into chill mode. =)
Sounds a very useful library but I’m not sure if ideal for my purpose, the wait times are fixed valued based on production times. I also define the wait by game time:

As this piece of script, time being the production duration is seconds:

Code: Select all

 $current.Time = playing time
 $end.Time = $current.Time + $time 

  while $current.Time < $end.Time 
    $wait = ( ( $end.Time - $current.Time ) + 1 ) * 1000 
    while $wait 
      $wait = wait $wait ms
    end
    $current.Time = playing time
  end
LA

User avatar
Gazz
Posts: 13244
Joined: Fri, 13. Jan 06, 16:39
x4

Post by Gazz » Wed, 24. Mar 10, 16:38

Oh, but an exact wait is not at all necessary for long loops like production.
By aiming for the exact second your "factories" waste CPU time.

For instance, you could always use a minimum wait of 50000 ms.
(better yet... random 50000 - 60000 ms)
You're going by playtime anyway so there's no harm in "overshooting" the correct time.
This excess time is simply deducted from the next "goal" time so it automatically averages out after the first 25 sec of a factory's lifetime.
A one-time inaccuracy of 25 sec is nothing on that scale.

Script-wise it's a trivial change to record / substract this carryover because it only affects this waiting subroutine.


BTW: I don't "get" the inner loop in your script. It looks dangerous and the script snippet would work perfectly fine without it.
My complete script download page. . . . . . I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.

Logain Abler
Posts: 2255
Joined: Mon, 31. Oct 05, 08:44
x4

Post by Logain Abler » Thu, 25. Mar 10, 09:57

Gazz wrote: BTW: I don't "get" the inner loop in your script. It looks dangerous and the script snippet would work perfectly fine without it.
Consider it gone.

LA

gueganteng
Posts: 15
Joined: Fri, 29. Aug 08, 23:38

Post by gueganteng » Thu, 25. Mar 10, 13:45

i dont have logain's script and still have ships stopping everywhere.. often in big fleet fights..


i dont get graphic freezes but ships just stops moving and plays dead.. when i check the script editor there is only around 5.5k scripts running. i use unleashed with modified job files without civilian. and the only ship i have is the one im flying, so no extra trader / factory.

the annoying thing is vanilla has 8.5 - 9k scripts running but the game runs a lot smoother..

i experience this early from new game start, :roll:

what i think may contribute to my game performance is one of these scripts
-IR
-MBase
-Marine Repair
-Auto rename player property
-my unlimited salvage insurance :oops:
-AI ammo cheat
-safe undocking
-missile safety ?
-gates no rep loss ?

basically scripts that has continues loops.. or ones being automatically used many times by the AI.
but i rather not play at all if i have to turn off one of the scripts im using :D

one sure thing is my system needs an update.

User avatar
AtomicDryad
Posts: 209
Joined: Sat, 19. Jan 08, 01:04

Post by AtomicDryad » Thu, 25. Mar 10, 15:23

-missile safety ?
This might be a large factor; in my game the debugger hangs on my main ship when viewing messages due to a huge number from missile safety. And 'hang' means 'barely able to exit the debugger at all'. It's totally_called count exceeds !cmd.check.jump (600k vs 450k), and I cannot get rid of it; disabled al, uninstalled, etc. This is probably due to the 20ms wait loop where it checks target and missile amount.

I asked in another thread partially due to this, partially due to wanting more control of the processes, but are there ways to manage this sort of thing via script? Getting lists of tasks, identifying calling scripts, -terminating- procs, etc. I would like to create a utility for unix-style process management if at all possible >.>

And how does one clear a metric ton of trace messages? 'clear debug messages' merely turns script debugging off.


Edit: Aha, this got rid of both the runaway safety and it's debugspew, after al:off, uninstall, save, load: exit ship, re-enter >.>

Igor.tverd
Posts: 266
Joined: Sun, 5. Oct 08, 10:06
x3ap

Post by Igor.tverd » Thu, 25. Mar 10, 15:36

gueganteng wrote: -IR
-MBase
-Marine Repair
-Auto rename player property
-my unlimited salvage insurance :oops:
-AI ammo cheat
-safe undocking
-missile safety ?
-gates no rep loss ?
I have these same scripts in my game. Thank you for pointing out that they might cause a considerable performance loss. I'll try to run with out them to see how much I can gain.

Edit: Ok, I settled for IR + AI Ammo Cheat. No performance loss whatsoever.
Fantasy is the impossible made probable. Science fiction is the improbable made possible.

User avatar
AtomicDryad
Posts: 209
Joined: Sat, 19. Jan 08, 01:04

Post by AtomicDryad » Thu, 25. Mar 10, 15:44

Going strictly by the what I see in the debugger - which still has so much overhead that the -mouse- lags - the most common occurrences are missile defense mosquitoes, mars turret, and mars.ship, followed by (and smaller by a large margin) anarkis's carrier script and MPM (5 modules running). Disabling mosquitoes makes it not lag.

This is all just eyeballing how many lines of debugflood per script, mind you, and judging by totally_called only missile safety was a factor game-wide, though I'm assuming an overhead in call script similar to exec(). Fleets running mdm might be problematic.

Disclaimer: I'm new to the inner workings of x3, but not computing :P

Side note: I can't even reproduce the seta hang, though at 10x an m7 set to protect will sometimes slow from 117ms to 70-ish then quickly speed up again. This might be due to the wing of fighters set to protect it going DERPDERP and flying too close together, then doing collision avoidance. Enabling/disabling mpm/mars turrets/gob missile defense/missile def mos./marine repairs/csecg has 0 effect.

User avatar
Gazz
Posts: 13244
Joined: Fri, 13. Jan 06, 16:39
x4

Post by Gazz » Thu, 25. Mar 10, 16:18

AtomicDryad wrote:
-missile safety ?
This might be a large factor
There is only one "fast" instance of it running and alas, there is no way around that since there is no "event" for a missile launch. And if a missile is launched, the script has to catch it immediately because launch time is the most critical moment in a missile's life.
From a technical POV it's a disgusting script but I don't see another way to ensure... safety.
If missiles were launched by a script or hotkey then this would not be necessary at all. Would be less user friendly, though, because it's... more interface.
My complete script download page. . . . . . I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.

mark_a_condren
Posts: 1468
Joined: Wed, 3. Aug 05, 05:05
x3tc

Post by mark_a_condren » Thu, 25. Mar 10, 16:20

Well after quite a bit of testing and progressive shutdowns of PM, all the way to shutting down all production and turning the AL off, I have firmly come to the conclusion that PM is a contributing factor but not the cause of the slowdown i've been experiencing.

After total shutdown of PM, i still experience ship stoppages with SETA running at 6X.

And i'm not talking about 5 modules, i've been running over 500 PM modules. This number will be increased slowly to see if there is a tipping point were my game becomes unplayable.

MarCon

Post Reply

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