CSAI now compatible with XTA

CSAI now compatible with XTA

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

Moderators: hoijui, Moderators

User avatar
hughperkins
AI Developer
Posts: 836
Joined: 17 Oct 2006, 04:14

CSAI now compatible with XTA

Post by hughperkins »

CSAI now compatible with XTA

Latest CSAI release: [snipped, please see http://taspring.clan-sy.com/wiki/AI:CSAI#Downloads]

Benchmarking: won against AAI on SmallDivide, SpeedMetal, CometCatcher Remake v2, playing ARM on XTA 7
Last edited by hughperkins on 30 Oct 2006, 23:39, edited 2 times in total.
User avatar
Peet
Malcontent
Posts: 4384
Joined: 27 Feb 2006, 22:04

Post by Peet »

Good stuff. How does it function on a chokepointy map like SSB?
User avatar
hughperkins
AI Developer
Posts: 836
Joined: 17 Oct 2006, 04:14

Post by hughperkins »

SSB = Small Supreme Battlefield?

Against AAI it dominated, in AA2.23; untested in XTA. There were a couple of enemy metal extractors left over at the end in the corners.

Note that water-based units are not supported.
User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

Post by rattle »

And core?
User avatar
hughperkins
AI Developer
Posts: 836
Joined: 17 Oct 2006, 04:14

Post by hughperkins »

Played a match against AAI using XTA on SSB just now. CSAI won.

Note that there is a bug in the current latest release that will cause infantry factories to shutdown occasionally when playing XTA.
Sheekel
Posts: 1391
Joined: 19 Apr 2005, 19:23

Post by Sheekel »

Is this a cheating or non-cheating AI?
User avatar
hughperkins
AI Developer
Posts: 836
Joined: 17 Oct 2006, 04:14

Post by hughperkins »

Is this a cheating or non-cheating AI?
Non-cheating.

You can turn on debug mode as a spectator to watch it learn the position of its enemies to convince yourself of this.

Just say ".csai autoshowenemieson" and any detected enemy mobile unit positions will show up as transparent samsons. Any detected enemy buildings will show up as transparent anti-nukes. You will see these appear when CSAI units go within radar and LOS of enemy units.
User avatar
hughperkins
AI Developer
Posts: 836
Joined: 17 Oct 2006, 04:14

Post by hughperkins »

New release of CSAI:

*[snipped, please see http://taspring.clan-sy.com/wiki/AI:CSAI#Downloads ]

Changes this release:

*fixed bug that caused infantry factories to shutdown occasionally when playing XTA
*spreadsearch initiated much more aggressively, to give clean wins

Here's a replay of this version of CSAI playing AAI on SSB using XTA:

*http://manageddreams.com/csai/061026-Sm ... i-xta7.sdf

Note the spreadsearch initiated around gametime 22:40 and 24:00 to finish off those last few metal extractors.
Last edited by hughperkins on 30 Oct 2006, 23:39, edited 1 time in total.
User avatar
1v0ry_k1ng
Posts: 4656
Joined: 10 Mar 2006, 10:24

Post by 1v0ry_k1ng »

this is more profiecent than AAI? this is the first ive heard of this AI. can it play EE? and how does it fair against the dreaded KAI?
Chojin
Posts: 141
Joined: 04 Oct 2006, 11:22

Post by Chojin »

The so-called dreaded KAI is non-operational at the moment...
At least I wasn't able to make version 0.11 or 0.2 do any good at all with XTA or AA using the compiled libraries AF provided.

Hugh, I ran into a problem:
I started a map of Crossing_4_final with 1 AAI (0.76) and 1 CSAI (20061026b). Everything went smooth, CSAI won.

Next I thought to let them play against each other on Small Supreme Battlefield. Since this map is rather big, I decided on 2 AAI and 2 CSAI. The first instance worked fine, the second ran through the water to one of the islands and built 2 metal extractors right beside each other, on a spot where there is no metal at all.

I thought maybe 2 instances of CSAI wasn't such a good idea, so I restarted with 1 AAI versus 1 CSAI. This time the only CSAI ran to that island again, right after building a 2 or 3 buildings on the mainland.

Then I deleted the metal cache file to have it recreated... But now I get this error everytime I start SSB with CSAI:
GlobalAI1: Metal analyzer rebuilding cachefile
GlobalAI1: Exception: System.TypeInitializationException: The type initializer for 'CSharpAI.Metal' threw an exception. ---> System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

at AICallbackToGiveToCS.GetMetalMap()

at CSharpAI.Metal.SearchMetalSpots() in h:\dev\test\CSharpAI\CSAI\Metal.cs:line 349

at CSharpAI.Metal..ctor() in h:\dev\test\CSharpAI\CSAI\Metal.cs:line 72

at CSharpAI.Metal..cctor() in h:\dev\test\CSharpAI\CSAI\Metal.cs:line 55

--- End of inner exception stack trace ---

at CSharpAI.Metal.GetInstance()

at CSharpAI.CSAI.InitAI(IAICallback aicallback, Int32 team) in h:\dev\test\CSharpAI\CSAI\CSAI.cs:line 114
I tried a few things:
- deleted the whole cache folder (starting Crossing_4_final again works fine)
- reinstalled all files of CSAI (since I have no clue what those .pdb files are for, but they seemed not to have changed)
- restarted TASClient of course
- .reloadai (which got completely ignored, since CSAI wasn't successfully loaded in the first place, right?)

I have not rebooted yet...

Help! :)


EDIT: uhhmm, errrrmm... While typing I thought I should start another SSB with 1 AAI versus 1 CSAI to add to the quote the output that a .csai help gives... But now it works?! No more error?! Nevermind then... I guess?

Just for the record: I pride myself to think, that my windows desktop is pretty stable and that there shouldn't be any damaged RAM in it :shock:
Chojin
Posts: 141
Joined: 04 Oct 2006, 11:22

Post by Chojin »

OK... Now that CSAI did not crash I ran a few games on SSB...

CSAI's commander always runs to the upper-left island and builds 2 non-sense metal extractors and just stays there, not moving at all.

In one game I let 3 AAI play against 3 CSAI... now that was HILARIOUS! All 3 AAI build a shipyard in that small lake at the lower-left and all 3 CSAI commanders ran and stood at the upper-left island... LOL

So I deleted the metal.xml again -> same error as above...
I even rebooted -> same error...

Something is wrong, my computer doesn't seem to be able to create a usuable metal.xml for SSB. .NET Framework 2.0 installed here... I uninstalled 1.1 because 2.0 seemed to do the job...

I like the way CSAI plays (guarding commander; nice movement while attacking; faster units waiting for backup from slower ones; etc) I think it has great potential :) Haven't seen it build a single adv. lab yet, though.

Giving up for the time being.
User avatar
hughperkins
AI Developer
Posts: 836
Joined: 17 Oct 2006, 04:14

Post by hughperkins »

Chojin,

re: Metal.cs line 349 problem

Could you try downloading a new csailoader.dll from http://manageddreams.com/utils/csailoader.dll and overwriting the one that you currently have in AI\Bot-libs please?

re: playing 3 CSAI vs 3 AAI on SSB

The current Metal.cs makes no attempt to check whether metal spots are underwater or not. Edit: but actually SSB has no underwater metal spots???

Allied CSAIs do not currently detect metalspots occupied by other allies.
Chojin
Posts: 141
Joined: 04 Oct 2006, 11:22

Post by Chojin »

Hey Hugh :-)

