RRF (Race Response Fleets with Race Wars) 2.2 21/9/10

The place to discuss scripting and game modifications for X³: Terran Conflict and X³: Albion Prelude.

Moderators: Scripting / Modding Moderators, Moderators for English X Forum

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

Post by LV »

updated to 1.2


exisiting users


PLEASE DO NOT SAVE YOUR GAME UNTIL YOU ARE SURE THINGS ARE OK


disclaimer:

I have seriously tweaked code and it purrs like a fluffy kitten at my end but that is no guarantee that it will be the same for you until tested, one of the changes today uninstalled every station and cap ship from the game! although i fixed it for me ages ago, don't save until your sure ;)

Remove the plugin if your using the plugin manager, install 1.2


start the game and go into your al plugin menu and turn off for 20 mins


turn on the plugin and away you go


if you are having problems uninstalling


___________________


New users

simply install 1.2 and turn the plugin on

Please read first post for full info


1.2 now has the ability for sectors skirmishes to take place if turned on (races take over sectors on their borders and rebuild stations)



----

Todo

The only thing i think i've forgotten to do is to bind the script that reverts all sectors back to their original ownership if the plugin is turned off and sectors have been taken over, the code is there and checked, i just forgot to add the call to revert




[url=http://forum.egosoft.com/viewtopic.php?t=238904]How To Use AL Plugins[/url]
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
semiliterate
Posts: 357
Joined: Sat, 13. Dec 08, 22:02

Post by semiliterate »

confirmation; this now allows for, potentially and probably with player intervention, sector takeover? do the new borders then open up further possibilities for deployment and eventually, can one race creep to owning it all?
User avatar
LV
Sith Lord
Posts: 8255
Joined: Wed, 6. Nov 02, 20:31
x3tc

Post by LV »

Sector Takeovers


Depending on what time you set when the options appear a race will invade another sector


1. The code should not only make sure the races take turns so no one race invades all the time, but it should also attack borders on most occasions e.g ceo's buckziod for boron attacking teladi. On occasions it will also attack any sector and the khaak and xenon may also have a bash


2. The timer options range from an invasion every 30 mins to every 80 mins (easy to change with feedback)

If every station and cap ship (possibly fighters as well) are dead a colonisation ship will jump in and start to colonise the sector

As far as one race owning it all, doubtful although the terrans with 3x the vanilla m6's than all other races may have a say here as will the khaak if allowed to colonise, it would still take a very long time at the shortest 30m inv timelimit
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
semiliterate
Posts: 357
Joined: Sat, 13. Dec 08, 22:02

Post by semiliterate »

i like this very much.
Kakurate
Posts: 65
Joined: Sun, 26. Sep 04, 03:45
x4

Post by Kakurate »

This. Is. Sexy.

That is all.

If I rescue a sector from a takeover, how long does it take to recover?

I tried changing the invasion timer to 300 but it kept knocking me back to that input screen. I had previously set it to 60 but the invasions just keep happening too soon.
User avatar
LV
Sith Lord
Posts: 8255
Joined: Wed, 6. Nov 02, 20:31
x3tc

Post by LV »

MOD hat on - Kakurate, Please do not triple post use the edit button, i've deleted the other 2 and put the text in the above


-----------------
I tried changing the invasion timer to 300
It's found in Script plugin.rrf.interface.options

109 |skip if $input > 29 AND $input < 80


just change the 80 to a higher number and resave the script, then press r,r,enter on that script and the options will come up
Kakurate
Posts: 65
Joined: Sun, 26. Sep 04, 03:45
x4

Post by Kakurate »

Thanks again, LV. Wonderful script :)
Darkfire1
Posts: 128
Joined: Sun, 18. Jan 04, 15:05
x4

Post by Darkfire1 »

but a player can still not take over a sector?
X3 TC Ship Index
Community Ship Pack Mod
X2 The Threat - X3 R - X Terran Conflict
User avatar
LV
Sith Lord
Posts: 8255
Joined: Wed, 6. Nov 02, 20:31
x3tc

Post by LV »

