Replays of winning against CSAI? - Page 2

Replays of winning against CSAI?

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

Moderators: hoijui, Moderators

Tim-the-maniac
Posts: 250
Joined: 22 Jul 2006, 19:58

Post by Tim-the-maniac »

I emailed you 3 replays, one 2v1 on metal heck another 3v1 on comet catcher and the last one was when i set it to "raider style"
Raider style did make it attack with scouts a little more (they miss me at the start tho) but building a lab straight away and never building any constructers kind of buggers its chances ;).
silv
Posts: 30
Joined: 25 May 2006, 07:24

Post by silv »

on raiderstyle it beat me the first time because i played weak (chose kbots that couldnt cope with the tanks, wrong time to go level2, very bad placement of hlts) and the ai kept rushing me. 2nd game went better, i struggled, but i think my tank i slipped into its base in the beginning did the trick, the ai didn't bother to defend itself at all.
http://rapidshare.com/files/1573229/061 ... -0.7z.html
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Post by knorke »

Is CSharpAI_20061031 the newest version?
Well, I think it plays quite well in XTA, although its forces mainly consists of stumpy+slashers+scouts. It always seems to go for vehicles, but maybe thats because I only played flat, open maps.
So far I was always able to beat csai easily in 1v1 but in teams he is probally a good enemy for compstomps ;)

-Scouts return to home-base after they have scouted a position, maybe because they try to scout all possible startpos?

-it expands good and also rebuilds quite well when destroyed

-the commander can't defend himself against even the easiest attacks

-never built anti air, hardly any base defense. it should also "react" to attacks, like killing that peewee that is killing the factory all alone..

-if you look at the stats-graphics after a game you can see that after 5 minutes he always has way less units. maybe csai should use con-veh's to assist the factories and stuff.

-it once built a lot of mexes around one metalspot, maybe confused? only saw it happen once.
User avatar
hughperkins
AI Developer
Posts: 836
Joined: 17 Oct 2006, 04:14

Post by hughperkins »

Ok, white flag, clearly need to do some more work :-)

As things stand, beating other released AIs is easy, beating humans is hard. Partly its because no-one ever sends me replays when they lose ;-) so I only get replays of when CSAI gets mashed ;-) Partly it's because there's a lot of work to be done.

I'm hoping that the new NTai will be a challenge; it's a lot easier to test against an AI, than to wait for replays to arrive showing CSAI getting mashed
:roll:

Knorke, do you have a replay or two of your beating CSAI? A picture is worth a thousand words and all that.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

Testing against AIs cna be a problem because it encourages anti-AI play and not antiHuman play, with the latter fullfilling the role of the first but not vice versa.

Instead I find it best to identify flaws in your AI then build the AI up so that it can beat its previous version by exploiting those flaws aswell as doing so in weaker players.
User avatar
hrmph
Posts: 1054
Joined: 12 May 2005, 20:08

Post by hrmph »

AF makes a good point. You should design your AI to play against humans because that is who is going to use your AI. The points that have come to my mind have already been told by other people. Basically it needs to be more reactive. Several times I've killed factories with a single ak/flash/whatever and it seemed like the AI was not even concerned about calling back for any units in order to save/defend the factory. Maybe a quick solution to this is to have a group of 5 or so units patrolling around each cluster of factorys/bases at all times. Also it is extremely vulnerable to air attacks. It is definitely a good start.
User avatar
MadRat
Posts: 532
Joined: 24 Oct 2006, 13:45

Post by MadRat »

One problem that seems to recur with CSAI is that the first group of attack vehicles out of the factories clutter up and follow the commander around. I'm going to have to assume the commander begins as the leader of a grouping and that is why they attach to him like a ball and chain.

And the CSAI still has that nasty habit of crowding fellas in the top left corner of maps. What causes that, Hugh?
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

Thats caused by notcheckign for error values returned by the engine, its why AAI OTAI and NTai all used to have huge red blips in the top left corner of their matrixes and sent attacks to the top elft corner. If you tried to get the position of a unit whose ID was invalid it would returnt he co-ordinates 0,1,0 or 0,0,0.

And I noticed that behaviour with the commander, and hugh said that its a good way to group the attack units early on and move them out of the base by following the commander as it expands....
User avatar
MadRat
Posts: 532
Joined: 24 Oct 2006, 13:45

Post by MadRat »

Hugh, this sounds like a simple fix to your AI that would make it loads better than its been. Patch?
silv
Posts: 30
Joined: 25 May 2006, 07:24

Post by silv »

some more replays, you didn't get my mail (..@front.ru) hugh, did you?

