[SCRIPT] OCS Apollo (version 1.0) - Improved Fighter AI

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

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

Rate this script

Excellent
30
70%
Good
10
23%
Okay
3
7%
Poor
0
No votes
Terrible
0
No votes
Not interested
0
No votes
 
Total votes: 43

Laureati
Posts: 140
Joined: Sat, 20. May 06, 11:42
x3tc

[SCRIPT] OCS Apollo (version 1.0) - Improved Fighter AI

Post by Laureati »

[Script] Open Combat System (OCS) Version 1 Apollo

Name: OCS Apollo
Version: 1.0
Date: 21.07.2007
Scripter: Laureati
Command used: NONE
Text ID: NONE

DOWNLOADS:

OCS Project site
OCS Apollo zip file


KNOWN CONFLICTS:

No known conflicts.

Not completely compatible with any scripts that replace the vanilla signed fight scripts.

UPDATES:

[Apollo - Version 1] 21.07.2007

- FCS Mk.III compatible
Includes !fight.attack.object.xml for FCS Mk.III users

- Full Fightskill Levels
Full spawning of all fightskill levels (dependent on jobs.pck file)

- Modified Fightskill
Replaces 2 unused skills in the vanilla fightskills with tactical skills

- Fixed Fightskill for Drones and Lasertowers
Drones and Lasertowers now have a fixed fightskill level

- Long Range Missile Support
Fighters now launch missiles from range (fightskill dependent)

- Improved Missile Awareness
Fighters in combat are slightly more aware of incoming missiles

- Improved Missile Tactics
Fighters will launch missiles based on target and circumstances

- Improved Anti-missile Support
Fighters now more active in dodging and destroying incoming missiles

- Improved Dogfighting
Fighters will actively dodge incoming fire

- Improved Chase Code
Fighters and Corvettes will stop chasing targets that are too fast and too far away to engage, and switch to another target if available

- Anti-capital Ship Tactics
Fighters and Corvettes will conduct 'strafing' runs on Capital class ships, and attempt to dodge turret fire

- Modified Corvette tactics
Corvettes stopped from making 'useless' maneuvers like dodging missiles



INTRODUCTION:

The OCS Apollo (version 1) modifies the default fight scripts and adds several features into it. The OCS scripts replace (but do not overwrite) the existing fight scripts with OCS fight scripts. The OCS scripts can be editted with the script editor and are basically an unsigned, modified version of the vanilla scripts.


TOPIC LIST:

I. Features Overview
II. Features Description
III. Installation instructions
IV. Installing for FCS Mk.III users


I. FEATURES OVERVIEW:

- Full fightskill levels
- Modified fightskill
- Fixed fightskill for drones and lasertowers
- Long range missile support
- Improved missile awareness
- Improved missile tactics
- Improved anti-missile support
- Improved dogfighting
- Improved chase code
- Anti-capital ship tactics


II. FEATURES DESCRIPTION:

1. Full fightskill levels

The vanilla scripts did not allow the highest level of fightskill (30) to spawn. Depending on the skill level assigned in the job.pck file, the OCS Apollo allows full spawning of all fightskill levels

This may not be compatible with other scripts that modify the !plugin.acp.fight.skill.std file

2. Modified fightskill

The skills "Max.speed" and "Defencedistance" have been replaced with "Missile.delay" and "Tactical.awareness". These two new skills redefine how the AI handles combat. Missile delay sets how often the AI uses missiles (a bug in the vanilla scripts caused ships to fire all missiles at once). Tactical awareness determines how often the AI applies 'special' tactics.

3. Fixed fightskill for drones and lasertowers

In the vanilla game drones and lasertowers spawn with a random fightskill level. OCS vanilla ensures that all drones and lasertowers have the same level of fightskill, making them generally more reliable.

4. Long range missile support

Fighters and Corvettes will now launch missiles from long range.

5. Improved missile awareness

In the vanilla game, if is ship is closing on a target but not yet in gun range it ignored missiles. In OCS Apollo fighters and corvettes actively running a combat script (i.e. with the ocs.fight.attack.object script running) will be aware of incoming missiles even when closing on a ship at long range.

