CAI

CAI

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

Moderators: hoijui, Moderators

Google_Frog
Moderator
Posts: 2464
Joined: 12 Oct 2007, 09:24

CAI

Post by Google_Frog »

The unimaginatively named AI that plays CA. It's a non-cheating luaAI that beats other AIs (and occasionally Carrepairer) at CA. (There aren't any AIs that have a good config for CA)

I was spurred into action by Kingraptor's difficulty in creating a decent CA config for Shard. So CAI uses a few CA specific things because it seems impossible to do with configs for other AIs.

There are a few known issues, it's work in progress.
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: CAI

Post by hoijui »

cool! :D

i guess, it comes packed with CA in latest versions (eg, using SpringDownloader)?

Just asking cause... some AI devs are relatively spring illiterate, when it comes to anything else then the AI Interface.
Google_Frog
Moderator
Posts: 2464
Joined: 12 Oct 2007, 09:24

Re: CAI

Post by Google_Frog »

i guess, it comes packed with CA in latest versions (eg, using SpringDownloader)?
Yep, it's also more recent than latest stable.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: CAI

Post by AF »

What exactly are the difficulties encountered with Shard?
echoone
AI Developer
Posts: 150
Joined: 16 Nov 2009, 18:26

Re: CAI

Post by echoone »

And it can be obtained from??

I have the latest CA test (7624; as available with the updater) and I'm not seeing CAI showing up in the list of AIs.
User avatar
Rafal99
Posts: 162
Joined: 14 Jan 2006, 04:09

Re: CAI

Post by Rafal99 »

The latest CA test is 8108 at the moment, select CA->test in the Spring Downloader, not any specific revision.
7624 was like 3 months ago btw.
echoone
AI Developer
Posts: 150
Joined: 16 Nov 2009, 18:26

Re: CAI

Post by echoone »

Seemingly, that's the latest available on http://files.caspring.org

I guess someone stopped updating it.
SirMaverick
Posts: 834
Joined: 19 May 2009, 21:10

Re: CAI

Post by SirMaverick »

Archives aren't provided anymore for test versions. You need to use Spring Downloader (or this script).
echoone
AI Developer
Posts: 150
Joined: 16 Nov 2009, 18:26

Re: CAI

Post by echoone »

This probably isn't the best place to post this but here it. Its happened twice in a row on 64 bit linux build when running this AI. The build was built from latest git source.

Translated Stacktrace:
/home/build/games/spring/rts/System/Platform/CrashHandler.cpp:283
??:0
/usr/lib/gcc/x86_64-manbo-linux-gnu/4.4.1/../../../../include/c++/4.4.1/ext/new_allocator.h:105
/home/build/games/spring/rts/Sim/Path/PathEstimator.cpp:575
/home/build/games/spring/rts/Sim/Path/PathEstimator.cpp:537
/home/build/games/spring/rts/Sim/Path/PathEstimator.cpp:473
/home/build/games/spring/rts/Sim/Path/PathManager.cpp:167
/home/build/games/spring/rts/Sim/Path/PathManager.cpp:87
/home/build/games/spring/rts/Sim/MoveTypes/GroundMoveType.cpp:1168
/home/build/games/spring/rts/Sim/MoveTypes/GroundMoveType.cpp:1253
/home/build/games/spring/rts/Sim/MoveTypes/GroundMoveType.cpp:1352
/home/build/games/spring/rts/Sim/MoveTypes/GroundMoveType.cpp:474
/home/build/games/spring/rts/Sim/MoveTypes/GroundMoveType.cpp:442
/home/build/games/spring/rts/Sim/Units/CommandAI/MobileCAI.cpp:949
/home/build/games/spring/rts/Sim/Units/CommandAI/MobileCAI.cpp:576
/home/build/games/spring/rts/Sim/Units/CommandAI/MobileCAI.cpp:406
/home/build/games/spring/rts/Sim/Units/CommandAI/CommandAI.cpp:725
/home/build/games/spring/rts/Sim/Units/CommandAI/MobileCAI.cpp:282
/home/build/games/spring/rts/Lua/LuaSyncedCtrl.cpp:2502
/home/build/games/spring/rts/lib/lua/src/ldo.cpp:319
/home/build/games/spring/rts/lib/lua/src/lvm.cpp:609
/home/build/games/spring/rts/lib/lua/src/ldo.cpp:377
/home/build/games/spring/rts/lib/lua/src/ldo.cpp:119
/home/build/games/spring/rts/lib/lua/src/ldo.cpp:464
/home/build/games/spring/rts/lib/lua/src/lapi.cpp:843
/home/build/games/spring/rts/Lua/LuaHandle.cpp:226
/home/build/games/spring/rts/Lua/LuaHandle.cpp:253
/home/build/games/spring/rts/Lua/LuaHandleSynced.cpp:718
/home/build/games/spring/rts/Game/Game.cpp:3538
/home/build/games/spring/rts/Game/Game.cpp:3907
/home/build/games/spring/rts/Game/Game.cpp:2809
/home/build/games/spring/rts/System/SpringApp.cpp:911
/home/build/games/spring/rts/System/SpringApp.cpp:1057
/home/build/games/spring/rts/System/Main.cpp:63

