[S] Race Patrols v1.43 22/01/09 ; Military logic + less CPU load

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
User avatar
ttl
Posts: 537
Joined: Sun, 6. Feb 05, 13:04
x3tc

[S] Race Patrols v1.43 22/01/09 ; Military logic + less CPU load

Post by ttl » Sun, 16. Nov 08, 12:59

http://www.geocities.com/ttlaurila/race ... etospk.pdf
(Rename the file to racepatrols_143.renametospk.pdf)

The above includes the scripts but NOT the mod files. With only the scripts, you will not get rid of existing militaries, but the new patrols will appear. In order to include this as it was designed, download ONE of the options below:

This removes virtually all (non-company) militaries, including the ones associated with Military Outposts. Thus races won't invade one another (argon<->paranid , boron<->split) with this one:
http://www.geocities.com/ttlaurila/nopa ... etorar.pdf

This removes most militaries and most of civilians:
http://www.geocities.com/ttlaurila/nopa ... etorar.pdf

This removes militaries only, leaving civilians untouched:
http://www.geocities.com/ttlaurila/nopa ... etorar.pdf

New link:
http://x3terranconflict.filefront.com/

Note that it is perfectly OK to run the script without making any changes in Jobs by one of the above mods. In this case you will not replace existing militaries, but just throw more military presence in, and you will get more CPU load (perhaps significantly so), not less.

This script + mod is designed to replace the standard military ships you see bumbling around with small patrols, that call for backup when needed. The result is better game perfomance due to massive decrease in the number of ships in the universe. And also, at least in my opinion, more believable military presence, that makes the game universe appear more alive.

The heart and soul of the script is to represent race military strength by a number, where reserves are called only when needed, and then sent back. The script creates patrols to all race (Argon, Boron, Split, Paranid, Teladi) sectors, and the patrols fly betwen stations hunting for enemies. If in trouble the patrol can call for a heavier assault wing, which can call a yet heavier one, and so on.

The militaries will only fight to the death in core sectors, however, and will fall back after losing some frigates and destroyers in a sector. They will keep periodically assaulting the sector to re-take it, however. This allows for invasion -type events (which I hope we will soon have scripts for) to call for player participation.

Total military strength of each race is finite, but huge, and gets periodic reinforcements. Thus it is possible to defeat a race, unlike with the "whack-a-mole" approach of the Jobs -file, where a destroyed ship soon pops up someplace else.

-----------------------

The mod contains a Jobs file with most of the standard military patrols, as well as civilians, removed. The script runs fine without the mod, but will then just throw some smart military on top of the dumb.

To install the script :
1. Make sure you have Cycrows Plugin Manager installed
2. DL the .spk , rename it, and run it.

To install the mod as fake patch :
1. Copy the .cat and .dat to your main X3TC directory.
2. Rename the files as 06.cat and 06.dat (or one higher than the highest number there already is). Note that Crycrows Plugin Manager always uses the highest mod number, so if you have it installed, you must first make its .cat and .dat one bigger, and make this mod second biggest number.
3. If loading an old game, this will cause most of the military fleet leadships to lose their names, not be destroyed.
4. In the scripts there is one called " aa.kill.name ". Run this manually from the script editor. Give it null as first argument (=run as global script), and any one of the nameless ships as second. It will then work in the background removing the nameless ships within one hour or so.

Detailed instructions for 4. :
1 )Activate the script editor
2) go to script editor under personal/advanced/scrpt editor
3) choose "script editor" (the upmost on the menu)
4) find aa.kill.name (should be at/near the top, thus the aa)
5) press r to run it
6) choose null to first question
7) press enter
8) choose "select ship" for second question
9) find a nameless ship in your universe and select it

------------------------
Version 1.43 out 22/01/09
-made backup calling less trigger happy
-called assaults "prepare" (i.e. wait) at gate a while before commencing their run. Bigger lead ships wait longer.

------------------------
Version 1.42 out 17/12/08
-Added the text file to the spk bundle :oops:
-Improved message sending logic (appeared like it could have problems OoS since it had a wait, and then calling ship can die before assault call is complete)
-Assault M6s pack Typhoons

------------------------
Version 1.41 out 15/12/08

changes:

-Patrols ships will not get removed if they are of different race than sector owner (capped and turned neutral) or owned by the player.

-Missile ships (M8 & M7M) no longer used by assaults, since they don't work proper.

-Player gets a distress request to assist when destroyer size forces are called to a sector, if he/she holds police license for race in question.

