AAI v0.90 in SVN / latest Spring release

AAI v0.90 in SVN / latest Spring release

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

Moderators: hoijui, Moderators

submarine
AI Developer
Posts: 834
Joined: 31 Jan 2005, 20:04

AAI v0.90 in SVN / latest Spring release

Post by submarine »

Together with the Spring 0.79 I released a new AAI version. The source code has been committed to git by hoijui, binaries are inlcuded in the latest installer.

Here's the changelog:

- Completly redone scouting algorithm

- Enemy units on radar are taken into account now as well

- AAI will delay non-combat-critial buildtasks & upgrading of buildings when under pressure

- Redesigned the way attacks are launched. AAI should play more aggressively now, attack poorly defended areas more often and better coordinate attacks on maps with more than one landmass (e.g. island maps)

- Improved the factory/builder selection algorithm

- Improved construction and placement of radar towers

- Fixed a bug that crashed the game when a mobile factory (= construction unit that may buil other units) was killed on its way to the buildsite
Super Mario
Posts: 823
Joined: 21 Oct 2008, 02:54

Re: AAI v0.90 in SVN / latest Spring release

Post by Super Mario »

What mods that are known to worked perfectly? (It crashes when I use the latest BA mod and this AI in the spring tester.)
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: AAI v0.90 in SVN / latest Spring release

Post by hoijui »

post infolog.txt on pastebin.com, post link here.
i know of an AAI bug on windows when playing wiht more then one AI, but so far was not able to debug it cuase of the builbot having a problem.. bibim fixed it so tomorow.. i shall hunt it.
R-TEAM
Posts: 177
Joined: 22 Jan 2009, 19:25

Re: AAI v0.90 in SVN / latest Spring release

Post by R-TEAM »

Hi,

have AAI still not running - with no mod i tested its running...
All time spring crashes.(BA/CA/NOTA/XTA)
Have changed the cfg files and the AAI is happy with it - but after
initilizing spring CTD.
The other AIs (RAI/KAI runs fawless - but AAI play nicer partialy..)

Regards
R-TEAM
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: AAI v0.90 in SVN / latest Spring release

Post by hoijui »

it is going to be worked on, but in general, you should paste the infolog.txt of a crash to pastebin.com and include the link to it in your post.
for the future, you do not have to do it for this, as AI stack traces of the release can not be used because of some special problem.. nm
i will report back here if i have news.
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: AAI v0.90 in SVN / latest Spring release

Post by hoijui »

even doh the fix i mentioned, there is still an other problem that prevents me from hunting the error (it would be possible, but with much more work and pain -> no mood for that).
maybe submarine can debug it in VSStudio, maybe its easier there.

for anyone hunting for it:
for me the bug appears on windows only, and only if i add an other bot (eg RAI) and AAI, not if i play wiht AAI alone.
so a test game: me, AAI, RAI -> crash in the first few frames (less then 100).
good luck!
submarine
AI Developer
Posts: 834
Joined: 31 Jan 2005, 20:04

Re: AAI v0.90 in SVN / latest Spring release

Post by submarine »

I tried to compile AAI for the new spring version. Since there are so many changes regarding paths, etc. compared to spring 0.78 I decided to set up a fresh project file.

I added all the cpp/h files from /AI/Wrappers/LegacyCpp/ and some additional files (DamageArray.cpp, GameVersion.cpp and float3.cpp) from /rts/system, /rts/game, etc. to get rid of various linker errors.

However there is one left, which cpp file do I have to add to the project to fix it?

Code: Select all

Creating library E:\Spiele\Spring\AI\Skirmish\AAI\0.9\SkirmishAI.lib and object E:\Spiele\Spring\AI\Skirmish\AAI\0.9\SkirmishAI.exp
1>AIExport.obj : error LNK2001: unresolved external symbol _util_allocStrCpy
Kloot
Spring Developer
Posts: 1867
Joined: 08 Oct 2006, 16:58

Re: AAI v0.90 in SVN / latest Spring release

Post by Kloot »

AI/Wrappers/CUtils/Util.c
User avatar
Umrug
Posts: 141
Joined: 27 Nov 2006, 12:57

Re: AAI v0.90 in SVN / latest Spring release

Post by Umrug »

Hi!

As of 0.79.1.2 AAI is still not working (with BA 6.95) - crashing at several first frames.

