[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

Post by Laureati »

I'll include a player log update in version 1.1 so that the player can know that the OCS is installed.

I overlooked that because I'm just so used to checking everything with the script editor now. :D
User avatar
ezra-r
Posts: 3423
Joined: Fri, 14. Oct 05, 21:04
x4

Post by ezra-r »

Thanks Laureati, so far Ive noticed more effective dodging or so it seems :) I just expectected the number in () like the trade levels and combat ranks thats why I was confused.
User avatar
Azz
Posts: 1031
Joined: Tue, 18. May 04, 20:14
x4

Post by Azz »

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

:D
Hello Laureati
I've installed your script with pilotAI, without any problem.
All seems to be OK
I did not go very far in my tests, but already I could not do without it any more...:D
It is a subtle but perceptible improvement of the scripts of egosoft, (which furthermore were bugged in some points)

Thanks :)
iou naud ouate, aille ama pis | Pilote IA | Site
aka1nas
Posts: 1414
Joined: Thu, 7. Jul 05, 05:17
x4

Post by aka1nas »

I've definitely noticed the Wasp missile usage. I tried to solo a Xenon sector with my Hyperion and I had a constant barrage of Wasps incoming. It was kind of sweet actually. :D
Xkaarj666
Posts: 192
Joined: Fri, 29. Jun 07, 15:06

Post by Xkaarj666 »

Awesome, with my pirate buster i could normally kill a small fleet of 5 M4 pirates. But not anymore, i get finally missiles fired at me. this time the split ships suck, no turrents, bad cargo space and bad shielding, they are still good ships.

I noticed when chasing down a falcon, that the falcon suddenly turned towards me, he had 50% hull, and started firering HEPT, nasty surprise, killed me. SWEET. :P Dont know if vanilla had this, but never seen this before.

Small ships arent going to do the trick, u need bigger ships now, or just an M3 instaed of a M4 :roll:
Laureati
Posts: 140
Joined: Sat, 20. May 06, 11:42
x3tc

Post by Laureati »

You can do well in an M4, it just takes a lot more work. Use the MDM instead of a rear turret, dodge frequently, and always restock after a battle. But yeah, overall an M3 would be the standard long haul fighter because of the better shields, rear turret and larger cargo space.

Glad you guys like the changes. :)
User avatar
X-Freak Cartman
Posts: 4017
Joined: Mon, 2. Oct 06, 15:08
x3

Post by X-Freak Cartman »

I'm glad there's real competition in the X-Universe now.
That's what FLAME, the Fleet Logistics and Management Extension, needs - intelligent enemies. It would be pretty boring if you've got a whole fleet of hundreds of fighters and more than ten BigShips, when every battle is won within a few seconds because the enemies are as smart as ... sheeps ^^

btw: how did you manage to let the fighters dodge?
Checking direction, attack target and laser energy every few seconds, like i do in the FCS MK3? Do you use tasks or the main task for that? ^^

btw²:
Imho, a combined script package of both our fight scripts would be possible as soon as at least one of them is finished... But imho the player has to decide whether to use one or both of them.
A package with Azz' AI would be too much of it, i think.
As long as all the scripts work fine together, there shouldn't be a problem ^^
Laureati wrote: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)
Not removing the .pck-file after the FCS MK3 has been installed, won't let your script run, but the FCS MK3 will still be used.

Just a note on the uninstallation:
If you're still using the FCS MK3 after removing the OCS, you have to use the FCS MK3-!fight.attack.object.pck, not the original one. If you don't, the FCS won't run after restarting.

btw: Do you restart the commands of ships, which are still using your OCS after uninstalling?
There shouldn't be a problem with NPCs as their scripts are controlled by the GOD-module, but the player has to restart every single fight ship after uninstalling, which is pretty annoying ^^
Mailo wrote: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.
I already know about this problem and I'm still working to fix it.


<EDIT>
Is your !fight.attack.object-script compatible with XTM 0.72?

There, the XTM team changed the script to work with the life forms in the game. You better should have a look at it, I'm releasing a new script to make the MK3-script compatible with this mod... again...
Trokhon
Posts: 189
Joined: Sun, 2. Mar 03, 18:59
x4