6. Improved missile tactics

In the vanilla game, some missile tactics were already written in. These were improved upon. Fighters will now:-

i) launch a swarm of wasp missiles within 500m of a target as a 'kill' shot (500m is the range that wasp missiles fire in a tight group)

ii) will also use other missiles at dodging or otherwise vulnerable targets

iii) will NOT fire missiles under 200m from a target, reducing self-termination with Hornet missiles

iv) will use Hurricane missiles against Khaak Clusters

v) will use Firestorm torpedos and other large missiles against Capital ships and Stations

7. Improved anti-missile support

Improved the vanilla anti-missile support to make fighters dodge and shoot down incoming missiles more effectively

8. Improved dogfighting

Fighters will actively dodge if their target is firing on them. They will also take "pop-shots" more often using missiles as well as guns to attack any targets of opportunity. Higher skilled pilots will shoot at their attackers in an attempt to force the attacker into an evasive action so they can counter-attack.

9. Improved chase code

The vanilla game code caused fighters to pursue an esacping target relentlessly even though there was no hope of catching it. OCS Apollo allows Fighters and Corvettes to disengage from an uncatchable target. The ship would then search for the next available target and pursue that instead. (If no other target is available then the ship will attempt to re-engage the first target.)

10. Anti-capital ship tactics

Due to collision avoidance, fighters (and sometimes corvettes) would circle uselessly around a large ship (e.g. M2 or TL). In OCS Apollo, the Fighters and Corvettes will dodge away from the capital ship then circle in to do an attack run. They will also use missiles more actively against capital ships.

(note: - IREs, PBEs and Mass Drivers are too short ranged to allow fighters to attack Capital class ships in the vanilla game)

III. INSTALLATION INSTRUCTIONS:

INSTALLING ZIP:

1. Backup the vanilla !fight.attack.object.pck then remove it from the "scripts" folder.

2. Unpack the 'ocs_apollo.zip' into the root directory of X3 program. The files will unpack automatically into the correct folders. There will also be a 'readme' folder with this readme file.

"ocs_apollo.zip" will create the following folders in your X3 directory: -

readme/OCS Apollo
- contains the readme documentation

scripts/backup.ocs.apollo
- contains a backup of the vanilla !fight.attack.object.pck

scripts/ocs.apollo.fcs3
- contains the FCS Mk.III compatible version of the OCS !fight.attack.object.xml

scripts/ocs.apollo.fcs3/backup
- contains the backup of the original FCS Mk.III !fight.attack.object.pck

For manual installation copy the following files into the appropriate folders: -

"scripts" folder:
!fight.attack.object.xml
ocs.plugin.fight.attack.object.xml
ocs.plugin.fight.attack.tactics.xml
ocs.plugin.fight.evasive.def.xml
ocs.plugin.fight.interrupt.xml
ocs.plugin.fight.missile.def.xml
ocs.plugin.fight.skill.std.xml
ocs.plugin.get.varable.xml
ocs.plugin.missile.check.xml

[Note: - !fight.attack.objects.pck MUST be removed from the "scripts" folder. The OCS does NOT overwrite this file. The game engine uses .pck files in favour of .xml files - if !fight.attack.objects.pck is still in the "scripts" folder, the OCS will not be running.

UNINSTALLING FOR ZIP:

1. Delete the following files from your X3 program:-

"scripts" folder:
!fight.attack.object.xml
ocs.plugin.fight.attack.object.xml
ocs.plugin.fight.attack.tactics.xml
ocs.plugin.fight.evasive.def.xml
ocs.plugin.fight.interrupt.xml
ocs.plugin.fight.missile.def.xml
ocs.plugin.fight.skill.std.xml
ocs.plugin.get.varable.xml
ocs.plugin.missile.check.xml

2. Copy your old !fight.attack.object.pck into the "scripts" folder.

[Note: - you can also simply copy the !fight.attack.object.pck into the "scripts" without deleting the OCS files. The game engine should ignore the OCS.xml files if there is a .pck version of "!fight.attack.object". However, to prevent problems, this is not advised.]

IV. INSTALLING FOR FCS MK.III USERS:

You will need to overwrite the !fight.attack.object.xml with the FCS Mk.III friendly version provided in the "scripts/ocs.apollo.fcs3" folder. Also available here.

-END-
User avatar
Sandalpocalypse
Posts: 4447
Joined: Tue, 2. Dec 03, 22:28
x4

Post by Sandalpocalypse »

Sounds good.

But will they kamikaze into the xenon station?

8)
Laureati
Posts: 140
Joined: Sat, 20. May 06, 11:42
x3tc

