Testing AAI - Page 2

Testing AAI

Here is where ideas can be collected for the skirmish AI in development

Moderators: hoijui, Moderators

User avatar
jcnossen
Former Engine Dev
Posts: 2440
Joined: 05 Jun 2005, 19:13

Post by jcnossen »

You can pick a bunch points on the heightmap and pathfind between them, so you can see if they are reachable by land or by see... With that you can globally determine which landmass is connected to which other landmass, and if your startpos connects to more than 5 landmasses or something, you will build some non-sea defense as well.
User avatar
Imperator
Posts: 85
Joined: 13 Oct 2005, 00:04

Post by Imperator »

great progress you are making there. keep it up, your AI is real nice to play against already make it even more evil and strong!
a question: does the AI build mexxes outside its boundaries of base yet? ever seen the AI do that. sometimes also it wont do anything in the start (upper left corner of comet catcher , core prime metal map) or just one solar and then nothing else. sharing units with your AI is also a fun way to play , you provide the basemanagement and the AI attacks and scouts for you ;).
submarine
AI Developer
Posts: 834
Joined: 31 Jan 2005, 20:04

Post by submarine »

aai does build mexes outside its base within a certain range. yet it doesnt build mexes if they are too far away. i'll probably change that in the future but at the moment it would probably cause the ai to get its builders getting killed while sending them all around the map
User avatar
Kuroneko
Posts: 483
Joined: 03 Jan 2005, 05:32

Post by Kuroneko »

submarine wrote:aai does build mexes outside its base within a certain range. yet it doesnt build mexes if they are too far away. i'll probably change that in the future but at the moment it would probably cause the ai to get its builders getting killed while sending them all around the map
You'd need to impliment a threat map. So that the builders know where it is safe enough to travel to alone. By the same token, it can be used to know where to attack with more or less troops.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

If I'm not mistaken, thats how ti works already, at least with attacking.
User avatar
Kuroneko
Posts: 483
Joined: 03 Jan 2005, 05:32

Post by Kuroneko »

Alantai Firestar wrote:If I'm not mistaken, thats how ti works already, at least with attacking.
In my expierence, AAI becomes fixated with a location and continues to resupply the troops there until they find another more fun area to become fixated on.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

So did NTAI and OTAI, and the simple solution was to scout. Or to add a threshold level, for example in NTAI the threat level would keep getting smaller and smaller as in AAI btu enver reach zero, so I made it check if ti was below 10 and if it was then it'd ignore it, thus the units became idle and no more re-inforcements where sent.

Since submarine has not released any source code at all save for the very first release, I cant comment on wether he's added this improvement yet.
submarine
AI Developer
Posts: 834
Joined: 31 Jan 2005, 20:04

Post by submarine »

i reworked the scout system completely and this kind of behaviour should be avoided now
User avatar
Imperator
Posts: 85
Joined: 13 Oct 2005, 00:04

Post by Imperator »

maybe split the main force to the 3 biggest threat locations? in most battles the largest threat is not the only threat and then the units have to wander across the whole map to get there or they just stay at that place and keep resuplying that location until there are too many units. it should send armies around scouting too if it has too many units. the normal scouts dont discover much they die way too fast.
submarine
AI Developer
Posts: 834
Joined: 31 Jan 2005, 20:04

Post by submarine »

i found a bug in the buildmap:

aai crashes if a factory thats close to the border of the map is destroyed.

i'll probably redo building placement for the next aai version...
Chocapic
Posts: 556
Joined: 16 Oct 2005, 03:35

Post by Chocapic »

I dont really know if i have the latest version of aai, but i get this error quite often

Code: Select all

ERROR: UpdateSectorThreat() invalid UnitDef of attacker 4683
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

That's a consequence of the spring engine giving the AI misinformation and AAI filtering it out.
submarine
AI Developer
Posts: 834
Joined: 31 Jan 2005, 20:04

Post by submarine »

yres alantai is right; aai tries to update threat maps whenever buildings get killed; sometimes the spring engine seems to provide aai with an unit id of the attacker but aai cannot retrieve a correct unit definition
Chocapic
Posts: 556
Joined: 16 Oct 2005, 03:35

Post by Chocapic »

why ? have you posted this bug ? its hell important for ai's development..
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

I have been screaming about engine inconsistencies for ages. But by now every single major skirmish AI ahs a check for these thgins at as many function calls as possible. Just look at NTAI 0.28 source, at the sheer nubmer of validity checks it makes on unit ID's and untidefinitions.

The vast majority of bugs in our skirmish AI's over the last few months have been caused by the AI tryignt oa ccess the untiDefinition fo an invalid unti ID or handling invalid data passed on by the engine. It's a symptom of the chronic mess the core of spring ahs become, and should be fixed when jouninkomiko is finished rewritting the core and the GUI code.
User avatar
Veylon
AI Developer
Posts: 174
Joined: 21 Sep 2005, 19:45

Post by Veylon »

I haven't had alll that many validity checks to do on data directly from the Engine, just that one where UnitDestroyed gives a unit of -1 for the attack (can't see it or doesn't exist). Most of mine are for those UnitInfo arrays I keep on all the units in the game, so my AI can know what units the enemy has, even if it can't see them.

BTW, OTAI doesn't use a threat map. It probabaly should, but it doesn't, just yet. It picks targets for the attack teams based on individual enemy units, whatever's closest.
Chocapic
Posts: 556
Joined: 16 Oct 2005, 03:35

Post by Chocapic »

well no one can do a quite nice ai if these kind of bugs arent solved out.
But are u sure its not just aai doing something that it shouldnt ?
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

AAI is not alone, it happens under all skirmish AI's its just we handle ti differently. AAI handles it by outputting an error emssage and apending the invalid unitID on the end as shown above.

These sorts of prblems arent the biggest problem though, it's things sucha s sometimes the engien crashes when we try to do a command soemtimes, or the fact we cant do thgins the player can, such as use repeat orders ro change trajectory/firing state/move state or tell if a corpse can be resurrected or not.

Next version of NTAI will come in two versions because of this, one with the unit idle behaviours and one without.
Targon
Posts: 99
Joined: 16 Dec 2005, 05:15

Post by Targon »

As the readme says, when a Mod updated we rename the cfg files.

Should we also rename the learn files so that it doesn't start over with crap choices?
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

The learn files take the form

modname.dat or somethign similair. A new mod would mean a new filename and AAI would find no existing cache so it would create a new oen and it'd be a blank slate.
Post Reply

Return to “AI”