Post by Trokhon »

X-Freak Cartman [KBG] wrote:Is your !fight.attack.object-script compatible with XTM 0.72?

..
I am very interessted in this topic too. Since I use XTM and saw that your package offers an attack.object script file.
User avatar
X-Freak Cartman
Posts: 4017
Joined: Mon, 2. Oct 06, 15:08
x3

Post by X-Freak Cartman »

The XTM-attack.object just forbids ships to attack the natural life forms. Both our scripts allow to attack those life forms, that's all.

That's no real incompatibility... I'd have prefered a libscript by the XTM team that tells whether the object is a life form... that would have made everything a lot easier. As long as there's nothing like that, the FCS MK3 allows those attacks on life forms.

Afaik, Apollo doesn't have a XTM-attack.object-script, what's not that tragic.
Laureati
Posts: 140
Joined: Sat, 20. May 06, 11:42
x3tc

Post by Laureati »

Ohh, much questions to answer...
how did you manage to let the fighters dodge?
It's not as complex as the FCS3 version. The vanilla scripts already used as local variable called 'ACP.action' to determine if a ship was firing or not (not applicable to turrets). I simply took advantage of that and basically wrote a

Code: Select all

If I am ship's target
and ship is firing
take dodge action
As there's already a dodge move command available I used the default dodge. Suffice it to say the player won't find it too hard to shoot a dodging ship... but it is harder than before. Once I get the counter-attacking code done I'll release version 1.1 which will have slightly better dodging, making it even tougher.
Do you use tasks or the main task for that?
No extra tasks are added. I just tweaked some of the vanilla script calls.
Not removing the .pck-file after the FCS MK3 has been installed, won't let your script run, but the FCS MK3 will still be used.
Unless of course they use the default !fight.attack.object.pck in which case neither will work. Haha. But I believe the users would be savvy enough not to do that. :)
btw: Do you restart the commands of ships, which are still using your OCS after uninstalling?
Ohh. Very good point. There might be a limited switching delay. If OCS is installed on a saved game where combat is already in progress, then the vanilla scripts would be used. Once a the first target is killed and a new target is engaged, the OCS should activate. However if the ship is on, for example a patrol command then I'm not too sure. I'll have to check the script calls for that. Sooner or later the OCS scripts should take over - usually by the next engagement. It'd however be a good idea to restart patrols, just in case.
Is your !fight.attack.object-script compatible with XTM 0.72? ... the XTM team changed the script to work with the life forms in the game.
Oh, I didn't know that! I guess the OCS would work equally well as the FCS3 in XTM. In other words... DIE LIFEFORM SCUM!!!

I'll see about making a fully compatible version for XTM. Sigh... again... I know what you mean, Cartman.
OrionTaltos
Posts: 62
Joined: Mon, 26. Dec 05, 23:00
x4

Post by OrionTaltos »

Laureati wrote:Things to look out for: -