------------------------
Version 1.4 out 4/12/08

changes:

-Added safety check that should destroy patrol ships if they get yanked out of the sector they are created in, by some other scripts. The logic doesn't support this, and might cause issues, upto hanging the game, appearently.

- Biggest response fleets no longer have fighters with them, just destoyers, to keep max number of ships in hand.

- Response now limited to 15+ destroyers (plus escorts) max. per (core) sector.

- Ships now carry more equipment, and fire more missiles. Missile frigates and bombers now carry their proper missiles, but apparently their default logic doesn't fire them properly.

- Some waits added to the backup calling logic, to hopefully counter lockup possibilities.

----
version 1.3 out 27/11/08

IMPORTANT
Manually run the script * aa.update.Patrols * if updating from an earlier version. Run it as global script (=give null as answer to the question). This replaces old patrols, which no longer work under the new logic.

changes:

- Names now contain race, and stay the same, locals code info.

- When calling for help, the ships understand to fall back to the arriving heavier fleet, and attack together, instead of perform a suicide run.

- Patrol beacons self-destruct after some time, the presence of one means an assault has happened within last 20mins.

- Patrols now look both for ships they consider hostile, as well as ships that are hostile to them. This *should* make them react right to invasions.

----

version 1.2 out 24/11/08.

.spk -package name incorrect in version 1.1, this 1.2 will not correctly overwrite. Please remove old version from the installer yourself.

Changes mostly to logic, put in as many checks as possible to not make complex operations on ships that might not be existent anymore. Hopefully this will decrease chances of a conflict with some other script.

Gameplay changes :

- Core sectors now have more patrols, as well as will get the heaviest possible military response when attacked.

- Increased max. strength of militaries somewhat.

---------------------
Uninstallation:

Removing the mods and script files will leave some fluff flying around in your universe, because the pre-existing patrols and assaults aren't destoyed (you removed the scripts that would do this). It should be of little consequence, but turning the plugin "off" in the AL plugins menu, will run an uninstall script that, within a max of 2 game days, will remove all traces of what the scirpt created.

The mod files can simply be deleted.

---------------------

The jobs mod is extremely simple. In order to create your own, to have control over your universe, unpack Jobs.pck to a txt file, and edit. I would recommend this, but for those who do not wish to mod, the readymade mods are there as suggestions. You will find entries, where the name and the script they run are the key. Any lines (or block, depending on your text editor) with attackenemies or patrol -scripts are military patrol leaders. After removing these, you can leave the lines of followers (attacksame and wing.protect scripts) intact. If anyone knows what do the entries with the defencebase script do, I would appreaciate the info.

example:

This is one of the free traders:

130;Mineral Transporter (Teladi);
2;1;trade.freetrader;...

This is an M6 that leads a military wing:

515;Military M6;
15;3;patrol.short;...

This is an M6 that is part of a standard military patrol, and will ony show up to accompany a leader Job (thus needs not be removed).

1231;Military Patrol (Argon) Followers (M6/M6M)(Lead);
2;0;wing.attacksame;...
Last edited by ttl on Fri, 6. Nov 09, 20:35, edited 31 times in total.

ThisIsHarsh
Posts: 1135
Joined: Sun, 19. Oct 08, 18:46
x3tc

Post by ThisIsHarsh » Sun, 16. Nov 08, 13:16

Awesome! Wanna grab this asap, but I have a couple of issues/comments...

I really don't want the civilians to be removed, could you release a separate version with only the patrol ships toned down?

Doesn't the stock game already do something similar with the 'Recon' ships? Have you done anything to modify that behaviour?

How about an spk version of the mod? The plugin manager can handle mods as well as scripts... it's just neater is all.


EDIT: Tried to edit the jobs myself in the new X3 editor and it told me 'unsupported version 14', so really really want you to do a version without removing civ ships.
Last edited by ThisIsHarsh on Sun, 16. Nov 08, 13:26, edited 1 time in total.

User avatar
ttl
Posts: 537
Joined: Sun, 6. Feb 05, 13:04
x3tc

Post by ttl » Sun, 16. Nov 08, 13:25

Actually, I do not know what the "recon" ships do. I have left them intact, however. Also police, custom and border patrols are still there, since they scan for contrabands. As well as any patrol that seemed somehow "special" to me in the jobs. Better to at least start conservatively with the slashing.

Also should note that company militaries are not touched.

