Expensive Vanilla Scripts
Moderators: Scripting / Modding Moderators, Moderators for English X Forum
-
- Posts: 4254
- Joined: Fri, 20. Oct 06, 19:02
Yup. Another problem is that there's too many of them. Some set the attack target, some don't. This is problematic for script trying to get the attack target of their leaders.
Another issue is set destination. Every script should set destination if it's moving to something, but only half do.
I'm almost done the follow rewrite. I've incorporated some of Jack's and Gazz's ideas.
I'm just happy that Gazz is going to release a new set of vanilla turret scripts that are fully optimized. I'm glad he's going to do that for everyone.
Edit: Signing is as good as dead, bobxii.
Another issue is set destination. Every script should set destination if it's moving to something, but only half do.
I'm almost done the follow rewrite. I've incorporated some of Jack's and Gazz's ideas.
I'm just happy that Gazz is going to release a new set of vanilla turret scripts that are fully optimized. I'm glad he's going to do that for everyone.
Edit: Signing is as good as dead, bobxii.
-
- Posts: 591
- Joined: Mon, 9. Feb 09, 00:46
-
- Sith Lord
- Posts: 8255
- Joined: Wed, 6. Nov 02, 20:31
1. Who's says it would be an improvement, every scripter here who gets their hands dirty in base scripts has more failures than victories with what they have writtenbobxii wrote:Any chance that such improvements would be signed?
The community simply doesn't see them as they never get released

