[SCRIPT] PiloteAI III.70 (28.09.08)

The place to discuss scripting and game modifications for X³: Reunion.

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

User avatar
Azz
Posts: 1031
Joined: Tue, 18. May 04, 20:14
x4

Post by Azz » Sun, 15. Jul 07, 23:38

It is a way more natural to give value to the veterans :)


Beyond the level 30 the pilote AI will continue to increase in rank but will gain no more speed and manoever bonus (8 and 4 are the max) and they will remain 'Fleet Admiral'

and don't forget that the functions of AI extension will also be more effective (emergency shield, drones, antimissile... etc)
iou naud ouate, aille ama pis | Pilote IA | Site

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

Post by ttl » Mon, 16. Jul 07, 09:44

Azz : Thanks for the reply. The input parameters limit is indeed the pain. And taking a more careful look it seems I seriously underestimated the scope of the script. Like wow :o

I'm still hesitant on whether all this is what I want from my game, but major Kudos for the work. :)

wanderer
Posts: 278
Joined: Wed, 6. Nov 02, 20:31
x3tc

re.: Problems with the MK3 Traders

Post by wanderer » Mon, 16. Jul 07, 14:22

Hey Azz,


found a problem with the 'Patch scripts'.

You provide an older MK3 trader routine with the scripts 'plugin.autotrade.galaxy.xml' and 'plugin.autotrade.sector.xml'.

I do not know from which version these scripts are, but in case they are really old agains the actuall MK3 optimization scripts (http://forum.egosoft.com/viewtopic.php? ... sc&start=0, in german only - sorry).
These old scripts have many disadvantages, e.g. EC reserve, Xenon sector flights, ... - With the Bonuspack 3.1.01 they where included, afterwards as people recognised they are buggy, they where removed from further bonuspacks. So, if you installed all bonuspacks according when they came out, players may have the old buggy versions.

I recognised the mentions problem, when my MK3 traders where desperatly trying to make suizide through traveling through Xenon sectors :P
So I found out.

Now, for scripters who uses the newer optimized MK3 versions. Its easy Azz added only 2 sections into the code of above scripts. This have to be done, after the change you should delete (or rename) the origninal script .Pck's or pack them new:

I.) Renaming ship:

Code: Select all

...
035 @ $Pilot = [THIS] -> call script 'lib.ship.var.setpilotname' :  ship=[THIS]  experience=$experience  rank=$experience  ranktype=1
036   
037   * -------------------- PiloteAI changes -----------------
038   $aff.ext.nom = get global variable: name='azz.aff.ext.nom'
039   if $aff.ext.nom != null
040 @  = $dummy -> call script 'azz.ext.nom' :  Prefixe='CAMK3'  Suffixe='Uni'  Vaisseau=[THIS]  Couleur Prefixe=9  Couleur suffixe=9
041   end
042   * -------------------- PiloteAI changes END -----------------
043   
044   init:
...
Done between the script call for the pilot name and the start of the MK3 script.

II.) Setting exp.:

Code: Select all

...
799      [THIS] -> set local variable: name='experience' value=$experience
800      
801   * -------------------- PiloteAI changes -----------------
802      $aff.prime = get global variable: name='azz.aff.prime'
803      if $aff.prime != null
804       if $aff.prime == Player
805 @      = $dummy -> call script 'azz.prime.grade.mk3' :  Ship=[THIS]
806       end
807      end
808   * -------------------- PiloteAI changes END -----------------
809      
810 @    $Pilot = [THIS] -> call script 'lib.ship.var.setpilotname' :  ship=[THIS]  experience=$experience  rank=$experience  ranktype=1
...
Add this lines after the MK3 sets the pilot exp. points.

Both changes have to be done in both scripts. Afterwards restart ALL MK3 traders. So they may use the new scripts now. An Save/relode will not do it.

@Azz: Would be good to mention this in your notes on page one of this forum-topic and/or inside the manual.

regards

User avatar
Azz
Posts: 1031
Joined: Tue, 18. May 04, 20:14
x4

Post by Azz » Mon, 16. Jul 07, 21:59

Thanks for the report Wanderer... :D

Effectively the patch for the MK3 that I offer is the version supplied with the bonus pack but not the version improved by Gnasirator.


To avoid this kind of inconvenience I think that I am going to remove the modification of the mk3 script and transfer the test in extensionAI script ('azz.prime.ext.IA'), which will verify from time to time the level of the trader and will adjust the rank of PiloteAi.
It will be a little less effective, the test being regularly made and not only at the change of trader's level, but it will be much more compatible.