The problem with the mod is, that there are so many things you can remove or not from the Jobs. I would recommend you take the Jobs file, and edit it yourself, to see what you want to keep and not. You could consider the one in the pack as merely a suggestion. The scripts work regardless of what you do with Jobs.

That said, I will post a version of Jobs with civilians intact soon.

ThisIsHarsh
Posts: 1135
Joined: Sun, 19. Oct 08, 18:46
x3tc

Post by ThisIsHarsh » Sun, 16. Nov 08, 13:38

On second thought, you left in the civilian specialist ships like 'Hosital Ship' and 'Maintenance Vessel' etc, which is enough civilian traffic for me.

And yeah I'm certain I remember Cycrow saying the Recon ships scout for enemies, then call for reinforcements from the nearest military base - I think even with some intelligence in the number of reinforcements called for depending on threat level. Also the reinforcement ships are handled similar to yours in that they are called up out of thin air, but there is a limited number of them and it replenishes over time. IIRC, anyway.

But I much prefer your idea of using the existing patrol ships to call reinforcements. Makes much more sense to me.

BlackRain
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 7406
Joined: Mon, 15. Dec 03, 18:53
x4

Post by BlackRain » Sun, 16. Nov 08, 13:47

The civilian one leaves all civilians untouched right? I like my civilians

User avatar
ttl
Posts: 537
Joined: Sun, 6. Feb 05, 13:04
x3tc

Post by ttl » Sun, 16. Nov 08, 13:54

yes, Blackrain, no civilians touched in the other version.

ThisIsHarsh
Posts: 1135
Joined: Sun, 19. Oct 08, 18:46
x3tc

Post by ThisIsHarsh » Sun, 16. Nov 08, 14:00

Just looked through the Recon ship scripts, which led me to !lib.fight.defencebase.start. That's one ugly script to try and read, but it does seem to have some limited intelligent threat assessment and response level decisions. It uses ships from those that the base owns. Assumedly the owned ships are replenished (but up to a finite amount) in engine code.

Would be great if you could mod away the Recon ships, and instead have your script use the defence base ships...

ThisIsHarsh
Posts: 1135
Joined: Sun, 19. Oct 08, 18:46
x3tc

Post by ThisIsHarsh » Sun, 16. Nov 08, 14:30

A couple of hints:

- Script command "jump out of existence", would look nicer than just plain destroy.

- You can get a random ship using the script command 'order ship in next shipyard' - no need to have a massive if-else if-end if block.

User avatar
ttl
Posts: 537
Joined: Sun, 6. Feb 05, 13:04
x3tc

Post by ttl » Sun, 16. Nov 08, 16:52

Yea, the coding can be a bit rough, and it's a port from X3R, so some finer commands have probably been added. Thanks for the tips.

I'll fine-tune this, and perhaps extend if it gains some popularity.

A5PECT
Posts: 6078
Joined: Sun, 3. Sep 06, 02:31
x4

Post by A5PECT » Sun, 16. Nov 08, 19:34

Sounds great, I'll try it out tonight.
Admitting you have a problem is the first step in figuring out how to make it worse.

User avatar
OOZ662
Posts: 1211
Joined: Tue, 8. Apr 08, 10:45
x4

Post by OOZ662 » Sun, 16. Nov 08, 21:31

Well, I installed this entire package and a couple other small scripts at the same time and had a complete freeze (game stops, sound loops, Windows continues to function) a few hours in. (I lost a PNR! [ external image ])

From the symptoms, it seems like the game got stuck waiting for something. I dunno if it was this package, but I figured I'd post in case it occurs to anyone else.

ManiakNL
Posts: 57
Joined: Tue, 27. Feb 07, 17:36
x3ap

Post by ManiakNL » Sun, 16. Nov 08, 21:53

This line "Total military strength of each race is finite, but huge"

So when i destroy a frigate will the race starting to build a new one or ??

Basicly what i take out of this line is when i kill a ship from time to time eventualy it will vanquish the entire race militairy capability's ?

User avatar
ttl
Posts: 537
Joined: Sun, 6. Feb 05, 13:04
x3tc

Post by ttl » Mon, 17. Nov 08, 01:38

ManiakNL: Each race has reserves amounting to the equivalent of few dozen destroyers. Each ship type is valued roughly as per-credit-price. Periodically this reserve "credits" number gets increased. So you can take a race down, if you kill them faster than they can respawn. The respawn rate is a destroyers worth every few hours or so.