AAI MAEK US CRY

Just, err, dunno how to say this, it would be sooooo cool if someone (someone being submarine) could fix it! Yay! Especially with the new features in described in the beginning of the topic.

Thanks...
Societal
Posts: 64
Joined: 05 May 2009, 13:57

Re: AAI v0.90 in SVN / latest Spring release

Post by Societal »

Now I really wish I had saved it because I had a build earlier this month that AAI worked in. I managed to play through a short 1vs1 on Sunken Outpost in BA6.9?. It didn't put up much of a fight but at least it didn't crash. Instead of building a base I walked my commander around until I found his base and started DGunning and capturing units. AAI did do a good job of spreading out though because it took a long time to track down and exterminate all the other little bases it built.
imbaczek
Posts: 3629
Joined: 22 Aug 2006, 16:19

Re: AAI v0.90 in SVN / latest Spring release

Post by imbaczek »

maybe try merging this in?
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: AAI v0.90 in SVN / latest Spring release

Post by hoijui »

the fixes of this are already merged in, and the two (bernds and submarine) have settled with discussing and devving on AAI together for a bit.. submarine was not happy wiht some of the changes, thats why they are not merged in.
submarine
AI Developer
Posts: 834
Joined: 31 Jan 2005, 20:04

Re: AAI v0.90 in SVN / latest Spring release

Post by submarine »

hoijui wrote: submarine was not happy wiht some of the changes, thats why they are not merged in.
Thats not true, infact I just could not test it since I have not suceeded to run a game with a self compiled AAI so far (with spirng 0.79). After spending hours trying all kind of things (and nothing worked - sometimes spring just crashed when loading the ai, sometimes i couldnt even build a binary due to loads of linker errors, missing/outdated libs etc.)

In the end I got frustrated and stopped trying - maybe I should give it another try....

If there are crash-bugs in the official source and there is a fix for it, merge them in!
Societal
Posts: 64
Joined: 05 May 2009, 13:57

Re: AAI v0.90 in SVN / latest Spring release

Post by Societal »

AAI is working again now. I was able to play through a long drawn out battle without crashes. The only bug I've noticed is that in my 4vs4 AAI script one of the commanders does nothing...just sits there at the spawn point. If I /cheat and /team x to take him over and start building, eventually AAI takes over and starts issuing it's own commands. This was on Supreme Battlefield with the spawn on the upper left island. The opposing commander on the mirrored spawn (lower-right island) started building immediately.
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: AAI v0.90 in SVN / latest Spring release

Post by hoijui »

sorry for bad quoting... its my memory ;-)
but as siad, the fixes are already merged in, which is why it works again. only the design changing commits are not merged in, as we said you (submarine) are going to discuss them wiht bernd and then eventually tll me to merge or not. i did not hear anything anyrmoe from nay of you two, so did not merge them.
User avatar
Umrug
Posts: 141
Joined: 27 Nov 2006, 12:57

Re: AAI v0.90 in SVN / latest Spring release

Post by Umrug »

Any way for us simple people who are not using repository to get compiled (Win32) version? Don't want to wait until next Srping release...
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: AAI v0.90 in SVN / latest Spring release

Post by hoijui »

someone could cherry pick bernds commits from master to the 0.79-branch, compile AAI with this (if possible, for win and linux, 32 and 64 bit). and then upload these binaries somewhere nad link them here.
i must confess, its my bad that this is not yet in the release version, sorry.
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: AAI v0.90 in SVN / latest Spring release

Post by hoijui »

i did it, and found 3 other bugs that could possibly cause AAI to crash. as i have no 64 bit machine or build env set up, i can only ship 32bit versions;
AAI 0.900 32bit Linux and Windows for spring 0.79.1.x.zip
AAI 0.900 32bit Linux & Windows for spring 0.79.1.x
(582.07 KiB) Downloaded 277 times
. if someone wants to compile it for 64 bit and needs help, contact me.
please report back here whether these binaries work, if you tested them.
User avatar
Umrug
Posts: 141
Joined: 27 Nov 2006, 12:57

Re: AAI v0.90 in SVN / latest Spring release

Post by Umrug »

Hey, it works, it works!

