Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: Zarax on December 31, 2021, 05:42:34 am

Title: AI class behavior location
Post by: Zarax on December 31, 2021, 05:42:34 am
Hello everyone and happy 2022 for those who will read it in the new year!
Is AI action behaviour hardcoded or is there a table file for it?

For example, is there any place where I can find the actions available to a destroyer VS a fighter?

Thanks!
Title: Re: AI class behavior location
Post by: 0rph3u5 on December 31, 2021, 09:54:11 am
AI behavior is subject to a number of tables:

- ai_profiles.tbl - https://wiki.hard-light.net/index.php/Ai_profiles.tbl
... which contains global AI settings which can be set on a per-mission basis.

- ai.tbl - https://wiki.hard-light.net/index.php/Ai.tbl
... which creates the AI classes you can set a ship to in FRED. It can also set class specific overrides for flags set in AI_profiles.tbl.

- objecttypes.tbl - https://wiki.hard-light.net/index.php/Objecttypes.tbl#.24AI:
... sets basic rules for the AI to be used with the object type flag (e.g. "cruiser" ) which a ship has. Among other things, if a ship will maneuver to broadside.

- game_settings.tbl - https://wiki.hard-light.net/index.php/Game_settings.tbl#.24AI_use_framerate_independent_turning:
... under "#OTHER SETTINGS" has as one or two settings which can impact AI behavior, but unlike the previous tables doesn't set rules per se.
Title: Re: AI class behavior location
Post by: Zarax on December 31, 2021, 10:06:57 am
Thank you for the info.
Interesting, I seem to have only AI.tbl, guess it's time to update my FSO...
Title: Re: AI class behavior location
Post by: Asteroth on December 31, 2021, 12:11:43 pm
Many of those tables are optional, so it's no surprise.
Title: Re: AI class behavior location
Post by: EatThePath on December 31, 2021, 04:31:14 pm
To elaborate, FSO versions don't come with any tables at all. The values that those tables would set have internal defaults that generally maintain the retail behavior, and a mod can add the tables to change them.
Title: Re: AI class behavior location
Post by: Zarax on January 01, 2022, 01:14:52 am
Is there any place where I can get the table files? I extracted the usual ones (weapons and ships) from the MediaVP files.
Title: Re: AI class behavior location
Post by: Asteroth on January 01, 2022, 02:14:54 pm
I'm pretty sure the MVPs comes with it's own versions of most of those, except perhaps game_settings.tbl, but you can find the default in-built version of that one on the wiki in its entirety. Note that you don't need any of these unless you plan on making changes to one or more of the settings in them, FYI.
Title: Re: AI class behavior location
Post by: Zarax on January 07, 2022, 02:13:58 am
Thank you, in the end I just pasted from the wiki and it works fine.
Is there any way to increase the default number of orders in FRED from 5 to the 9-10 the interface is set up to accept?
Title: Re: AI class behavior location
Post by: Asteroth on January 07, 2022, 02:26:25 pm
I don't think so, I'm not sure why the interface shows 10 honestly, I believe those are reserved for 'dynamic' goals, like reacting to attackers and such, and can't be manually given, or something like that.