EnglishGermanFrenchRussianItalianSpanish
Log inRegister
 
many script instances slow down SETA (spaceflies, Anarkis/Pirate Guild)
Post new topic Reply to topic Goto page 1, 2, 3  Next
View previous topic :: View next topic
Author Message
|K.O.S.H.





Joined: 19 Dec 2003
Posts: 3082 on topic

Thank you for registering your game
PostPosted: Mon, 5. Feb 18, 08:33    Post subject: many script instances slow down SETA (spaceflies, Anarkis/Pirate Guild) Reply with quote Print

Hi,

i've allready started a topic in the german forum without success.
There three scripts running on many instances and i can't stop them:

!ship.cmd.follow.spacefly: ~6500 instances
!ship.cmd.idle.spacefly: 551 instances
anarkis.pirate.sig.pb.attacked: ~1200 instances (that one comes from the pirate guild - plugin (maybe an old version))

Those scripts are subject to slow down my seta (only works 2x)


I focussed on the spacefly scripts and tried to stop them via:
- return null -> does not work, because the are cached
- find spaceflies via "find ship" with shipttype (from main and subtype) -> no spaceflies found, even if tehre were some in my sector
- find spaceflies via "find ship" with object class -> no spaceflies found, even if tehre were some in my sector
- changed object class, types and objectid!! in tships to target them via scripteditor
- kill everything manually via modded weapon, that clears a sector
- kill all ships, stations, asteroids, debries, planets, nebulas via script

It seems like these scripts run on something else, than a spacefly. All spaceflies - even in the unfocused sectors - get destroyed, when my ship leaves the sector.

The anarkis script also remains, after all ships and stations are destroyed via script.

On which objects can they run at?
I think they may have been startet in the mission director, but i have no experience with it.


My savegame is ten years old, i really want to keep it. But without seta it gets complicated...

Can somebody help me please?


_________________
Wing Commander Mod - German Topic
06.07.11 - v1.1 RELEASED!
Back to top
View user's profile Send private message
|K.O.S.H.





Joined: 19 Dec 2003
Posts: 3082 on topic

Thank you for registering your game
PostPosted: Tue, 6. Feb 18, 19:12    Post subject: Reply with quote Print

no ideas? Sad


_________________
Wing Commander Mod - German Topic
06.07.11 - v1.1 RELEASED!
Back to top
View user's profile Send private message
X2-Illuminatus
Moderator (Deutsch)
Moderator (Deutsch)

MEDALMEDALMEDAL

Joined: 02 Apr 2006
Posts: 20708 on topic

Thank you for registering your game
PostPosted: Wed, 7. Feb 18, 19:08    Post subject: Reply with quote Print

It wouldn't surprise me if you cannot find Spaceflies with the Script Editor, as in the vanilla game they are created and treated differently to other ships. There are also other ingame objects (like suns) which the Script Editor cannot find. You may have more luck with the Mission Director's find ship/object commands, but that is pure speculation from my side.

|K.O.S.H. wrote:
All spaceflies - even in the unfocused sectors - get destroyed, when my ship leaves the sector.


Everything is destroyed in the Unfocussed Jumpdrive sector, when you leave it. So this alone isn't special. What you could test is what happens when you create spaceflies OOS (i.e. in a sector you're currently not in, except for the UFJD sector). Do they persist or are they destroyed immediately? If they persist, then what happens when you enter and leave the sector they were created in shortly afterwards? If leaving the sector destroys them, writing a script which jumps your ship to every possible sector and waits a short while, before jumping to the next, might be a viable solution to get rid of the spaceflies.
What could prove difficult is when the spaceflies were created in sector null. Some scripts use this area to create objects in a safe place, before they are used later, or to read their properties upfront for which you need the actual object. If, for example, a script was looping through all TShips entries and forgot to clean up afterwards, this may explain why there are Spaceflies you cannot find in the normal universe.

|K.O.S.H. wrote:
It seems like these scripts run on something else, than a spacefly.


In theory it could be another ship. But then again, you mentioned you destroyed all of them already. Considering that the spacefly scripts use ship specific commands I doubt that they would even run on something else than a ship without throwing errors or even causing a game freeze.

|K.O.S.H. wrote:
The anarkis script also remains, after all ships and stations are destroyed via script.

On which objects can they run at?
I think they may have been startet in the mission director, but i have no experience with it.


