Introduction in AI programming

I want my 15 rapid-fire quantum torpedo launchers Uber-Defiant now! - Get help from modders. Share your work. Discuss modifications.
1, 2
posted on June 22nd, 2011, 6:48 am
Hello folks,

I like to improve the AI... so I read the very good written tutorials on Artificial Intelligence - The Hitchhiker's Guide to Fleet Operations and Miscellaneous Configuration Elements - The Hitchhiker's Guide to Fleet Operations . The way to "create" the AI are build-lists... are there further possibilities to improve the AI in a deeper way? So I like to make the AI more dynamic, by using programming technics (if clause, to loop). Is there possibility, to query data of the human player? Perhaps the things, which he is building... so the AI can react on this?

Is deeper coding possible?
posted on June 22nd, 2011, 7:05 am
Check this out. It's a guide written by the best AI coder that the A2 community has. You'll probably be interested in the personality files in particular.
posted on June 22nd, 2011, 8:46 am
Yep, thats a good beginners guide for AI development.

Sadly, what you are attempting to do is not possible at the moment. The AI consists of 5 subsystems, with goal evaluation, goal execution and the buildlists being the most important ones for the thing you want to achieve. Sadly, only the build list is 'programmable', you can only influence the rest of the system by setting parameters. The buildlist, however, is just what its name suggests: A plain, linear list.

The Armada AI is therefore not suited for FO gameplay (as it was never built for it), as you cant efficiently react on the complex gameplay elements (like passives, rush strategies and the like). We are working on this front and i think we will get something out sooner or later ^-^
posted on June 22nd, 2011, 8:50 am
Last edited by Nerd0001 on June 22nd, 2011, 9:30 am, edited 1 time in total.
Thx for your help, cabal.  :) It is very interesting to see how the AI works... The parameters in ODF files influence how the AI evaluates and compares battleships. Then, you can define some personality behavior underlined with different build lists...

Hmm... I saw some interesting thoughts by Freyr:

Freyr's thoughts : Personality Parameters - Starbase 34 Tutorials

He said, that you can use a AI debugging tool:


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.


Pressing ALT - SHIFT doesn't work  :( . Do you know, how I can manually define the behavior in column "Probable cause"? Where do I find the flag "enemy discovered" in AI files? There must be something like.... Enemy find -> set enemy discovered = 1 (TRUE) or something else...

For example, do you know when the AI starts an offensive? Which parameters are important for that? Where can I find the "real" AI... not building lists  :pinch:

EDIT: Sad to hear this, Optec... no ideas? A plain AI seems to be boring... not only for players... also for developers  ^-^
posted on June 22nd, 2011, 9:37 am
Nerd0001 wrote:Pressing ALT - SHIFT doesn't work  :( .


Did you press ALT-SHIFT or ALT-SHIFT-A?
posted on June 22nd, 2011, 9:41 am
Blazing wrote:Did you press ALT-SHIFT or ALT-SHIFT-A?


Well ALT-SHIFT without freaking A ... Ahhh... so it's early in the morning... should be not my day  :crybaby:
posted on June 22nd, 2011, 12:59 pm
Yup, that's in the Hitchhiker's Guide as well  ^-^

I rewrote/experimented with existing modding guides based on the behavior in FO, and since I can't replicate Freyr's findings on what he observes in the debugger, the explanations are not used or modified in the FO guide.

When the time to rewrite the AI arrives, Optec will probably swam out the current system entirely, as it just is too static :) . The priority for Fleet Ops at the moment is multiplayer gameplay, and swapping out the AI is quite difficult, so this process will take awhile  :sweatdrop:
posted on June 22nd, 2011, 1:37 pm
Dominus_Noctis wrote:Yup, that's in the Hitchhiker's Guide as well  ^-^

I rewrote/experimented with existing modding guides based on the behavior in FO, and since I can't replicate Freyr's findings on what he observes in the debugger, the explanations are not used or modified in the FO guide.

When the time to rewrite the AI arrives, Optec will probably swam out the current system entirely, as it just is too static :) . The priority for Fleet Ops at the moment is multiplayer gameplay, and swapping out the AI is quite difficult, so this process will take awhile  :sweatdrop:


Thx for your comment... do you know, if Freyr is still active?
posted on June 22nd, 2011, 1:40 pm
He's an admin of Armada II files, and occasionally shows up on MSFC as well :) . He's semi-active, but as far as I know does not really mod for A2 anymore.
posted on June 22nd, 2011, 1:44 pm
Dominus_Noctis wrote:He's an admin of Armada II files, and occasionally shows up on MSFC as well :) . He's semi-active, but as far as I know does not really mod for A2 anymore.


Oh, what is MSFC?
posted on June 22nd, 2011, 1:48 pm
A Sci-fi and gaming forum, helpful place. MSFC.
posted on June 23rd, 2011, 10:33 am
Last edited by Nerd0001 on June 23rd, 2011, 10:35 am, edited 1 time in total.
Today I looked up the AI folders in my FleetOps directory. In Star Trek Armada II Fleet OperationsDataAI I found the file strategic_AI_config.txt. Mad Doc said, this file "contains configuration data for the strategic maps" hmmm... what meaning has the following code?




///////////////////////////////////////////////////////////////////////////////
//
// strategic_AI_config.txt
//
// This files contains configuration data for the strategic maps
//
// Threat Map.................Where are the enemy units?
// Empire Map.................How far are we from home?
// Enemy Empire Map...........How far are we from the bad guys?
//
//
// By the Mad Dr. I
//
///////////////////////////////////////////////////////////////////////////////

// How many tiles per threat mapgrid?
#define threat_map_resolution 800

// How many tiles per death mapgrid?
#define death_map_resolution 800

// How many tiles per our empire mapgrid?
#define empire_map_resolution 800

// How many tiles per enemy empire mapgrid?
#define enemy_empire_map_resolution 800

// How many tiles per exploration cell?
#define exploration_map_resolution 800

// How many tiles per goal cell?
#define goal_map_resolution 800

// Fraction of bleedover during threat relax
double relaxation_coefficient = 0.8;

// Number of threat relax cycles. This becomes how far away a threat is felt.
int relaxation_cycles = 2;


Does the 800 mean a grid area around the "first contact" with the enemy? What is 800 exactly?

And what is the double relaxation_coefficient = 0.8; or the int relaxation_cycles = 2 ? What is the meaning of 0.8 or 2? Can anybody help me?
posted on June 23rd, 2011, 1:41 pm
Threat map I believe is a map of the enemy units, with the map being the center of the unit and how far out its threat 'field' extends. Thus 800 is probably the area of that map.

I'm not sure by any means, but I assume the relaxation coefficient is how much the threat map is reduced  (the original value of the threat multiplied by the value there) when the AI calculates how big a threat it is from the other variables.

Likewise, cycles probably refers to how many 'downgrades' of threat occur per distance.

All of this stuff is much better understood by Optec, but it won't really help you to build a better AI I fear  :blush:
posted on June 24th, 2011, 1:36 pm
Nerd0001 wrote:Pressing ALT - SHIFT doesn't work  :( . Do you know, how I can manually define the behavior in column "Probable cause"? Where do I find the flag "enemy discovered" in AI files? There must be something like.... Enemy find -> set enemy discovered = 1 (TRUE) or something else...

For example, do you know when the AI starts an offensive? Which parameters are important for that? Where can I find the "real" AI... not building lists  :pinch:



probable cause is just a comment by freyr to show you how this was triggered. You can't program the AI, you can only give it data structures to work on (buildlist, personality parameters).

The "real" AI is hardcoded, and therefore can't be modified by any ordinary means.
posted on June 24th, 2011, 3:03 pm
Terra_Inc wrote:probable cause is just a comment by freyr to show you how this was triggered. You can't program the AI, you can only give it data structures to work on (buildlist, personality parameters).

The "real" AI is hardcoded, and therefore can't be modified by any ordinary means.


Last days I changed some build lists to improve the AI. I realized, that there is no alternative, to improve the AI... only build-lists.  :( But, I think there are some possibilities ... do you know, where I can find all the unit names in a short list?

For example, the build list excepts:

"kli_chorZ", 1,0, -1,  1,
"kli_field_yardZ", 2,0, -1,  0,

So kli_chorZ is only one unit/name... I have to get all unit-names of all races!  :sweatdrop: Otherwise I have to comb through the ODF files....  :unsure:
1, 2
Reply

Who is online

Users browsing this forum: No registered users and 1 guest

cron