yes there is a way for a player to take over a skirmish sector but if anybody disects my code and posts the how to without finding it properly i will kill them.....slowly and very very painfully
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
amirite
Posts: 243
Joined: Thu, 23. Oct 08, 22:01

Post by amirite »

Okay thats awesome.

But yeah thanks for this new version. I was just getting back into playing and hoped this would be here. Everything works great except for the prompt during setup where I'm asked about invasion frequency. If I enter 300 (which it says is the max) it will just ask me forever until I give it a lower number, the highest I've gotten iot to work so far is 40. That's way lower than I would prefer though.

EDIT: Okay nevermind I don't read. 80 is a good max I guess but I would appreciate the ability for a higher number later on :)
-TEVE
Kakurate
Posts: 65
Joined: Sun, 26. Sep 04, 03:45
x4

Post by Kakurate »

I would... imagine... that you have to build your own trade station
captain1
Posts: 148
Joined: Sat, 17. Jan 04, 23:45
x3

Post by captain1 »

thanks of the mod
were can i find the emp.
User avatar
LV
Sith Lord
Posts: 8255
Joined: Wed, 6. Nov 02, 20:31
x3tc

Post by LV »

i removed the need for emp temporarily in 1.2 as my radiation bomb was causing issue, that said the link is in big letters at the top of the first post in the thread ;)


I'd recommend all review it as i tend to write more in there when updating than reply's

also i did a little youtube demonstration that i'm quite fond of in an Imperial way, i took a little while longer than i thought to make but it did show me some tweaks i needed to do


[ external image ] RRF Demonstation


tech request

can anybody using RRF who knows the SE keep their eye on global tasks for the vanilla !fight.global.call.defense base, it seems to be popping up and clogging up the cpu a touch as during sector invasions, i doubt this stock script is needed with RRF so i may imperialise it if peeps find the same problem (i did have a few invasions going on though)
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
KojioK
Posts: 9
Joined: Mon, 25. Dec 06, 06:06

Post by KojioK »

I really want to like this script, I really do, but the massive CPU hit from this script is borderline insane. Even on a fresh game installation, with RRF being the ONLY script running, the game begins to choke. I have a 2.8ghz dual core CPU, which has been more than enough to tackle many other large scripts simultaneously, such as MARS, Race Patrols, E&S Trader, plus over a dozen other scripts. However, even Uranus, being OOS as you can get on a new game, falls victim to the lag monster once RRF is enabled. Even with all of my other scripts enabled, my running scripts never rise above 8800 (fresh install is 8200). Once RRF is installed, my running scripts skyrockets to over 12,000. Having this much overhead on a brand new game, completely OOS with no player interaction, is IMHO nothing short of absurd.

I've read the previous responses in this thread, where other users were complaining about the same CPU issues I'm having. I am making this post in response to your previous comment about version 1.2 of your RRF script "purring like a kitten," when it is clearly mauling my CPU cycles to death like a wild Siberian tiger.

I hope this feedback helps in your design of a more efficient script, and I wish I could offer more information, but I don't know how to debug scripts in X3TC and I wouldn't know where to look for bugs. Good luck with your script and hopefully these issues will be resolved in the future, to a point where I might actually find this script playable. :)

Edit: After playing into the game a little further, one of the problems seems to be the increased number of ships in the universe. I am noticing special RRF ships being generated in almost every sector, on top of existing military forces, which is unnecessary. My advice is that your RRF script should take a similar approach to race patrol, replacing the military presence of each race with a handful of patrol ships that call for backup. Reducing the total number of existing ships in the universe will also mean reduced number of active scripts running. Just my 0.02 credits.
User avatar
LV
Sith Lord
Posts: 8255
Joined: Wed, 6. Nov 02, 20:31
x3tc

Post by LV »

i'm investigating the slowdown and would advice to torn the plugin off for now until i get to the bottom of it, i'm unsure if the game is creating new ships when rrf ships jump out of the sector which would be different than how it worked in TR, i do not create any rrf ships (with the exception of sector invasions) but i've been looking at the running scripts and there are too many running, i have over 1200+ stations which is part of the problem and may reduce lag here by binding only the trade dock in each sector