Post by Laureati »

Nah. For that you'll have to wait for my mod. The one with the Banzai Space Commandos!

:lol:
Star_Raider15
Posts: 1212
Joined: Thu, 15. Jun 06, 08:08
x3

Post by Star_Raider15 »

hmm interesting script
but, out of curiosity, just how good is the new AI in comparison to the old one?
The answer is just another question.
Laureati
Posts: 140
Joined: Sat, 20. May 06, 11:42
x3tc

Post by Laureati »

Star_Raider15 wrote:just how good is the new AI in comparison to the old one?
Off hand it's hard for me to say. I've been tweaking it for over a month and can hardly remember the original AI now. Haha.

It's not tremendously better, in that you won't see the AI functioning at the level of the player. That's just not possible. I didn't want to make game play difficult. Also I didn't want to do something that would make the FCS Mk.III redundant.

The Improved AI is still a damn shot better than the original, and I've found it actually quite entertaining to watch. You'll find the enemy doing 'stupid' things less often, and at times a pack of 4 Xenon Ns with an M can become a real threat. Of course there are times when they're easy to handle too. It's down to a matter of chance, environment and equipment load.

What the AI will do is gang up very effectively on targets (I've seen several fighters and 2 corvettes take out a Xenon K), launch dangerous missiles at dangerous times, and hang on to your tail like it was in a Gay Pride Parade.

Hope that's good enough for now. :)
Star_Raider15
Posts: 1212
Joined: Thu, 15. Jun 06, 08:08
x3

Post by Star_Raider15 »

Laureati wrote:
Star_Raider15 wrote:just how good is the new AI in comparison to the old one?
Off hand it's hard for me to say. I've been tweaking it for over a month and can hardly remember the original AI now. Haha.

It's not tremendously better, in that you won't see the AI functioning at the level of the player. That's just not possible. I didn't want to make game play difficult. Also I didn't want to do something that would make the FCS Mk.III redundant.

The Improved AI is still a damn shot better than the original, and I've found it actually quite entertaining to watch. You'll find the enemy doing 'stupid' things less often, and at times a pack of 4 Xenon Ns with an M can become a real threat. Of course there are times when they're easy to handle too. It's down to a matter of chance, environment and equipment load.

What the AI will do is gang up very effectively on targets (I've seen several fighters and 2 corvettes take out a Xenon K), launch dangerous missiles at dangerous times, and hang on to your tail like it was in a Gay Pride Parade.

Hope that's good enough for now. :)
lets see what this baby can do :D
EDIT: is it compatible with XTM 0.7?
The answer is just another question.
Laureati
Posts: 140
Joined: Sat, 20. May 06, 11:42
x3tc

Post by Laureati »

As far as I know it should be, because of how the OCS works. I'm not sure about all the features of XTM though. Individual features, like modified fightskill scripts (e.g. Levelling AI by Nemeo) would be affected, but would still work.

I know there's a few scripts out there that modify the fightskill script, but seeing as the OCS is an open system, it's really easy for the authors to modify the values in the OCS fightskill script to their own version.
User avatar
Sandalpocalypse
Posts: 4447
Joined: Tue, 2. Dec 03, 22:28
x4

Post by Sandalpocalypse »

out of curiousity have you ever matched it up against vanilla script fighters?
Laureati
Posts: 140
Joined: Sat, 20. May 06, 11:42
x3tc

Post by Laureati »

Nope I haven't. Hmmm... interesting idea.
User avatar
Azz
Posts: 1031
Joined: Tue, 18. May 04, 20:14
x4

Post by Azz »

Helo Laureati

Very Nice job :)

I think it will admirably complete PilotAI.


I run to try it..
iou naud ouate, aille ama pis | Pilote IA | Site
Mr. K
Posts: 102
Joined: Sun, 29. May 05, 21:36
x3tc

Post by Mr. K »

Well, the missile tactics certainly work, I can vouch for that.

Though I cant help but think it's a little overpowering at times, for example, I was just playing around when I got a BBS mission from a pirate station for an insane amount of credits, so I figured I'd give it a go.

Upon reaching the destination, and finding a group of 10-12 assorted m5's and m4's, I found myself subjected to so much missile spam that it was *impossible* to escape/avoid/shoot them, and it was also impossible to track a target and fire upon it due to the amount of missiles impacting, this, coupled with the massive amount of standard weapons fire, was just a little too overbearing, in that even though not much of it was actually causing any damage, the constant barrage of missiles and the lack of being able to kill anything eventually caused shield failure leading to hull damage, which compounded the problem due to the decreasing speed, and led to inevitable death.

I can also vouch for the Laser Towers being a lot more useful than the cannon-fodder that were the vanilla versions, and it's come in handy quite a lot too.

I'm currently playing on the Khaak start, and anyone that's ever tried this knows that it can be a royal pain when you are trying to gain rep, only to have some military ships come to take you out. In vanilla, this was an issue that could only be dealt with by trying to avoid them, or killing them yourself. With this installed, simply lead them to your nearest Pirate Base and watch anything and everything up to (at least) an M6 get royally ripped to pieces!

So far, it's certainly made for an interesting last few hours, but trying a solo dogfight against multiple enemies in any ship without turrets is practically suicide, and (imho) that's exactly how it should have been from the get go.

If you haven't already installed this, I suggest you do so quickly, especially if you're the fighting type.

I forsee visits to Xenon sectors being a little more.. shall we say.. interesting, from now on ;)