And to follow your advice, I will add a part in the doc 'for scripters'
iou naud ouate, aille ama pis | Pilote IA | Site

Kilrathi Avenger
Posts: 275
Joined: Fri, 6. Feb 04, 20:16
x3tc

Re: [SCRIPT] PiloteAI III.50 (23.06.07)

Post by Kilrathi Avenger » Tue, 17. Jul 07, 14:02

Azz wrote:
  • Compatibility with other scripts
This script is fully compatible with:
:arrow: XFP Mod v.4.x
:arrow: Xtended .7x
:arrow: MK3 or Naffarin’s Station Traders script - traders will increase their level according to their trading ability and experience. MK3’s can also eject if the ship is destroyed.
Noted the above but
Does the ":arrow: MK3" bit refer to "gnasirator's"
MK3 Improvement V 1.29.8 - 06/13/2007
http://forum.egosoft.com/viewtopic.php? ... sc&start=0
I.E. is pilotAI compatible with this :?:

Thanks
"As I slide down the banister of life;
my job is just another splinter in the bum"

User avatar
Azz
Posts: 1031
Joined: Tue, 18. May 04, 20:14
x4

Post by Azz » Tue, 17. Jul 07, 18:51

Hello Kilrathi Avenger
No it refer to the vanillia MK3, also present in the bonus egosoft pack, not the to "gnasirator's" MK3 Improvement.

If you use another version of the MK3, does not install file of the patch folder.
This patch is there especially to allow mk3 to rise in rank as they gain trader's levels.

I am going to change that in a next version, for not to be dependent on a version of the MK3
iou naud ouate, aille ama pis | Pilote IA | Site

Kilrathi Avenger
Posts: 275
Joined: Fri, 6. Feb 04, 20:16
x3tc

Post by Kilrathi Avenger » Wed, 18. Jul 07, 10:36

Thanks for the quick response Azz

Checked the MK3 Improvements SPK and its only in German. :roll:
But as it is not compatible with PilotAI I won't be using it anyway :!:
Not offence intended gnasirator.
"As I slide down the banister of life;
my job is just another splinter in the bum"

Mailo
Posts: 1901
Joined: Wed, 5. May 04, 01:10
x3

Post by Mailo » Wed, 18. Jul 07, 11:13

Kilrathi Avenger wrote:Thanks for the quick response Azz

Checked the MK3 Improvements SPK and its only in German. :roll:
But as it is not compatible with PilotAI I won't be using it anyway :!:
Not offence intended gnasirator.
I used Gnasirator's improvements alongside PiloteAI for quite a while, as far as I know the only incompatability right now is that the PiloteAI in the trader ship won't level up when the MK3 software gets experience. Not really a biggie to me though.

The improvements are rather nice, they deal mostly with selling remaining cargo, keeping an energy cell reserve appropriately sized depending on cargo room, and spending idling time in trade stations instead of any station to protect against the GOD engine running wild.

Still, I've switched over almost completely to the EST, since it is more flexible.

User avatar
ezra-r
Posts: 3420
Joined: Fri, 14. Oct 05, 21:04
x4

Post by ezra-r » Wed, 18. Jul 07, 17:05

Azz wrote:Hello ezra-r

I looked in the script and everything seems OK.
Voxol had the good idea to send a Signal-Killed for the abandoned ship, this guarantees that the squadron will be reformed if it's a player's ship.
On the other hand it can involve a small glitch :
When a ship is abandoned, the script of Voxol is going to create an astronaut, then PilotAI gets the Signal-Killed and thus creates one astronaut or one AI rescue pod (randomly according to the race).
We can thus have in some cases two ejected pilots, or one pilot and one AI.
But nothing prevents that a ship embarks several pilots, co-pilot and AI-co-pilot (remember R2-D2 ;))

Finally PilotAI will also calculate a bounty and a experience bonus if it is a ship of the player wich managed the capture.

So the cohabitation of these two scripts should cause a lot of interesting things :)
Im looking forward to it, thanks a lot for the answer

User avatar
ezra-r
Posts: 3420
Joined: Fri, 14. Oct 05, 21:04
x4

Post by ezra-r » Thu, 19. Jul 07, 20:56

Btw, i dont know if I mentioned it before but Im getting some annoying alarm sound every certain number of seconds and its becoming irritating, how do I turn it off?

