Freyr's thoughts : Personality Parameters

To get the AI to turn up with a fleet, and otherwise behave with some semblance of sanity requires some tweaking to some very important values that i'm calling the "personality parameters".

You have probably peeked into the AI/AIP folder at some point and seen there are files like "a2_aggressive.aip", and "a2_hard_aggressive.aip".  These files control how the AI operates on a strategic level.  Put simply, the defaults are... not optimal.  Over the years people (including myself) have independently discovered that you can add personality parameters to the start of the build list and this has been done to attempt to get the AI to play more reasonably.

You should not do this under any circumstances whatsoever.

Upon further investigation, it turns out that the AI uses a separate personalities and build lists.  By literally forcing the AI to use only a single set of personality parameters for everything your significantly hampering it.

The build list should only contain a list of things to build. It should remain clear of any other parameters.

The other parameters should be drawn from another file, which only contains those parameters. For want of a better name I'm calling these the personality parameters.  As an interesting note although all of the files relating to the AI carry the extension AIP, I do wonder if they are AIP's as the term was intended to mean.

I think the mad Dr. I (Dr. Ian Davis, the head AI programmer for Mad Doc) should be considered the expert, and reading some of his comments and observing his coding style is interesting.


a2_borg04_defensive.aip has the following comments:-
///////////////////////////////////////////////////////////////////////////////
//
// defensive.aip
//
// AIP = Artificial Intelligence Personality
//
// Basic defensive AIP parameters.  Protect the base, don seek trouble, etc.
//
// By Dr. Ian Lane Davis
//
///////////////////////////////////////////////////////////////////////////////

In a2_agressive.aip this note is prominently plastered across the top of the screen:-

// A basic aggressive aip for Armada 2 (any race).  You need a build list!
//
// Dr. I

Now, going back to the mad doc's other little bit of work in "a2_borg04_defensive.aip" the build list at the bottom is very clearly separated out from the parameters at the top as follows:-

///////////////////////////////////////////////////////////////////////////////
// the_build_list

All of Dr. Davis's work was done in the same way.  Thus, I'm thinking that the term Artificial Intelligence Personality as Dr Davis considered it was probably only intended to be applied to the file containing the parameters defining the personality rather than the build list as well.  However, if this was the case then he confused his team just as badly as us judging by the other interpretations used throughout the files, and even if this interpretation is correct then I suspect persuading everybody that only half the .AIP files should be called AIP's is going to be a fruitless struggle.  It's easier to refer to the ones with the Build list as the "Build list" and the personality files as the "personality" or "personality parameters".

Anyway, i'm starting to get a bit off topic.

Its long been known the skirmish AI picks different build lists, for which reason many people working on skirmish AIP's have simply saved the same build list in each different file.  It's turned out that we shouldn't have done that either.  It's certainly a practice that should end with this discovery.  This is the result monitoring a hard skirmish AIP with the AI debugging tool:-

Elapsed time         Cycle                Personality                Build List              Probable cause                                                                
0S (0.00)              0                      hard_agressive          offensive list        Start                                                                               
48S (0.48)            2802                 hard_exploration        instant_action      enemy discovered                                                            
154 (2.34)            9112                 hard_agressive           offensive list        either enemy base discovered or starting scout lost?         
2505S (41:45)      133779              very_agressive            endgame              all enemy resource collection destroyed                            

For future reference: The AI debugging tools can be activated by pressing ALT - SHIFT - A simultaneously.  Other debugging tools are available; see "debug" under "input.map" in the root directory.

As you can see, the AI started off with the hard_aggressive personality, and the offensive build list.  Upon the scout first discovering the enemy scout it switched to hard_exploration and instant_action, and it remained on that personality and build list until it's starting scout discovered the enemy base.  A little more investigation could be done with on this point, because the scout discovered the enemy starbase and was blown up by it within a second and it's therefore difficult to say if the cause of it moving back to hard_aggressive and the offensive build list was discovering the enemy base, or losing it's starting scout.

My feeling is that it was discovering the enemy base.  You can then see the AI then spent the next 40 minutes going for resource operations outside the main base and parrying against attack attempts against it's base.  Interestingly, when every structure outside the main base was destroyed the AI switched to the very_aggressive personality and the endgame build list.

This in itself is probably the single greatest advance in AI's since With this knowledge you can make a significantly better AI.  The moment the build list changed for the final assault I was thinking that it would be nice to set the AI up with heavy assault ships and artillery to dig out the last, heavily fortified base.

The defensive AIP appears to be used when the AI is on it's last legs.  The AI that was on the receiving end of the AI in the game above went to it's defensive lists when everything outside it's main base had been destroyed.  This is only a theory, but I would assume that the AI divides the map up into sectors defined in /AI/"strategic_AI_config.txt".  When the AI beaten back into it's last sector it switches to the defensive, and the reverse is also true.  When the AI beats an opponent into it's last sector it switches to endgame. 

It's only a guess, but it's a good one.

It might in future be possible to achieve AI's that "think" better than my current iterations by playing with the size of the sectors the AI uses in the AI config text file, but I don't really have the time to play with it.  Hopefully someone will pick up where i've left off.

My most advanced (hard) personality files can be downloaded here. Feel free to use them and or improve on them, just say that you did somewhere in your readme.  Even the stock AI plays noticibly better with this personality so I am quite looking forward to seeing what a future generation of modders will be able to achieve with much tinkering and rewriting of build lists.
Comments