Anyone seeing this?
Google_Frog
Moderator
Posts: 2464
Joined: 12 Oct 2007, 09:24

Re: CAI

Post by Google_Frog »

AF wrote:What exactly are the difficulties encountered with Shard?
You're probably better off asking Kingraptor as he wrote the config. From what I saw of it playing each con had a build queue that it executed which was quite limiting.
echoone wrote:Error
No doubt this is an engine bug in the build you are using. Use the stable engine release to avoid the crash.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: CAI

Post by AF »

Each constrictor has a task queue, these task queues can be strings in the form you mention.

BUT

This system is implemented as a behaviour in lua, and can be completely replaced with any kind of construction system you want.

On top of that, as well as specifying a set of strings for a list, you can specify a lua function and return different things each time. And on top of that, you don't have to return a string! You can return a function that returns a string, so that you can do even more custom logic. But these are all feats of a system which itself can be ripped up and thrown out in favour of another system.

Eg in evolutionRTs there is a behaviour which makes engineers build defence turrets when under attack. this behaviour is completely separate from the tasks system.
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7049
Joined: 16 Nov 2004, 13:08

Re: CAI

Post by zwzsg »

But if Shard relies on whoever write a mod/game config to recode tons of behavior in Lua, he might be better off just keeping his Lua code and discarding the Shard part, no?

What is the added value of Shard?
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: CAI

Post by AF »

A nicer API, eventual multiple engine support, and a ready made framework, amongst other things coming soon
Edible
Posts: 72
Joined: 09 Feb 2008, 01:46

Re: CAI

Post by Edible »

It gives a fairly hard fight in CCR, and seems to expand very well.
Lacks counters to lategame tricks but thats fairly expected.
User avatar
Licho
Zero-K Developer
Posts: 3803
Joined: 19 May 2006, 19:13

Re: CAI

Post by Licho »

It also fails against gunships (wont build razor kiss/packo)
Google_Frog
Moderator
Posts: 2464
Joined: 12 Oct 2007, 09:24

Re: CAI

Post by Google_Frog »

Licho wrote:It also fails against gunships (wont build razor kiss/packo)
That's not particularly descriptive. I know there are situations which it will make razor/packo. Which situations did you test?
User avatar
Licho
Zero-K Developer
Posts: 3803
Joined: 19 May 2006, 19:13

Re: CAI

Post by Licho »

It was core kbot,i was core gunship.
I was only spamming gunships.
It only built like 1/4 of crashers and no serious AA (except few defenders)
yanom
Posts: 323
Joined: 10 Jul 2009, 23:34

Re: CAI

Post by yanom »

AF wrote:What exactly are the difficulties encountered with Shard?
its windows only.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: CAI

Post by AF »

Eh it is Linux compatible, it just needs the necessary cmake changes to be made so it's built using shards lua, not springs lua
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: CAI

Post by knorke »

played around a bit and found it quite stable, did not crash so far.
also good (little) cpu usage.
plays ok. Noticed it seems to use artiellery as intended.

But it plays a bit aimless.
When 2 CAIs play against each other, this flaw becomes quite noticeable.
For example they can literally fight forever on a small 8x8 map (ie Barren) without any winner. Even after I /give 10 fusions to one CAI I noticed no progress after another 30 minutes. (game was already going for an hour)

Maybe it is because its units killing each other in the middle and in the case a few units get past, they are picked off by base defense.
So no damage done. At some point it needs to stop wasting units and tech/grow the base more and reclaim all the wrecks.
I also noticed it seems to create "fight groups" or something?
Ie a few dozen units that will stick together. Problem, after the fightgroup is almost dead the few survivors just keep doing the same stuff. Sometimes another 15 units are waiting in the base at the factory while the previous group is dying in the field. The groups should reinforce/help/join each other. I think failing to do this also makes the game go on for so long.
Also the commanders are a little stupid, as soon as 2 coms meet they stop and laser each other to death, dying at the same time.
Post Reply

Return to “AI”