wanderer
Posts: 278
Joined: Wed, 6. Nov 02, 20:31
x3tc

re.: CPU intensive ComAI sat network

Post by wanderer » Sat, 21. Jul 07, 11:36

Hey Azz,


hopefully I'm wrong,.... :?
When trying to set an ComAI, and then activating the sat network, I was surprised that nothing happend in the first place/on the fist look.

When starting the sat network in gobal or restricted mode, your calling the script Azz.SSG.init (Correct?). Now, this seems to be a 'CPU killer'. It took very long on my side. I figured out, its because your going to loop to every sector, and every sat (max.12). Now, I have approx. 400Sats -> means 400000msec in case we only count your wait from the code!
Also, the result array is quite big!

I think this is a not so good solution. As your manual says, fighter will only control 5 sectors from homesector; big ships 10. You are storing the whole universe sat network in a gbobal. Well, not very fast and reliabel.

Points:
When using a lot of sats (e.g. let them deploy automatically in a 8-box), it grows very big. This means the comparison against the ComAI sector and its neighbours will take a long time to compare.
Logical - normally after every deployment of sats in new sectors, you have to call again the script, so the new sats will be counted and the scripts will be startet.
Ah, yes the sat script 'azz.SSG.scan'. In my own game, I will now have around 400 of them, and more... This is not very good, it uses a lot of CPU for nothing.

Recomend:
As said, ComAI for a group is max. 10 sectors, so why not only use 10 sectors around homesector, and store this local/inside the group leader. Or as a global with the groupnumber inside the variablename. This also makes the recalculation easier, if the sector will removed, added or if the group gets a new sector assigned. This also reduces the running scan-scripts by a great number.

regards

User avatar
Azz
Posts: 1031
Joined: Tue, 18. May 04, 20:14
x4

Post by Azz » Sat, 21. Jul 07, 14:36

Wanderer :

The script of initialization is not necessarily a cpu killer, it spends in fact 99 % of its time in waiting.

I had put a waiting time of 1000ms between every satellite initialized to simulate a time of starting up of the network.
But obviously, with 400 sats, it become too much...

Script azz.SSG.scan :

Code: Select all

036 @ = wait 10000 ms
You can reduce this waiting time at 1ms or 5ms, but you should not erase it, the break is necessary not to freeze the game.


Also every satellite executes its script of scanning only once every 10s, what guarantees not to use too much of cpu time. And if it detects an enemy, the arrays are only updated if it is within range of a ComAI.
I specify that the size of the arrays depends on the number of sectors with satellites, and not the number of satellites.

Taking the problem in the other way, starting with ComAI, create the problem of determining the list of the surrounding sectors to scan which is not very simple in the scripting language.
And if the array are memorized for every Comai and not in global way, we have the problem of the update of the threat when two ComAI share sectors. Currently when a CopmAI supports a threat, the threat is reduced or canceled and the other ComAI take it into account.

I will make this a little more effective in the next release, by reducing the waiting time in the init script and increasing it in the scan script.


ezra-r :
what alarm sound ?
if it is the network alarm, you can select the silent mode in the ComAI Network Setup, available from the communication menu with the Pilot AI.
(select : Muted mode on-off)
iou naud ouate, aille ama pis | Pilote IA | Site

wanderer
Posts: 278
Joined: Wed, 6. Nov 02, 20:31
x3tc

Post by wanderer » Sat, 21. Jul 07, 18:42

Hey Azz,

thx for the quick replay - you're correct about the 1000ms. I reduced them to 100ms. By the way I counted 1147 sats. These mass came with an automatic deployment script, which covers a 8-box per sector + 1 sat per gate.
Hm, your correct about the problem with more ComAI's.

Another question: Whats about enemy sectors? - As I see in the game, my ships are now often engaged in pirate sectors, this while I have sats there. Same may happen to Khaak and/or Xenon. Ok, I could use the Limited network.
But, a possibility to select the responses for the group would be great. Meaning: If e.g. the group leader has Pirates, Khaak and/or Xenons as enemies selected. It should not jump to theior sectors.


@ezra-r:
I also have the 'Warning' sound. Mute on-off works as it seems. Thing is, its inside 'azz.SSG.scan. This script will run every 10sec on every sat. It gets the gobal variable for mute. Now, as writen above, I have quite a count of sats. Means, it will take some time, untill all scripts are through and the sound will be off - hopefully...