http://rapidshare.com/files/1890436/demos.7z.html (1 lost with planes, 1 won using defense buildings only and 1 won trying a non-anti-AI-style except for not building aa).
User avatar
MadRat
Posts: 532
Joined: 24 Oct 2006, 13:45

Post by MadRat »

Has anyone else that has tried playing metal heck with 3 CSAI bots getting unbearable lag? Seems like as soon as I engage one of them the whole thing gets unplayable. Can't even move the cursor during it.
User avatar
MadRat
Posts: 532
Joined: 24 Oct 2006, 13:45

Post by MadRat »

Hugh,

I noticed there are alot of "Uknown unit in CAICallback::DrawUnit ARMPB" messages in the log file. Is this a game engine bug or from your AI?
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

possibly due to case insensitivity....
User avatar
hughperkins
AI Developer
Posts: 836
Joined: 17 Oct 2006, 04:14

Post by hughperkins »

I think it's an AA unit that doesnt exist in XTA?

The unit is not actually built during the game, but drawn onto the map during development to gain insight into the AI's thought processes. It should be turned off in release, but some things slip through.

In the current CSAI dev version, debug is only turned on if a file called debug.flg is detected, which should prevent the issue in the future.
User avatar
hughperkins
AI Developer
Posts: 836
Joined: 17 Oct 2006, 04:14

Post by hughperkins »

silp wrote:some more replays, you didn't get my mail (..@front.ru) hugh, did you?

http://rapidshare.com/files/1890436/demos.7z.html (1 lost with planes, 1 won using defense buildings only and 1 won trying a non-anti-AI-style except for not building aa).
Hi Silp,

Thank-you for the replays. Good work. White flag now ;-)
User avatar
hughperkins
AI Developer
Posts: 836
Joined: 17 Oct 2006, 04:14

Post by hughperkins »

AF wrote:Thats caused by notcheckign for error values returned by the engine, its why AAI OTAI and NTai all used to have huge red blips in the top left corner of their matrixes and sent attacks to the top elft corner. If you tried to get the position of a unit whose ID was invalid it would returnt he co-ordinates 0,1,0 or 0,0,0.
Hmmm, you're right.

What's the accepted way of checking that the return is valid? For now, I've added in a check for x != 0 or y != 0 or z != 0, but cant help wondering if 0,0,0 could be a valid position for a unit under certain conditions?
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

In the C++ header files are defined the macros UpVector and ZeroVector
aka

Code: Select all

#define ZeroVector float3(0,0,0)
#define UpVector float3(0,1,0)
And we do a simple check aka

Code: Select all

float3 position = unitpos;
if(position == UpVector) error!
Look at map.cpp of the NTai source, it has a function which checks if a position is valid by doing lots of checks such as checking if it's outside the map or an error position.

You may also want to extend the float3 C# class you use to also have all the features of the C++ version, such as the distance()/distance2D() functions normalize() and the dot product, and the overloads of the +,/,*,-, and == operators.
User avatar
hughperkins
AI Developer
Posts: 836
Joined: 17 Oct 2006, 04:14

Post by hughperkins »

In the C++ header files are defined the macros UpVector and ZeroVector
aka
Code:
#define ZeroVector float3(0,0,0)
#define UpVector float3(0,1,0)

And we do a simple check aka
Code:
float3 position = unitpos;
if(position == UpVector) error!
Ok.
You may also want to extend the float3 C# class you use to also have all the features of the C++ version, such as the distance()/distance2D() functions normalize() and the dot product, and the overloads of the +,/,*,-, and == operators.
These are implemented in basictypes/AdvancedFloat3.cs and basictypes/Float3Helper.cs It's easier to implement them outside of the interface, to keep the interface stable.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

hmm I'll have to write a wrapper then to put them all back.

But whats stopping you just putting them in the C# float3 class? Since your AI is totally C# theres nothing stoppign you just writting a convertor in managed C++ and not wrapping around at all, then just converting when you need to pass or retrieve a value from the interface.
User avatar
hughperkins
AI Developer
Posts: 836
Joined: 17 Oct 2006, 04:14

Post by hughperkins »

But whats stopping you just putting them in the C# float3 class? Since your AI is totally C# theres nothing stoppign you just writting a convertor in managed C++ and not wrapping around at all, then just converting when you need to pass or retrieve a value from the interface.
The Float3 class is in the CSAIInterfaces.dll. Modifying anything in this dll requires a Spring restart.

Modifying classes within CSAI itself can be done whilst the game is running, using .reloadai.
Post Reply

Return to “AI”