1. Staggered missile fire from enemy ships.
Check, less double shots.
2. More controlled missile fire from owned ships.
Check
3. More effective missile launches.
Check in the tailpipe :(. I have to love me some mosquito defense since it is not overshot dragonflies to deal with. Never know when a Silkworm will catch me when I slack up, lol.
4. Dodging incoming fire.
They're cheeky little buggers now. Sometimes that stray turret from an npc can be very annoying, lol. They'll get all evasive on me, naughty buggers.
5. Wasp missile tactics.
Not had a chance to see it either way yet (still small time, so I end up not being on either side of that... yet). Though I have seem them shove missiles down my throat in a head to head before jutting away.
5. Anti-capital ship tactics.
This is one I am really looking forward to seeing. Already seen more effective yaki attacks (merc guild missions) on stations.


This is just a fun script to help the overall level of combat. I want to get a good feel of this one (and the other handful I shoved in greedily, lol) before I add in FCS MK3 to the mix to help me out, hehe.

Even if it was just 'tweaks' it has refreshed my little Buster's combat fun. And watching a Yaki Mako Raider flip over on its tail to destroy an Argon Customs Buster was rather frightening. One good thing, I kill a lot less with collisions, haha. There is a lot less of the classic joust, they flee, turn about, we charge each other, rinse and repeat. It actually becomes more of an aerial (or lack of air-... ial.. ness) dogfight. Yaki are becoming more dangerous than Pirates now, those nimble little ships like to show off.

I have to salute and thank you for the combat AI upgrade. Added bonus, easier to capture now that I rarely can just stream fire at a target, ha!
/End Pleased Rambling
Laureati
Posts: 140
Joined: Sat, 20. May 06, 11:42
x3tc

Post by Laureati »

Quote:
5. Anti-capital ship tactics.

This is one I am really looking forward to seeing. Already seen more effective yaki attacks (merc guild missions) on stations.
It's the same code. Essentially it's an attack.large.object code.
It actually becomes more of an aerial (or lack of air-... ial.. ness) dogfight.
Hey, glad you noticed. My thinking was that X3 (or any space combat sim with fighters) would be fun taking it to a WWII dogfight scenario (the golden age of dogfighting IMO). I've even modded my own personal weapons mod to match WWII fighter weapon stats. Great fun. Think I'll release that as a mod/false patch at a later date.

Wow, can't tell you all what a relief it is that so many of you like the changes so far. It's been many hard hours of work, research, thinking, re-thinking, coding and testing. I'm glad it seems to have paid off.

Some critical feedback would be nice too though, because I'm always looking to update the AI. :)

I'm still working on a little more fine-tuning to the scripts. Hopefully the end result is more interesting dogfighting action.

I had already worked out a laser selection system for the OCS Apollo, however, due to how weapons spawn in the vanilla game the system was totally redundant for the NPC AI. If you're interested, I've released the system under the Apollyon Arms: Laser Weapon Switcher for player and player owned ship use. That'll be updated with a more advanced system soon too - look out for version 1.5.
I want to get a good feel of this one (and the other handful I shoved in greedily, lol) before I add in FCS MK3 to the mix to help me out, hehe.
That's a good idea. Since Cartman contacted me when I was in the early stages of modding the combat scripts I made note not to double up on things he already did. OCS Apollo and FCS MK3 will be (and hopefully will always be) complementary scripts, not competitors.

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

Post by Sandalpocalypse »

Long-overdue feedback:

I felt the wasp missile useage was a little overboard. The capital ships spammed em at me no matter what i was doing. Not only was it annoying but hundreds of wasps flying around has a definite performance impact. I am not sure what can be done about this without the annoyance of a split codebase tho.
Laureati
Posts: 140
Joined: Sat, 20. May 06, 11:42
x3tc

Post by Laureati »

Hmm... I might have fixed that in an unreleased version. I'll look into it when I have the chance. The code I did amend was for Fighters to fire wasp missiles in the special circumstance that they were in your 6 o'clock and no more than 1000m away. No other wasp missile code was written.

If you're willing to look into it, it's probably due to the missile timing situation. I've actually fixed that but I guess I didn't release it. I'll have to look at my changelogs. You can fix the missile timings yourself. It'll be in the first ocs.fight script after fight.attack.object - off hand I can't remember what it's called.

On a side note, why are capital ships using wasp missiles? I guess you're using some other mod as well.

Sorry about the lack of updates on my part. Been really bogged down with work.
Laureati
Posts: 140
Joined: Sat, 20. May 06, 11:42
x3tc

Post by Laureati »

Took a quick look at the version 1 files and I doubt the OCS Apollo is what's causing the capital ships to missile spam. In fact the anti-wasp missile spam code is there.

Sandalpocalypse, you wouldn't by any chance be using a mod with missile turrets would you? If so, that might be the problem. Also you've obviously got another mod that puts Wasp missiles into capital ships, because by default they don't usually spawn with them and if so only in very small numbers (less than 10).
aka1nas
Posts: 1414
Joined: Thu, 7. Jul 05, 05:17
x4

Post by aka1nas »

I also have Xenon cap ships spamming wasps. Maybe it's an Xtended issue?
User avatar
Sandalpocalypse
Posts: 4447
Joined: Tue, 2. Dec 03, 22:28
x4

Post by Sandalpocalypse »

It was months ago, heh. I dont have the save game for that pilot anymore. I believe it was a RRF Redux Beta 4 anti-xenon mission under Xtended. Just recently installed x3 again and noticed old screenshots i took of that fight. I'm reasonably certain I had no missile turrets installed.

If you didn't change anything with wrt to wasps and capital ships i wouldn't worry about it. It was not that they were spamming a lot at once, but they just. kept. shooting them. Ugh.

I will test the whole shebang again once i am tooling around in something tougher than a Mercury. Ahh, fresh starts. Piracy was faster I think, but at least i make more friends this way :)
Laureati
Posts: 140
Joined: Sat, 20. May 06, 11:42
x3tc