2 I couldn't give a monkey's chuff about signing, never seen the appeal of sweating for hours and hours to get a script "signable" for a group who sneer at anyone who isn't the vanilla purist they are.
The users with common sense play the vanilla first (as everyone should) they come here and upgrade their game. Therefore signing unneeded in my book (and why i'm not part of the process, not that i'm saying it's a bad thing, just not my thang
Bottom line is i don't even know if that process exists anymore for TC without fresh volunteers coming forward, i bet everyone in the ego clouds is 100% rebirth now
The old signing process never died because of dinosaurs like myself, it died because nobody community side could be arsed testing the stuff that got submitted.
Qu'ils mangent de la brioche
LV's TC Scripts
Readme's For All My Scripts
I felt a great disturbance in the forum, Like millions of voices cried out in terror, then were silenced
si tacuisses, philosophus mansisses
Readme's For All My Scripts
I felt a great disturbance in the forum, Like millions of voices cried out in terror, then were silenced
si tacuisses, philosophus mansisses
-
- Posts: 13244
- Joined: Fri, 13. Jan 06, 16:39
While that would be nice, how many scripters could work with true multi-threading? It's a rather schizophrenic thing to do.s9ilent wrote:(I so wish scripting was multi thread able :S
Scripts can already run on multiple tasks. That's multitasking rather than multithreading but it's what we have to work with.
This can be useful to declutter a script and put the strategic and tactical decisions on completely separate timers.
I did that with the MARS Goblins where the "fight script" runs on a rather short timer by necessity but things like checking for incoming missiles or an RTB orders run on a "command task", which can restart task 0 with another lean script to do something else.
It's also easier to control than one humongous script that does everything.
And no, the goblin script is not a good fight script to use for fighters.
It's what you get when you take a vanilla fight script and hack out everything that isn't absolutely necessary for the most basic maneuvers.
Writing a better fight script would require a completely different design doc.
Even a wing AI would be possible, where a wing has a collective mind making the decisions and it's fighters act upon it. If a fighter is threatened by a missile, a different fighter in the wing might just be in a position to shoot it down...
When you're doing a rewrite, might as well go all the way. Making an individual fighter smarter won't ever save a huge amount of CPU time.
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.
There is no sense crying over every mistake. You just keep on trying till you run out of cake.
-
- Posts: 591
- Joined: Mon, 9. Feb 09, 00:46
I guess I meant so that there aren't 30 different ways of doing this running around because a mod creator can't assume someone will be using these rewrites and does them himself.LV wrote:2 I couldn't give a monkey's chuff about signing, never seen the appeal of sweating for hours and hours to get a script "signable" for a group who sneer at anyone who isn't the vanilla purist they are.
YesGazz wrote:It's also easier to control than one humongous script that does everything.
Even a wing AI would be possible, where a wing has a collective mind making the decisions and it's fighters act upon it. If a fighter is threatened by a missile, a different fighter in the wing might just be in a position to shoot it down...
When you're doing a rewrite, might as well go all the way. Making an individual fighter smarter won't ever save a huge amount of CPU time.
Last edited by bobxii on Sat, 28. May 11, 22:20, edited 1 time in total.
-
- Posts: 13244
- Joined: Fri, 13. Jan 06, 16:39
If you want to build upon a certain functionality in your script/mod and someone has already written it... you could ask?bobxii wrote:I guess I meant so that there aren't 30 different ways of doing this running around because a mod creator can't assume someone will be using these rewrites and does them himself.
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.
There is no sense crying over every mistake. You just keep on trying till you run out of cake.
-
- Posts: 4254
- Joined: Fri, 20. Oct 06, 19:02
I'm in the testing phase. Using the OP benchmark, I get an increase of 120 FPS.
It's running 4,224 follows in the Universe.
I went with an interupt system. The follow command has either a = wait 999999 ms for a docked ship, or an escort for 9999999 ms. So idle followers aren't actually running any script commands, no checks.
The Lead Monitor task is run on the lead ship which monitors for enemies. If it finds them, it runs a Cmd.Wing.Action on all followers giving the script the parameters of attacknearest, attacksame, protect. The one script handles all of it, it's simple and less than 50 lines.
This Cmd.Wing.Action is run as an interupt. The cool thing about this is that I don't have to run any re-dock or re-escort after everything is finished, as interupts cancel any current waits in the interrupted script, so the main follow loop simply continues on until it gets to the 999999 wait again.
Overall, massive performance gains, same functionality.
It's running 4,224 follows in the Universe.
I went with an interupt system. The follow command has either a = wait 999999 ms for a docked ship, or an escort for 9999999 ms. So idle followers aren't actually running any script commands, no checks.
The Lead Monitor task is run on the lead ship which monitors for enemies. If it finds them, it runs a Cmd.Wing.Action on all followers giving the script the parameters of attacknearest, attacksame, protect. The one script handles all of it, it's simple and less than 50 lines.
This Cmd.Wing.Action is run as an interupt. The cool thing about this is that I don't have to run any re-dock or re-escort after everything is finished, as interupts cancel any current waits in the interrupted script, so the main follow loop simply continues on until it gets to the 999999 wait again.
Overall, massive performance gains, same functionality.
-
- Posts: 2008
- Joined: Mon, 9. Jul 07, 23:33
-
- Posts: 13244
- Joined: Fri, 13. Jan 06, 16:39
You mean on a lead ship that takes part in the fight?Litcube wrote:The Lead Monitor task is run on the lead ship which monitors for enemies. If it finds them, it runs a Cmd.Wing.Action on all followers giving the script the parameters of attacknearest, attacksame, protect. The one script handles all of it, it's simple and less than 50 lines.
For continuity, I'd have gone with some neutral race satellite in sector Null.
There are billions of free tasks on that ship so it can have one for every wing.
The wingleader dieing would have no consequence whatsoever.
Even if the lead ship is the carrier, it can die. The wing still needs to carry on.
You can do some really neat tricks with interrupts, including interrupting them just to give their loop a kick in the rear. =)This Cmd.Wing.Action is run as an interupt. The cool thing about this is that I don't have to run any re-dock or re-escort after everything is finished, as interupts cancel any current waits in the interrupted script, so the main follow loop simply continues on until it gets to the 999999 wait again.
I've used it before to queue up attack targets for ships so a wing would methodically go through an enemy wing without getting broken up into 5 1v1 duels.
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.
There is no sense crying over every mistake. You just keep on trying till you run out of cake.
-
- Posts: 4254
- Joined: Fri, 20. Oct 06, 19:02
-
- Posts: 4254
- Joined: Fri, 20. Oct 06, 19:02
You'll probably need to start a new game to see the effects. Take a bench mark for me, Joel, see if it makes a difference in your game. Also, if there weren't many follows in your jobs file to begin with, you won't notice much difference.joelR wrote:Wow litcube. Cant tell you how much im looking forward to this. Include me if you need a tester.
Total beta disclaimer, etc.
[ external image ]
When you're done dumping these in /scripts, rename the !move.follow.template.pck to something else as a back up. If you don't the engine will still use the original.
-
- Posts: 2035
- Joined: Wed, 18. Aug 10, 14:28
-
- Posts: 2008
- Joined: Mon, 9. Jul 07, 23:33
Ok great. Looking forward to testing it. I wont be able to start testing till Tuesday. I wont be home much tomorrow.Litcube wrote:You'll probably need to start a new game to see the effects. Take a bench mark for me, Joel, see if it makes a difference in your game. Also, if there weren't many follows in your jobs file to begin with, you won't notice much difference.joelR wrote:Wow litcube. Cant tell you how much im looking forward to this. Include me if you need a tester.
Total beta disclaimer, etc.
[ external image ]
When you're done dumping these in /scripts, rename the !move.follow.template.pck to something else as a back up. If you don't the engine will still use the original.
-Joel
PS Anything in particular I could to to try and break this?
-
- Posts: 4254
- Joined: Fri, 20. Oct 06, 19:02
I figured I may as well.TrixX wrote:Nice mate, been wanting to trial this, thanks for releasing