In addition I get 96 terran m6's at start of RRF which may be needed for a normal game but is overkill for RRF once you put osakas and the other caps in.

This means i may have to mod the jobs file which i really do not want to do.

Were you running the skirmishes by any chance?
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
KojioK
Posts: 9
Joined: Mon, 25. Dec 06, 06:06

Post by KojioK »

I set the sector skirmishes in RRF to enabled, and the time limit to 79 (the max allowed). I don't know if that means 79 minutes before or after SETA is factored in, but activating SETA x10 meant getting a distress signal every 2-3 minutes.

The biggest problem I've seen with your scripts is the station monitoring, which has over 1500 active scripts running at any given time. While I think having the stations call for help is neat, having a script constantly inquiring about each station's surroundings is a waste of resources. I'm not a programmer, but I would remove the station monitoring entirely, and just have the invasion script notify the defense script that an invasion is pending. Then you could work some magic to 'pretend' that the stations are monitoring for bad guys, and the end user will never know the difference, except that your 'new design' removed 1500 active scripts from the universe.

Whatever the case is, there is a series of scripts being 'refreshed' every few seconds in order to monitor the outcome of something, and it is causing the game to freeze every few seconds as these scripts are being computed. The best way to improve the efficiency of your mod, IMHO, is remove the need to constantly cycle so many scripts. In most cases, there are ways to cheat around the need to call one script or refresh the state of another, reducing the need to waste CPU cycles on monitoring states and variables. In the end, the user will not notice the difference, except that you made it easier for him to pew-pew other spaceships.

Doesn't "Race Patrols" already modify the jobs file? If it does, then why reinvent the wheel? If you want my advice, I would take your code and build it on top of Race Patrols, instead of trying to rewrite what ttl has already refined. His mod does an excellent job at reducing ship population, but it doesn't go further than that. You can take things further by adding invasions, sector skirmishes and claiming sovereignty over sectors. Let ttl bring the chess pieces, then you can focus on making the players behind those pieces and the board they play on. :)
User avatar
LV
Sith Lord
Posts: 8255
Joined: Wed, 6. Nov 02, 20:31
x3tc

Post by LV »

ok i did find a big problem (a very important commented out wait x seconds, this was a major cause and has greatly improved the lag i was getting)


I've also now removed about 900 stations from the logic as only trade docks are now monitoring, the other stations are pinged to check on their safety once a minute


supersafe uninstall


turn 1.2 off leave for 10 minutes save, exit remove package, install 1.3 start game again and turn plugin on if it's off

safe uninstall

remove 1.2 install 1.3 start game and turn plugin off, wait 10 mins turn it back on (RRF ships will have gone back to what their old names were)


download links in first post
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
KojioK
Posts: 9
Joined: Mon, 25. Dec 06, 06:06

Post by KojioK »

I went ahead and did another fresh install and new game start with your new revision, version 1.3, which is an improvement, but still far from playable.

It's the same issue: The game freezes every few seconds in SETA, probably due to an overload of script loops asking too many questions. You also still have the problem of ship overpopulation. You are adding ships to every sector, without removing anything in return. Increased ships means more work for the game to babysit your ships. If you give without taking away, then lag becomes unbearable during multiple invasions or in sector combat.

I seriously think you should consider removing station monitoring of any kind, and just link the invasion scripts into the defense scripts. There is absolutely no downside to the player experience, and it makes things much more efficient. You are having the computer ask if it's getting attacked.. by itself. You might as well play poker with your imaginary friend and accuse him of looking at your cards.

Edit: Here is my crappy psuedo-code example:

Asking the station if enemies are attacking him and if true, sending a broadcast. (grossly oversimplified, but you get the point)

Code: Select all

station.monitor
if entity(station) is state(attacked) by target(badguy) then
    send broadcast to entity(player) message(Help me!)
else
    wait 60 seconds
    run script(station.monitor)
Instead of asking the station every x minutes, let the invasion script tell the station when to send a broadcast using another script(also grossly oversimplified)