OOZ: Still having the issue? It could be an infinite loop in a script. If anyone else notices this might cause that, please tell me asap, and I'll hit debugging mode. Works fine for me, though, so you might want to check with the other scripts you installed?

User avatar
OOZ662
Posts: 1211
Joined: Tue, 8. Apr 08, 10:45
x4

Post by OOZ662 » Mon, 17. Nov 08, 02:38

I was just coming to fire up the game again.

For reference, the other two scripts installed at the same time were Gazz's modified Collect All Wares in Sector script and JumperBR's Marine Trainer. I still haven't actually used either of them.

Methel
Posts: 26
Joined: Tue, 23. Sep 08, 18:40

Post by Methel » Mon, 17. Nov 08, 03:27

Think I might have the same problem as OOZ.
My game now locks up whenever a drone is destroyed. I have to tab out and kill the x3 process.

Now for the scary part, I think I've uninstalled your script. (by manager and deleting the cad and dat files) but this still happens.

Edit:
Could it be the kill command still running and somehow locking up when a goblin (mars drone) is destroyed?

User avatar
OOZ662
Posts: 1211
Joined: Tue, 8. Apr 08, 10:45
x4

Post by OOZ662 » Mon, 17. Nov 08, 04:29

I don't use MARS. It didn't happen this time, however I did notice a lot of un-named Centaurs buzzing around.

Methel
Posts: 26
Joined: Tue, 23. Sep 08, 18:40

Post by Methel » Mon, 17. Nov 08, 04:37

Did you run the kill script to get rid of them already?
If not, theres your problem.

Lancefighter
Posts: 3144
Joined: Sun, 19. Dec 04, 02:41
x4

Post by Lancefighter » Mon, 17. Nov 08, 06:45

As a minor question, if only to satisfy my curiosity; Would it be possible to somehow add a command (a ship custom command, for example, or a hotkey...) to send a message to the player detailing the 5 empire's current approximate values?

Also, I am wondering if you could possibly scale the credits earned per hour or whatever by how many sectors the race has, and how many are core or not. (i think i saw they added a new script command to check for core sectors.. :D )
This way, its still possible to take them down, and keep them down...And if they own no sectors, they dont respawn anything. (unless they somehow regain a foothold in a unknown system somewhere.. hint hint :P )

Geaux
Posts: 40
Joined: Wed, 9. Nov 05, 08:38

Post by Geaux » Mon, 17. Nov 08, 07:03

Lancefighter wrote:As a minor question, if only to satisfy my curiosity; Would it be possible to somehow add a command (a ship custom command, for example, or a hotkey...) to send a message to the player detailing the 5 empire's current approximate values?

Also, I am wondering if you could possibly scale the credits earned per hour or whatever by how many sectors the race has, and how many are core or not. (i think i saw they added a new script command to check for core sectors.. :D )
This way, its still possible to take them down, and keep them down...And if they own no sectors, they dont respawn anything. (unless they somehow regain a foothold in a unknown system somewhere.. hint hint :P )

you could add a lot of function to this.

have spy ships that need to be placed into a core sector within 100km of a equipment dock/shipyard/military outpost or something that will allow you to see how much reinforcement the race has left. no idea how workable that is but you could have it like giving a command once its within range that turns the ship into a adv satellite

recon ships that fly around looking for the spy ships/sat's.

recons that hunt for your ships/stations and call in a random sized fleet to attack. sometimes 3 m3's sometimes 3 m2's ect..

User avatar
ttl
Posts: 537
Joined: Sun, 6. Feb 05, 13:04
x3tc

Post by ttl » Mon, 17. Nov 08, 13:26

You can see if the kill script is running by checking your running global scripts from the editor. Not sure what long term effects not running it, and keeping the unnamed ships around for a long time, has. That depends on how Jobs are handled exactly, but never noticed anything like hanging up.

Can't think how those fighter drones would link to this in any way. Do you still have that issue, Methel? If you do, please give me exact specs of which sector are you in, who owns the drone that's destroyed, and what are the relations (friend/foe) between you (the player), the owner of the system, and the drone.

Just removing the scripts might leave for some unintended residual effects. If you turn it off from the AL settings menu, it should run a script that cleans up all that is made, within the scope of several in-game hours (48 max). Just removing the scripts will leave the created patrol/assault ships around running what scripts they had (running scripts remain in memory). But the scripts that keep things clean up are deleted, and won't work. Uninstalling the mod should just make the standard patrols re-appear eventually, so that should be fine.

Post Reply

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