@Azz:
About the ComAI scan range. As writen in the manual, 10 sectors for a big ship. I set the Com network to global scan. When activationg the ComAI group, they jump also more than 10 sectors. E.g.: Startsector/homebase of group - Habgier (the one you can buy), ComAI group optiion is set to 'No, Stay around' (value=N) in the followup menue. Now, the group jumped to Handelshafen (Merchant heaven). Whitch is more than 10 sectors away. Do you count the x-y sector differences or the real jump-sector-count?

regards

User avatar
Azz
Posts: 1031
Joined: Tue, 18. May 04, 20:14
x4

Post by Azz » Mon, 23. Jul 07, 00:57

Hello

I use the real jump-sector-count :

Script azz.SSG.portee

Code: Select all

032       $dist = get jumps from sector $sat.sector to sector $ship.sector
where sat.sector is the sector of the satellite wich give the alert, and ship.sector the sector of the ComAI.
I dist is =< 10 (8 in fact, gasp the doc is not up-to-date) the alert will be taken in acount by the ComAI and it can send out a squadron.


EDIT :

I am working at present on a new version which will add some functions and rectifications. But it is especially the occasion to work again on the reduction of slots commands, that I hope to return to a more consensual number :D
iou naud ouate, aille ama pis | Pilote IA | Site

Thrandisher
Posts: 357
Joined: Sun, 1. Jul 07, 03:33
x4

Post by Thrandisher » Fri, 27. Jul 07, 20:42

While useing this and FCC, everytime i go to move a factory with FCC it creates a pod from the 6 camera drones.

Also im not sure what its from, im gonna try to track it down later on today but i think it could be a combo of this, fcc and lv cheats. Something puts me up to 2 billion credits. I might be confliction between fcc and lv cheats, but this was one of 4 scripts i put in and never had that problem before. I think the problem happens when i build a station and i thoguht i had the lv cheat disabled that conflicted with a command with FCC.



One thing i cant figure out with this is with jumping. This is a taskforce im trying right now. a TL set up as carrier/tanker, a ts set up as esupplyer, and 2 wingmen. the wingmen will carry 50 energy but when i goto jump over that, the tl and ts will jump, and the wingmen fly (because they dont have enough energy). the pilots in the wingmen are very low lv while the tl and ts are lv 20+. Could it be a conflicting script that isnt letting them get enough energy from the esupplyer or are they just to low lv to get it?

sartha
Posts: 238
Joined: Sun, 22. Jul 07, 01:09
x4

Post by sartha » Fri, 27. Jul 07, 21:06

I really like this script ^.^

I find one annoyance about it though:

Too many ranks/levels >.> If you look at real life, the only "Pilots" in the airforce are 2nd lieutenants and upwards (Airforce O1+), bellow that are only ground crew.

Ontop of that, starting at O7 (Airforce Brigadier General), you're considered a Flag Officer and no longer pilot planes, instead you pilot a desk. Ofcourse in space operas like Wing Commander wich makes heavy use of fighters and carriers, you see a mixture of Airforce and Naval rank usage:

Navy ranks are used for starship crew, Airforce ranks are used for the fighter crew.

I have a quick suggestion, (unless someone else is willing to make the modification or help me figure out to do the modifications)

You can easily reduce the number of ranks to 16, spacing them out by increasing xp requirements. I'll list an example of ranks that I quickly compiled by combining airforce/navy of the US and Canada (international) along with some notes I wrote down to maybe improve your script (wether you use my ranks or not :P)

OFFICER RANKS:
1 Ensign (can pilot TP)
2 Lieutenant Jr Grade (can pilot TS)
3 2nd Lieutenant (can pilot M5)
4 1st Lieutenant (can pilot M4)
5 Lieutenant Commander (can pilot M3)
6 Commander (can pilot M3+)
7 Major (flight commander; can lead a squad of up to 6 M3+, M3, M4, M5, TS, or TP)
8 Lieutenant Colonel (squadron commander; can lead up to 2 flights)
9 Colonel (wing commander; can lead any number of M3+, M3, M4, M5, TS, or TP)
10 Captain (Starship command; can pilot TL, M6, M7, and M2)
FLAG RANKS:
11 Commodore (Flagship command; can pilot M1)
12 Rear Admiral (Task Force command; can lead up to 4 starships)
13 Vice Admiral (Squad command; can lead up to 2 task forces)
14 Admiral (Fleet Command; can lead up to 2 squads)
15 Fleet Admiral (Armada command; can lead up to 2 fleets)
16 Space Marshal (Sector Command; can lead all friendly ships in a sector)