Code: Select all

invasion.broadcast
if system(being.invaded) is true and system(invasion.warning) is false
   set system(invasion.warning) to true
   send broadcast from entity(station) to entity(player) message(Help me!)
else
    do nothing
It's grossly oversimplified and probably horribly written, but I hope you get the drift. There's no point for the computer to ask about something it already knows. Just because two computer controlled entities are not talking to each other from the player's perspective, doesn't mean they can't share information internally from a design perspective. You are just wasting CPU cycles otherwise.

Again IAMAP, just trying to help.
User avatar
LV
Sith Lord
Posts: 8255
Joined: Wed, 6. Nov 02, 20:31
x3tc

Post by LV »

KojioK wrote:
It's the same issue: The game freezes every few seconds in SETA, probably due to an overload of script loops asking too many questions. You also still have the problem of ship overpopulation. You are adding ships to every sector, without removing anything in return. Increased ships means more work for the game to babysit your ships. If you give without taking away, then lag becomes unbearable during multiple invasions or in sector combat.
is this constant as there is alot of load if the 2 setup's for ships and stations are running but these should run for approx 1 min every 40

are you in a densely populated sector with cap ships/roids or stations?

the testing i did yesterday didn't have jerks but was mainly done in a clear sector

Again, i am not adding ships to sectors, they are stock ships but the vanilla was returning just under 500 big ships m6-m2 at startup for all races which is simply not needed (e.g the 96 terran m6's) , i could easily lower this as i said before with a mod but i have no intention of modding RRF as then it becomes a "can't use other mods" choice if they tag into jobs, hence the desire to keep it script only, an idea i've had is get the array of ships of each class for each race and only make x% of them RRF

it didn't immediately appear that new ships were being created in sectors if one of them jumped out but there was a fluctuation in total ships



KojioK wrote: I seriously think you should consider removing station monitoring of any kind, and just link the invasion scripts into the defense scripts. There is absolutely no downside to the player experience, and it makes things much more efficient. You are having the computer ask if it's getting attacked.. by itself. You might as well play poker with your imaginary friend and accuse him of looking at your cards.
i can't see how 2 checks 1. Is this station being attacked 2. Is a large enemy ship close would cause an issue checked every 60s (i did a quick piece of coding to ping the other stations yesterday which may help if a slow that down), setting an invasion ping is simple but then the game would ignore any khaak or xenon invasions that come with the vanilla or a small group of pirates, personally i think the problem lies in the 600+ cap ships using RRF logic so that's where i'm focusing for now

(if you want to try something in the meantime for me just comment out the START Plugin.rrf.st.setup script in AL.RRF.Events so no stations are tagged, you need to turn it off first to remove the stations already running)

KojioK wrote:
Edit: Here is my crappy psuedo-code example:
crappy psuedo code 1 is how it works now ;)

cpc 2 is fine and dandy and actually not needed as all i need to do is set the sector as a global variable via the invasion script but as i said this would ignore non rrf invasions

the code i'm using here is massively cut down from my TC rrf because of the slowdown, the 900+ wing.protect scripts, 1000 (at one point) freetrader/station to station scripts and such in the vanilla are really not helping RRF imo, there was also some form of defense written into TC which also may be interfering

i think the engine for TC simply has much less capacity for adding anything 3rd party than TR did although some sloppy coding in 1.2 didn;t help, it's just a shame that without imperialising the eye candy of freetraders and wing.protects etc via mod the engine room doesn't have much power for me to use.

i'll continue to tweak, ta for the info :)
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
PWAGGO
Posts: 28
Joined: Sat, 10. Apr 04, 17:05
x3tc

Post by PWAGGO »

Hi LV
I installed the previous version and due to performance issues I uninstalled it as per your instructions.
The issue I am now having is that I wish to start the Terran mission but your race notoriety reset means that when the Terran diplomats turn up the escorts now attack it instead of escorting it meaning that the mission cannot start as the Terran now just jumps around Omicrom Lyrea instead of heading for the Jump gate is there a way to reverse the race notoriety when you uninstall this script?

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