joelR wrote:PS Anything in particular I could to to try and break this?
Good question. In terms of breaking, not really. If it breaks, you'll get a lock-up. In my game, SETA 10x for about 5 hours real time, no lockups + normal goofing off for another 2. You'd think everything that can happen in a job Universe would have by now, but you never know.
In terms of playability, keep close attention to how the wings react. They will react a little different now. For example, attack nearest actually works. Attack same might not, as the vanilla fight.object is broken (it sets the attack object to null right before jumping into a fight, easy fix). So attack same is going to essentially work like protect.
Play normally. Make a benchmark before you install this. IE. Start a new game and get a bench. Then install this, start a new game with the same start, get a bench. Then you can play away.
The reason I'm keeping this relatively hidden (no new thread, or fancy release title), is it's such a fundamental script to the engine. Roughly half the Universe runs this script, and all the time, and it's called by about 7 or 8 of them randomly, for the craziest things. I need to be confident it'll be all right before declaring this public worthy.
-
- Posts: 2008
- Joined: Mon, 9. Jul 07, 23:33
Ok I had a little time this morning to run some tests. Here is whats happened so far. I really need more time to let the universe do its thing but here is what I discovered:
All tests were done in a modified game.
First a game without your test scripts using FRAPS:
Location US east of Zyarths dominion 95-100 FPS
Roughly 9500 running script tasks
This is an empty sector as you know. I jumped to several populated sectors and FPS was roughly 30-50 fps depending on what I was looking at.
Then I turned on the following:
IR 15.24 - Everything set to insane + Hotwar + Carrier and Fighter response
And ran rapid improvement....
Luickes Brennans Triumph Tortuga
Pirate Guild set to Insane
Phanon Corporation (Damn you Tanditech!)
Script tasks jumped to 12000 and FPS only dropped about 10. The game was a bit less responsive with the occasional "burp".
I ran seta at 10 for only 2 minutes though. !job.wing.protect was at 3300 tasks. Really needed more time to get things going in the universe but that was what I had time for.
Ok...then I removed the vanilla script you mentioned and dropped yours into the script folder and started a new game. Game froze after about 3 minutes or so....I saw about 2200 tasks in that monitor script you had before it locked up.
Tested the same scripts in the maxxed out game and the same happened after about 3 minutes. So I wasnt able to really test any FPS improvements.
Thats all for now. Let me know if you need me to try something else.
-Joel
All tests were done in a modified game.
First a game without your test scripts using FRAPS:
Location US east of Zyarths dominion 95-100 FPS
Roughly 9500 running script tasks
This is an empty sector as you know. I jumped to several populated sectors and FPS was roughly 30-50 fps depending on what I was looking at.
Then I turned on the following:
IR 15.24 - Everything set to insane + Hotwar + Carrier and Fighter response
And ran rapid improvement....
Luickes Brennans Triumph Tortuga
Pirate Guild set to Insane
Phanon Corporation (Damn you Tanditech!)
Script tasks jumped to 12000 and FPS only dropped about 10. The game was a bit less responsive with the occasional "burp".
I ran seta at 10 for only 2 minutes though. !job.wing.protect was at 3300 tasks. Really needed more time to get things going in the universe but that was what I had time for.
Ok...then I removed the vanilla script you mentioned and dropped yours into the script folder and started a new game. Game froze after about 3 minutes or so....I saw about 2200 tasks in that monitor script you had before it locked up.
Tested the same scripts in the maxxed out game and the same happened after about 3 minutes. So I wasnt able to really test any FPS improvements.
Thats all for now. Let me know if you need me to try something else.
-Joel
-
- Posts: 4254
- Joined: Fri, 20. Oct 06, 19:02
Vanilla Rewrite 0.20b:
[ external image ]
Ok, I installed a fresh vanilla game with only this package. After 40 mins in SETA 10x, I could not get a crash.
So, I've added logging to every command. In your X3TC output folder, you'll find a log1212.txt that's going to be very important.
Can you run the test again? When it crashes, post the last 20 or so entries of the log here?
Thanks, Joel. You're a big help.
[ external image ]
Ok, I installed a fresh vanilla game with only this package. After 40 mins in SETA 10x, I could not get a crash.
So, I've added logging to every command. In your X3TC output folder, you'll find a log1212.txt that's going to be very important.
Can you run the test again? When it crashes, post the last 20 or so entries of the log here?
Thanks, Joel. You're a big help.
-
- Posts: 2993
- Joined: Sun, 25. Dec 05, 10:42
running insane mode and also performing a ....
IR probably froze your game ... LOL
IR probably froze your game ... LOL
[ external image ]
"One sure mark of a fool is to dismiss anything that falls outside his experience as being impossible."
―Farengar Secret-Fire
"One sure mark of a fool is to dismiss anything that falls outside his experience as being impossible."
―Farengar Secret-Fire
-
- Posts: 2008
- Joined: Mon, 9. Jul 07, 23:33
-
- Posts: 4254
- Joined: Fri, 20. Oct 06, 19:02