Here's some of my thoughts and explanations on the previously mentioned notes:

I like how an AI would have to earn ranks in order to be moved onto a new ship (assuming you *must* have an AI on all ships, a newly created or purchased vessel could become an exception to this, thus having a low-rank AI on a high-rank ship... not that it would be beneficial ^.^;;)

The bonuses provided by those that can "lead" multiple vessels apply the bonus to any ship that has his/her vessel either as Homebase or in the same squadron.

I don't know if all of this is useable, and I'm not saying the current system is bad, just my $0.02 CND on the possibility of improvements

So far I haven't had any trouble with this script and I use the Bonus Pack (latest), Xtended (latest), Anarkis Carrier Commands (latest) and Sector Takeover (latest)... oh, and Lv's cheats ofcourse.

Trokhon
Posts: 189
Joined: Sun, 2. Mar 03, 18:59
x4

Post by Trokhon » Sun, 29. Jul 07, 00:35

Will this script, which is a phantastic one, be also incompatible to

LV's Race Response Fleet Redux?
and if yes is there a chance it will be compatible soon?

Thanks

User avatar
Azz
Posts: 1031
Joined: Tue, 18. May 04, 20:14
x4

Post by Azz » Sun, 29. Jul 07, 12:50

Hello Trokhon :

PilotAI is compatible with the script of LV with some limitations:
Due to the way that the signal-killed (= ship destruction detection) is handle, the ships managed by the LV's script don't be detected by pilotAI when they are destroyed.
That means that for some ships, those which are part of response fleet, you cannot be able to gain extra-bounty or exp when you destruct them.
For the rest, there should be no problem..

Asser69 :
A esupplyer supply the wingmen in energy for a jump round about 5 sectors. I limited it to keep space in ships, but maybe it is a bad idea.

Concerning FCC :
I will modify the script to prevent the cameras from ejecting IA
For the extra-money i don't know, I would have to look in the FCC Script to see if that can be bound to PilotAI

Sartha :

I already had the idea to limit the usage of ships and size of squadrons according to the rank of the leader.
But it is not very simple to set up. For example what must we do if a leader is destroyed and its successor is not rather graded to command its squadron.

For the rank list, you can modify by yourself the list in the T file '447160' AND '447161' (at the end) :

Code: Select all

		<t id="200">Able</t>
		<t id="201">Trainee</t>
		<t id="202">Recruit</t>
		<t id="203">Fleetman</t>
		<t id="204">Apprentice</t>
		<t id="205">Junior Pilot</t>
		<t id="206">Senior Pilot</t>
		<t id="207">PO 3rd Cls</t>
		<t id="208">PO 2nd Cls</t>
		<t id="209">PO 1st Cls</t>
		<t id="210">CPO</t>
		<t id="211">Senior CPO</t>
		<t id="212">Master CPO</t>
		<t id="213">Cmd Master CPO</t>
		<t id="214">Trainee Officer</t>
		<t id="215">Junior Ensign</t>
		<t id="216">Ensign</t>
		<t id="217">Senior Ensign</t>
		<t id="218">Junior Lieutenant</t>
		<t id="219">Lieutenant</t>
		<t id="220">Senior Lieutenant</t>
		<t id="221">Lieutenant Commander</t>
		<t id="222">Commander</t>
		<t id="223">Captain</t>
		<t id="224">Commodore</t>
		<t id="225">RAdm – lower half</t>
		<t id="226">RAdm - upper half</t>
		<t id="227">Vice Admiral</t>
		<t id="228">Admiral</t>
		<t id="229">Fleet Admiral</t>


You must have the same number of rank, but you can repeat them (for example : major/major experimented...)
iou naud ouate, aille ama pis | Pilote IA | Site

Kelzoth
Posts: 30
Joined: Mon, 24. Apr 06, 18:47

Post by Kelzoth » Sun, 29. Jul 07, 15:44

Doesn't install with the 2.0.1 version of the XScript Installer. Gives a message about some Huffman compression shizz.

Osiris_sam
Posts: 422
Joined: Thu, 24. Aug 06, 13:45
x4

Post by Osiris_sam » Sun, 29. Jul 07, 15:56

if you still have the old version of the plugin manager, it will install with that. otherwise i would suggest using .rar download, and placing them manually into the scripts/t folders in the x3 directory. until such time that Azz updates the download

Return to “X³: Reunion - Scripts and Modding”