I feel that's rather unlikely. Interaction of Mission Director and Script Editor is rather limited. While it's possible to start MSCI scripts from the MD, the cleaner and easier way is using the SE directly. Of course, there are cases where the MD may have to call scripts. However, looking at the script in question - as its name already suggests it's a custom signal script connected via a secondary signal by another script to Pirate Bases - this is hardly the case here. Besides iirc Serial Kicked wasn't a big fan of the MD to begin with.
I can remember that there was some discussion about secondary signals not working correctly, I think some of them firing twice, with some older X3TC version. But I don't recall the details. Maybe this led to a problem with the clean-up after destruction, too. But again that's pure speculation, and not really possible to prove.


_________________
Besteht Interesse an einem Nopileos-Hörbuch?

Farnhams Legende und Nopileos als E-Books!

"People who think they know everything are a great annoyance to those of us who do." - Isaac Asimov

"If it's not impossible, there must be a way to do it." - Sir Nicholas Winton
Back to top
View user's profile Send private message
|K.O.S.H.





Joined: 19 Dec 2003
Posts: 3082 on topic

Thank you for registering your game
PostPosted: Fri, 9. Feb 18, 09:05    Post subject: Reply with quote Print

Thx alot for your answer and your ideas.

I allready visited all sectors manually, but nevertheless i made that jump script.
I also tried everything else:

Creating a spacefly via maintype 7, subtype 275 and "create ship" command does create a whole spacefly wing, not a single one. Thats interesting, because if you use subtype 276 (stardust ship) it only cretes a single ship.

Creating spaceflies in an OOS, entering and leaving this sector destroys them.

So a i created that jump script and jumped all sectors. After my journey there as many spaceflies, as before.

Creating spaceflies with "null" als sector does not work. Well, at least, no more script instances get startet.


I checked some of the MD scripts and noticed that they create spaceflys - maybe as dummies. So this will be my next attempt (i still have almost zero knowlegde of the MD).


_________________
Wing Commander Mod - German Topic
06.07.11 - v1.1 RELEASED!
Back to top
View user's profile Send private message
Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)



Joined: 15 Nov 2004
Posts: 20509 on topic
Location: London
Thank you for registering your game
PostPosted: Fri, 9. Feb 18, 11:54    Post subject: Reply with quote Print

i seem to remembering someone else mentioning this happen as well. I think it was coming from some script, but i cant remember which one.

but just to confirm, there isn't a way to get the spacefly objects in scripts, they are classed as special objects in the sector, and not part of the ship arrays.

And they are only in the active sector.
They are created in swarms, with the leader getting the script !ship.cmd.idle.spacefly, and the rest getting !ship.cmd.follow.spacefly.

based on the ratio, it would seem likely they are running on spaceflies.

maybe do a file search in your current script directory, for all scripts that are using the create spacefly command


_________________
My Scripts | MY X3TC Scripts | X3 Plugin Manager | Custom Gui
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
|K.O.S.H.





Joined: 19 Dec 2003
Posts: 3082 on topic

Thank you for registering your game
PostPosted: Fri, 9. Feb 18, 13:22    Post subject: Reply with quote Print

I also tried to delete all scripts without "!", but with no success.

I think they have been generated in sector null, maybe it was possible in some earlier versions of the game...

I think i did a file search with total commander, but to be sure i will do it (again).


_________________
Wing Commander Mod - German Topic
06.07.11 - v1.1 RELEASED!
Back to top
View user's profile Send private message
SirNukes





Joined: 31 Mar 2007
Posts: 127 on topic

Thank you for registering your game
PostPosted: Fri, 9. Feb 18, 21:56    Post subject: Reply with quote Print

One out of the box approach would be to figure out how running scripts are stored in the save file, find where the spacefly scripts are, then edit them directly to exit out. Off the top of my head, the general steps would be:

1) Decompress the save; it is in a gzip format. (Since the pck files are gzipped, I gave a shot at unzipping a save the same way, successfully.)

2) Find where and how any spacefly scripts are cached. The aim would be to find the code sections, which contain the commands used by the script. They might show up multiple times; in the save I looked at, a particular comment line from the spacefly idle script is present 120 times. This part could be somewhat bothersome, if a lot of pointer chasing will be involved.

3) Find some convenient node in the script that can be swapped to something that will exit it (a 'return' (code 103) or a 'break' replacing a part of the loop that will be reachable). It would be safest if the replacement node is the same size as the replaced node (when including any extra arguments), for the cleanest edit. Apply the change to all of the scripts found, and hope for the best.

Back to top
View user's profile Send private message
|K.O.S.H.





Joined: 19 Dec 2003
Posts: 3082 on topic

Thank you for registering your game
PostPosted: Sat, 10. Feb 18, 10:00    Post subject: Reply with quote Print

I also had the idea to edit the savegame. The for the information about the zipping.

My approach will be to find the objects, delete them directly or change the sector if possible.