Post by Laureati »

Sandalpocalypse wrote:If you didn't change anything with wrt to wasps and capital ships i wouldn't worry about it. It was not that they were spamming a lot at once, but they just. kept. shooting them. Ugh.
Okay that makes things clearer. I actually fixed spamming issues with the OCS Apollo. If they just keep firing them then ... well ... .

FYI OCS Apollo does NOT change CAPITAL SHIP behaviour ONLY FIGHTER behaviour. Capital ships use different files for combat by and large, the exception being M6/M7 class ships. If I recall correctly the only file shared by fighters and capital ships is the initail !fight.attack.object - thereafter fighters are assigned to one set of scripts (i.e. OCS scripts) and I think capital ships carry on using the default !fight.attack.object with additional scripts for turrets.

This is how it ran by default, not by OCS Apollo design.

But thanks for the heads up guys. Appreciate it.
User avatar
Sandalpocalypse
Posts: 4447
Joined: Tue, 2. Dec 03, 22:28
x4

Post by Sandalpocalypse »

Well...

It's been a while and I've done a bit of fighting over that time. I'm reasonably impressed by the AI, especially the missile shoot downs and dodging. Some pilots are really, uh, spinny about it though. :)

Ships still seemed to have a hard time attacking large objects with short range weapons though :[

One criticism I would make about the missile shootdowns, they are pretty much perfect every time. I think it would add to the feel if they were a bit more spray n pray... perhaps less so at really high fight-skills.

I packaged it into my XTM patch spk, that seems to work alright. Supposedly not using the xtm fight script has some effect with the dragons and rock beetles but I dunno, they don't seem any different. *shrug*
Laureati
Posts: 140
Joined: Sat, 20. May 06, 11:42
x3tc

Post by Laureati »

Sandalpocalypse wrote:Well...
Ships still seemed to have a hard time attacking large objects with short range weapons though :[

One criticism I would make about the missile shootdowns, they are pretty much perfect every time. I think it would add to the feel if they were a bit more spray n pray... perhaps less so at really high fight-skills.

I packaged it into my XTM patch spk, that seems to work alright. Supposedly not using the xtm fight script has some effect with the dragons and rock beetles but I dunno, they don't seem any different. *shrug*
1. Short-ranged weapons (e.g. PSGs, Alpha IREs, Mass Drivers) will always have a problem attacking a capital ship. There's nothing I can do about that because of the anti-collision protocals. Main aim was so HEPT equipped fighters didn't just fly around the target without attacking.

2. Actually the fighters do shoot down missiles as per their fight-skill. Unfortunately the way the game engine works is that all AI shots are pretty much 100% accurate (for objects with no lateral movement)everytime it shoots. Fight skill merely determines how often the AI shoots, how long it takes to react, and special manuevers. Unless someone makes "reflex missiles" like the ones in Robotech, that can dodge attacks or you use a mod that makes the missiles much faster (they're waaaaay too slow in my opinion) I'm afraid there's nothing I can do about this - short of writting a script at simulates the "spray and pray".

Missiles are best used close-in as a 'kill' shot anyway. Give the AI less time to react to it. Either that or use the missiles as a distraction. Frankly I think WASPS are the only missiles in the game that are balanced.

3. As I recall, the only issue with XTM and the 'space creatures' is that in the default XTM files the creatures are not recognised by your targeting system (non-targetable objects). Any fight mods used would turn them into targetable objects. Otherwise there's no other effect.

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