I was just about to do what you suggested yesterday, when I saw you built another loader.dll.

Ok, this one does not crash anymore while creating the metal cache file. I tried 10 times in a row on SSB deleting metal.xml before each time. Commander builds fine. :-)

A friend of mine just told me, he had the same crash as me. The new loader.dll is working fine for him too. He has .NET 1.1 only installed.


Now, I guess there is still a problem reading the existing metal.xml. When it didn't have to be created during the current game, but was created in a previous one, the CSAI commander will build 1 solar and 1 lab, and then head to the the upper-left island and build 2 non-sense metal extrators there. Then the Commander will just stand there forever.

My friend is having the same problem. If we remove the file Small Supreme Battlefield.smf_metal.xml before a game, everything will be fine.

I uploaded all neccessary files to debug I hope:
- metal.xml created during the current game here
- metal.xml created in the previous game here


I also like to suggest the following, if it is possible somehow:
- Units guarding the Commander get so close to him, that he can barely move nor build properly. Is it possible to make those units guard instead of trying to move into the Commander?
- It happened a few times, that the CSAI ran out of metal, while the Commander was building a metal extractor and completely ignoring the 500 metal stone right beside him. Is it possible to reclaim when the need arises?

Thanks,
Marc
User avatar
1v0ry_k1ng
Posts: 4656
Joined: 10 Mar 2006, 10:24

Post by 1v0ry_k1ng »

supreme commander battlefield isnt a good test. AAI and all the ais suck ass on chokepoint maps. to test the AI's fairly, test them on
comet catcher
Mars
Altored divide
Xan the terror
as all the ais cant cope with supcom map gameplay
User avatar
hughperkins
AI Developer
Posts: 836
Joined: 17 Oct 2006, 04:14

Post by hughperkins »

1v0ry_k1ng wrote: as all the ais cant cope with supcom map gameplay
Time will tell; but I do need replays of people winning against CSAI in order to improve it. It's highly motivational to have someone say "look I can beat it like this", and try to find a way to turn that around.
User avatar
MadRat
Posts: 532
Joined: 24 Oct 2006, 13:45

Post by MadRat »

You should give it some evil tendencies, like factory stuffing with dead corpses, early hit and runs on energy production, attempted commander napping, etc.
User avatar
hughperkins
AI Developer
Posts: 836
Joined: 17 Oct 2006, 04:14

Post by hughperkins »

MadRat wrote:You should give it some evil tendencies, like factory stuffing with dead corpses, early hit and runs on energy production, attempted commander napping, etc.
Yeah, well I'm not sure about the factory stuffing with dead corpses, but the comnapping and raiding are definitely on the list.
User avatar
1v0ry_k1ng
Posts: 4656
Joined: 10 Mar 2006, 10:24

Post by 1v0ry_k1ng »

lol factory stuffing is dumb. free metal for the other player
User avatar
MadRat
Posts: 532
Joined: 24 Oct 2006, 13:45

Post by MadRat »

Dumb? Early in a game it makes it impossible to build units from the factory until a con unit comes over and clears it. Hardly a dumb move at all. Its how I once dominated ten's TA ladder scene, beat down the top ten to where they wouldn't play me anymore.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

Most early game you have a conbot next to your plant helping it anyway, or at leats i do, by the 5 min mark I ahve at least 2 conbots, 1 guarding a factory, another building stuff
Post Reply

Return to “AI”