edit: i unzipped it, some things are readable, but ist still somehow encoded.
That will Need some time.. Wink

Maybe Egosoft wants to help me? (hahaha)


_________________
Wing Commander Mod - German Topic
06.07.11 - v1.1 RELEASED!
Back to top
View user's profile Send private message
|K.O.S.H.





Joined: 19 Dec 2003
Posts: 3082 on topic

Thank you for registering your game
PostPosted: Sat, 10. Feb 18, 11:50    Post subject: Reply with quote Print

It Looks like the scripts and objects are not stored plain or ordered.

There seems to be links/addresses, which are badly encoded, so you cant even search them in the file.

I managed to edit the savegame, and rename the idle scripts name, trying to inject my return script, but of course i didnt work Wink

Only the name was changed


_________________
Wing Commander Mod - German Topic
06.07.11 - v1.1 RELEASED!
Back to top
View user's profile Send private message
|K.O.S.H.





Joined: 19 Dec 2003
Posts: 3082 on topic

Thank you for registering your game
PostPosted: Tue, 13. Feb 18, 11:50    Post subject: Reply with quote Print

I managed to get all possible cue name from the egosofts scripts (2258) and canceled them all. - no success...


_________________
Wing Commander Mod - German Topic
06.07.11 - v1.1 RELEASED!
Back to top
View user's profile Send private message
Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)



Joined: 15 Nov 2004
Posts: 20509 on topic
Location: London
Thank you for registering your game
PostPosted: Tue, 13. Feb 18, 12:34    Post subject: Reply with quote Print

One thing you could try is to start a new game eave it running for awhile then check if it has the same problem. If it doesn't, then you will know that it's a script in your save game that's causing it. Have you also checked if any scripts are running globally, and cancelled them?


_________________
My Scripts | MY X3TC Scripts | X3 Plugin Manager | Custom Gui
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
|K.O.S.H.





Joined: 19 Dec 2003
Posts: 3082 on topic

Thank you for registering your game
PostPosted: Tue, 13. Feb 18, 13:13    Post subject: Reply with quote Print

Yes, I stopped all global scripts.

I have an eye on the instances, the number does not increse anymore.
I patched the two (spacefly) scripts, so that i can kill any new instances, but he old ones remain :/

If there was a way to restart running scripts with a newer version, my problem would be solved.

Or a command to get all objects, that run a certain script.


_________________
Wing Commander Mod - German Topic
06.07.11 - v1.1 RELEASED!
Back to top
View user's profile Send private message
ubuntufreakdragon



MEDALMEDALMEDAL

Joined: 23 Jun 2011
Posts: 3837 on topic
Location: Das Randland des Wahnsinns!
Thank you for registering your game
PostPosted: Tue, 13. Feb 18, 23:02    Post subject: Reply with quote Print

already tried find flying ware: sector=<Var/Sector> maintype=<Var/Number> subtype=<Var/Number> flags=<Var/Number> refobj=<Value> maxdist=<Var/Number> maxnum=<Var/Number>, refpos=<Var/Array> instead of find ship?


_________________
My X3 Mods

XRebirth, things left to patch:
In General; On Firing NPC's; In De Vries; Out Of Zone; And the Antiwishlist
Back to top
View user's profile Send private message
|K.O.S.H.





Joined: 19 Dec 2003
Posts: 3082 on topic

Thank you for registering your game
PostPosted: Thu, 15. Feb 18, 15:26    Post subject: Reply with quote Print

yes, but thanks :/


_________________
Wing Commander Mod - German Topic
06.07.11 - v1.1 RELEASED!
Back to top
View user's profile Send private message
Aldebaran_Prime



MEDALMEDALMEDAL

Joined: 20 Feb 2010
Posts: 1004 on topic
Location: Düsseldorf, Altbiersektor
Thank you for registering your game
PostPosted: Fri, 8. Jun 18, 00:28    Post subject: Reply with quote Print

X2-Illuminatus wrote:
...
What could prove difficult is when the spaceflies were created in sector null. Some scripts use this area to create objects in a safe place, before they are used later, or to read their properties upfront for which you need the actual object. ....


do you have an example of the syntax for us? Maybe we can delete them there in the NULL device?


_________________
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic Reply to topic Goto page 1, 2, 3  Next
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum
Control Panel
Login Data
The time now is Sat, 23. Jun 18, 09:54

All times are GMT + 2 Hours

[ Disclaimer / Impressum ] | [ Privacy Policy / Datenschutz ]

Board Security

Copyright © EGOSOFT 1989-2018
Powered by phpBB © 2001, 2005 phpBB Group
Template created by Avatar & BurnIt!
Debug: page generation = 0.10560 seconds, sql queries = 29