Very well done, Laureati, I'm highly impressed with what you've done, keep up the good work!

Mr. K
Laureati
Posts: 140
Joined: Sat, 20. May 06, 11:42
x3tc

Post by Laureati »

Thanks for the good word guys.

Yes, the missile system can get tough. Initially I made it work the way it was supposed to - 8 second delay, and fixed the missile call script - but I decided to reduce the 8 second delay for the higher fight skill enemies. I guess the MDM will really come in handy now.

Oh thanks to Sandalpoclypse's curiosity I've been running some tests I hadn't thought of before, and been tweaking the script, especially the counter-attacking system.

I'll be releasing 1.1 as soon as testing and gameplay balancing is done. I'll also release an add-on system that lets fighter class ships use fighter drones (currently only TS-TP class ships launch drones).

Remember that what's true for the enemy is also true for your wingmen! Having a buddy or two with you might even the odds, especially if you're using one of the leveling pilot scripts like PilotAI or Leveling AI.
subaluigi
Posts: 388
Joined: Thu, 23. Dec 04, 22:48
x3tc

Post by subaluigi »

Salut Laureati, :)

your script sounds very interesting, and u wrote already, that it is compatible with X-Freak Cartman's "Fighting Command Software MKIII, which i use.
Azz already wrote that he is checking your software, too.
In fact, i've installed his Pilot-AI script, too and it works fine. So, what do u think, will these 3 scripts (yours, the FCS MKIII and the Pilot AI) run together?

... And would be a combinated work with the other 2 guys be possible, just to make a really big thing, improving the AI and this 3 great scripts?

Merci, merci à tous, à la prochaine,


Louis
¨¨¨¨¨¨¨¨¨¨¨¨¨***modified***
¨¨¨¨¨¨¨¨¨¨¨¨¨and proud of it!!
'Cause X without scripts is like girls without tits...

another new video of the: >>Terran Conflict<<
Mailo
Posts: 1925
Joined: Wed, 5. May 04, 01:10
x3

Post by Mailo »

