AI Behavior

Want to edit the game, build your own craft and missions? Here you'll find help, tools, guides and people to discuss with.
Post Reply

AI Behavior

User avatar
Phoenix Leader
Rebel Alliance
Posts: 437
Joined: Wed Aug 08, 2018 2:20 pm

Post by Phoenix Leader » Wed Aug 15, 2018 8:41 am

I dedicate this topic to an aspect of the game I've always found intriguing and probably never discussed enough in the past: AI Behavior.
AI controlled crafts behave differently in mission depending on AI level, weaponry loaded, and of course orders.
These are the only info found on the forum about AI Behavior:
1) Fire ratio multipliers depending on AI level posted by JeremyaFr (link: http://xwaupgrade.com/phpBB3/viewtopic.php?f=9&t=11936)
2) Energy configurations and energy transferring used in mission depending on AI level and shield charge level posted by Mark Farlander
(link: http://xwaupgrade.com/phpBB3/viewtopic. ... 7&start=32)

User avatar
Phoenix Leader
Rebel Alliance
Posts: 437
Joined: Wed Aug 08, 2018 2:20 pm

Post by Phoenix Leader » Wed Aug 15, 2018 8:57 am

Those ones are great findings, now I'm curious to understand when an AI controlled craft can avoid objects and when the collision will occur.
As far as I noticed, every fighter performing an "Attacking target" order with an AI level equal or higher than Ace is able to avoid objects, whereas a craft with a starship order "Flying flight plan" will travel to the next waypoint available without paying attention at whatever objects are obstructing the flight plan.
As for Ace AI fighters performing the "Flying home" order, it seems they are instructed to avoid all objects except for their command ship, so they will sometimes collide.

Does anybody have more detailed info on AI Behavior?
And is there a way to modify it?

User avatar
Epsilon Eridani
Cadet 3rd Class
Posts: 48
Joined: Sun Jul 08, 2018 6:57 am

Post by Epsilon Eridani » Wed Aug 15, 2018 4:59 pm

When performing a bombing run with proton torpedoes vs a capital ship or station, each AI controlled fighter shoots 6 torpedoes, if available, even when more are needed to destroy the target.

Justagai
Cadet 1st Class
Posts: 218
Joined: Mon Dec 08, 2014 10:59 pm

Post by Justagai » Sat Aug 18, 2018 9:44 pm

Bombing Run:

- Max 6 torpedoes per pass
- 6km distance from target in order to lock on
- Lock time is dependent on AI rank
- Only Missiles and Advanced missiles are not eligible as warheads against freighters/starships/containers, etc

Some of the AI is similar to the original X-wing. XWA has made changes to the AI since then of course. The AI behavior itself is hardcoded but can be influenced by mission orders. There is a document that outlines the AI behavior in X-wing that you could use a base, but it may not be too useful for XWA.

Defiant
Fleet Admiral (Administrator)
Posts: 1699
Joined: Fri Aug 04, 2000 11:01 pm

Post by Defiant » Sun Aug 19, 2018 4:20 am

Been a long time so I'm just recalling off the top of my head. I seem to remember the AI state machine was scripted in paiplan.pln (this may only be on the disc). It would get turned into bytecode in paiplan.plo. States are called "manners" and transitions "orders".

User avatar
Phoenix Leader
Rebel Alliance
Posts: 437
Joined: Wed Aug 08, 2018 2:20 pm

Post by Phoenix Leader » Thu Aug 30, 2018 8:45 am

Just checked my GOG installation: PAIPLAN.PLN and PAIPLAN.PLO are in the Star Wars – X-Wing Alliance main directory.
These files are dated 01/22/2018 since I have the v18061 released on 24 January 2018, the one compatible with XWACP v1.5 and DSUCP v2.5.
As far as I know, XWACP v1.5 and DSUCP v2.5 don’t replace PAIPLAN.PLN and PAIPLAN.PLO.

PAIPLAN.PLN can be easily opened with notepad. These are the sections I found in PAIPLAN.PLN:
1) Basic escort mission escorting another flight group (subsections: Leader of Escorters, Wingman of Escorting)
2) Inspection plans
3) Player directed orders that override what otherwise the craft is doing
4) AI for Mines (homing and proximity)
5) AI for craft to fly abd park at a parking point on station

User avatar
Phoenix Leader
Rebel Alliance
Posts: 437
Joined: Wed Aug 08, 2018 2:20 pm

Post by Phoenix Leader » Thu Aug 30, 2018 9:16 am

I was wondering if the temporary no collision mod enabled during a docking operation is somewhere scripted in section 5 of PAIPLAN.PLN

Post Reply