However!
- Not when hosted via Springlobby's singleplayer tab, only via multiplayer (i dont feel like going through scripts now to see whats the difference).
- On some maps (Zion, Comet Catcher Redux) the commander often just stands without any action, then suddenly starts acting again. (In the beginning of the game thats quite bad, especially before first factory has been built). On Cooper Hill i didn't notice this behavior.
- Doesn't use units for defence, or just sometimes, often has pile of units standing in one part of the base, while the other one is being destroyed.

But hey, we have another working AI again!
Pink
Posts: 28
Joined: 10 Jun 2009, 21:33

Re: AAI v0.90 in SVN / latest Spring release

Post by Pink »

I use springlobby to launch spring in single player mode with one AI on smaller maps such as Small Supreme Battlefield and The Ring.

I've not been able to get AAI working at all in Spring 0.79.1.2. It often crashes almost as soon as the game is loaded, other times it will crash 5 minutes or so in to the game.

I downloaded a set of debug symbols so that I could see where the issue occurred using gdb against the release I got from accAgon's repository.

From that I found out it was dying in AAIMap::UpdateEnemyScoutingData().

I then downloaded the source code and set about compiling myself.
From this I found it is when referencing

Code: Select all

sector->enemy_combat_units[bt->units_static[def_id].category - GROUND_ASSAULT]
that it dies.

I added a stack of printf()s and a try/catch to try and track the issue down.

Code: Select all

							try
							{
								printf("\t\t\tsector->enemy_combat_units[%d - %d] -> %f\n", bt->units_static[def_id].category, GROUND_ASSAULT, sector->enemy_combat_units[bt->units_static[def_id].category - GROUND_ASSAULT]);
								sector->enemy_combat_units[bt->units_static[def_id].category - GROUND_ASSAULT] += last_seen;
								
								printf("\t\t\tsector->enemy_combat_units[5]: %f\n", sector->enemy_combat_units[5]);
								sector->enemy_combat_units[5] += last_seen;
							}
							catch(char *strex)
							{
								printf("Exception : %s", strex);
							}
							for(int i = 0; i < bt->combat_categories; ++i)
							{
								printf("\t\t\tadding last_seen -> %d: sector->enemy_mobile_combat_power[i] -> %d, bt->units_static[def_id].efficiency[i] -> %d\n", last_seen, sector->enemy_mobile_combat_power[i], bt->units_static[def_id].efficiency[i]);
								sector->enemy_mobile_combat_power[i] += last_seen * bt->units_static[def_id].efficiency[i];
								printf("\t\t\tsector->enemy_mobile_combat_power[%d] -> %d\n", i, sector->enemy_mobile_combat_power[i]);
							}
As this wasn't helping particularly I just commented out my try catch and therefore that entire unit update section. As I think it may be a pointer dereferencing problem, or bad memory allocation, I'm going to try and printf each variable/reference on it's own line to see if I can track down which it is causing the issue

After commenting out this entire section the game tends to last longer (though of course updates on scouting data are not occurring correctly in that version).

However it still crashes out in the AAIMap::UpdateEnemyScoutingData() method but now when it crashes it is on the line

Code: Select all

last_seen = exp(cfg->SCOUTING_MEMORY_FACTOR * ((float)(last_updated_map[x + y * xLOSMapSize] - frame)) / 3600.0f  );
I know this because I put printf() either side of it and I only get the first one, then it segfaults.

I have no idea if you've resolved this issue. I'll maybe go on a hunt to get the latest SVN (after setting up appropriate SVN tools and learning to use that).

I'm not a C++ coder, but I do run an x64 Open Suse Linux box and know enough to insert printf's and follow instruction and use the supplied build script to compile it all up :) .

I'm not at all familiar with CMake though, nor spring, and as it stands I can only compile up the entire AI directory as I don't currently know how to just get AAI to compile.

If I can be of any help, let me know. For now I'm just using KAIK as that's the only AI that seems to install and work out of the box on the current Linux source release. An oddity being that most of my installed AI libraries were actually AAI (causing me much confusion as all the AI's were crashing and required cfg files to be set up for them).

This I would assume is either down to the build script or the install script placing things in the wrong location. Some of the AIs don't seem to get compiled at all and though this is not directly a problem to be resolved here, I feel it is of note as the issue could I guess be in how AAI is being built and installed that is causing the issue.
Post Reply

Return to “AI”