I also have all three installed and sent 4 M3+ as a taskforce with FCS MK3 against some targets. Except for a whole bunch of error messages (60+ in 2-3 seconds), which I think is caused by the FCS, it seemed to work just fine.
Laureati
Posts: 140
Joined: Sat, 20. May 06, 11:42
x3tc

Post by Laureati »

X-freak Cartman was in touch with me since I began the OCS Project and I think we sorted out any conflicts between the OCS and FCS Mk.III very, very early in the project.

There shouldn't be any error messages, unless perhaps you've got the wrong !fight.attack.object.xml installed.

Please let me know if any more such problems occur as I'd really like to get to the bottom of it. I may just have to release a FCS Mk.III version and a non-FCS Mk.III version seperately, to make sure that the correct !fight.attack.object.xml script is installed. Oversights happen.

Also ensure that the default !fight.attack.object.pck is removed, because that file will prevent the OCS from running at all (it will also disable your FCS mk.III if you're using the FCS Mk.III friendly version of OCS).

[Hope that doesn't sound complicated, because I think I just confused myself. :D]
Laureati
Posts: 140
Joined: Sat, 20. May 06, 11:42
x3tc

Post by Laureati »

OCS and PilotAI

I'll take a look at the PilotAI scripts some time in the future to ensure that the two are totally compatible. Right now I'm a bit too busy to be able to do that properly, but I will look into it once I have a bit more time.

Thanks for all the support!
Mailo
Posts: 1925
Joined: Wed, 5. May 04, 01:10
x3

Post by Mailo »

Sorry about the confusion, I meant the error messages were caused by the FCS only, not by a conflict between FCS and OCS.
There were reports in the german forum of people who got several thousand messages in the span of seconds, crashing X3 who had only FCS installed.

Thanks for the headsup about PiloteAI, looking forward to using OCS alongside with it.
Laureati
Posts: 140
Joined: Sat, 20. May 06, 11:42
x3tc

Post by Laureati »

Azz is testing PilotAI with the OCS currently and he hasn't reported any problems to me so far...

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

Post by ezra-r »

I have been trying this and I dont see AI pilots to get combat levels. So far I havent noticed anything new. how can I know if this is correctly working?

I removed the .pck file as requested.
Laureati
Posts: 140
Joined: Sat, 20. May 06, 11:42
x3tc

Post by Laureati »

You won't really see anything new, because the AI is still largely default and doesn't react to the player in a massively different way. Only when you get into massive furballs (say 10 ships or more) will you see real differences. Either that or you'll see differences if you've used wingmen before (mostly you'll notice that they don't fire off a huge number of missiles all at once).

Things to look out for: -

1. Staggered missile fire from enemy ships.

The enemy may 'spam' you but in a different way. They don't fire all their missiles at once. Instead they fire missiles at intervals, meaning you're under missile threat A LOT more often, but against fewer missiles.

2. More controlled missile fire from owned ships.

Your wingmen/owned ships use the exact same missile script as the AI, but what you'll notice is that - compared to the vanilla game - they are more conservative and more effective with their missile use.

3. More effective missile launches.

Take note of the missiles attacking you. If you notice more Thunderbolts launched at you at ranges outside 5km - OCS is on. If you are attacked more often by Tempest missiles - OCS is on. If you keep having silkworms launched at your M4 - OCS is on.

4. Dodging incoming fire.

This is hard to spot if you don't have wingmen and are not extremely familiar with the AI. You would however see wingmen break even in head-to-heads.

5. Wasp missile tactics.

Again easier to see on your owned ships. At times you'll see your AI wingmen fire a very tight group of missiles, either for a close ranged kill or to unbalance an enemy that's got a bead on it.

5. Anti-capital ship tactics.

This is by far the most obvious clue that the OCS is working. Fighters will engage a captial ship from all angles and do very frequent passes on it (approx 2 attack runs per minute). In the vanilla game, this happens very seldom (approx 1 attack run per 5 minutes).

If you see a couple of M4's doing long strafing runs on a TL/M1/M2 using PACs, then the OCS is definitely working.

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