View topic - KAIK 0.13 Unofficial (Spring 0.80.5*)



All times are UTC + 1 hour


Post new topic Reply to topic  [ 323 posts ]  Go to page Previous  1 ... 13, 14, 15, 16, 17  Next
Author Message
PostPosted: 26 Dec 2009, 10:05 
Spring Developer
User avatar

Joined: 22 Sep 2007, 08:51
nice! :D thank you! will try today!
about GetFriendlyUnits()
it should return the units of the AIs team aswell, as it uses TeamHandler.Ally(allyTeam1, allyTeam2), and each allyTeam is allied with itsself.
... thanks to you, i found some bugs in the pureint branch :D
when i had a look at GetFreindlyUnits()

yeah.. don't have an idea right now why it would be different for mexes from ones own team.


Top
 Offline Profile  
 
PostPosted: 26 Dec 2009, 12:35 
AI Coder

Joined: 17 Mar 2008, 19:03
Location: RF
I would like to warn that you may still notice double mexes during situations when AI decided to build a mex & then while a builder is approaching its goal another allied player completes its own mex so that building place is not overlapped with the place AI has chosen. AI currently does not periodically validate its goal if the way to it takes too long & can't change its mind.


Top
 Offline Profile  
 
PostPosted: 27 Dec 2009, 14:36 
Spring Developer

Joined: 08 Oct 2006, 15:58
Thanks for your patches Simon. I would have liked to look at them with my own eyes (couldn't do any dev work yesterday due to christmas), but it seems they were already applied. ;)

Quote:
I did another trace behind an enemy unit on DGun path. It is not perfect (i don't know how to get all units on a trace with ease) but will cover most of confusing situations when KAIK uses DGun.


The best solution IMO is to keep iterating over ray segments until the dgun's range is exceeded; I'll make that change in a bit.


Top
 Offline Profile  
 
PostPosted: 27 Dec 2009, 21:21 
AI Coder

Joined: 17 Mar 2008, 19:03
Location: RF
Yes, i thought about it while coding but was lazy (and tied) to make a loop. But it is not enough actually. We need API to trace a stripe, not a ray. D-Gun is wide enough. So, even making a loop will not make 100% intellectual D-Gun usage. May be we can imitate stripe trace with making two ordinary traces on the edges of a stripe. It will be perfect until stripe width is more than width of the smallest unit bounding box.


Top
 Offline Profile  
 
PostPosted: 31 Dec 2009, 03:58 
Tournaments Moderator
User avatar

Joined: 08 Dec 2007, 17:39
Location: UK - England
It would be interesting to set up an FFA with all the existing AI and see who wins the most games out of 5. I currently have no idea which AI is the best and hardest to play against. Could somebody link me up? There's a bunch of threads here with many pages to follow so I cba to dig through it all to find the best AI for BA.


Top
 Offline Profile  
 
PostPosted: 31 Dec 2009, 13:19 
Map Creator
User avatar

Joined: 10 Mar 2006, 10:24
Location: waiting in line for The Expendables 2
for BA, most challenging to least

E223AI
KAI
NTAI
RAI
AAI


Top
 Offline Profile  
 
PostPosted: 31 Dec 2009, 14:18 
Tournaments Moderator
User avatar

Joined: 08 Dec 2007, 17:39
Location: UK - England
Thanks, much appreciated.


Top
 Offline Profile  
 
PostPosted: 09 Jan 2010, 18:21 
AI Coder

Joined: 17 Mar 2008, 19:03
Location: RF
KAIK crashes with BOTA 1.6 (fix-8) because ai->cb->GetUnitDefList() (file UnitTable.cpp, method CUnitTable::Init()) fills vector with NULLs since about 40th element. I tried to ignore error with "continue" statement (smth similar is done in E323AI), but then i got a crash inside SkirmishAI.dll!std::_Lockit::~_Lockit(). I don't know what it is.

By the way, other AIs work with BOTA (personally tested RAI & E323AI). They have another approach in parsing unit definitions.


Last edited by slogic on 22 Jan 2010, 21:00, edited 1 time in total.

Top
 Offline Profile  
 
PostPosted: 09 Jan 2010, 18:50 
Spring Developer
User avatar

Joined: 22 Sep 2007, 08:51
its still BOTAs fault. the engine fills the unit DefList with NULL's if the defines are invalid. in the past, the engine did not do this, but now does (uses stricter tests.. its the right way to do as it is now). Supreme Annihilation has hte smae problem, XTA had it too, ...
BOTA devs should be bugged to fix/cleanup their mod.


Top
 Offline Profile  
 
PostPosted: 09 Jan 2010, 23:22 
AI Coder

Joined: 17 Mar 2008, 19:03
Location: RF
But
Code:
other AIs works with BOTA (personally tested RAI & E323AI). They have another approach in parsing unit definitions.

There is nothing bad to make AI more stable & forgive modders some of their mistakes.

PS. I almost forget. Increase dst buffer up to 2048 bytes in Util.cpp. I don't know why but using strcpy_s() under MSVC causes a crash when you try to copy data from 2048-sized buffer into 1024-sized even if 2048-sized buffer contains a string with much less effective symbol count than 1024. 2048 is taken from CAIAICallback::GetValue:
Code:
static const size_t absPath_sizeMax = 2048;


Top
 Offline Profile  
 
PostPosted: 10 Jan 2010, 14:40 
Spring Developer
User avatar

Joined: 22 Sep 2007, 08:51
yeah true.. if KAIK would forgive that, it would be ok too. i guess nobody would dismiss a patch doing this.
and as all other stuff seems to work fine even with NULL values in the unitDef list, modders usually care little about fixing it.


Top
 Offline Profile  
 
PostPosted: 10 Jan 2010, 17:53 
AI Coder
User avatar

Joined: 14 Sep 2004, 10:32
Location: Cookieland
Normally I would do an if check at start up on whether the unitdef is NULL and skip that particular definition. Not the best of situations but I guess if the unitdef shows up as null for the AI and inside the engine too then there's no chance of the unit ever being built and the AI not being able to handle it.

The moral of the story here being that the AI interface is an API too, and your code should check what the return values are for errors, and validate the contents, and display error messages and abort/recover if necessary.


Top
 Offline Profile  
 
PostPosted: 29 Jan 2010, 00:28 
AI Coder

Joined: 17 Mar 2008, 19:03
Location: RF
Changelog:
* fixed a crash with insufficient buffer length if compiled with MSVC2008 (looks like in debug mode only)
* best metal spot range is fixed: now AI really will not build (take decision actually) occupied metal spots by allies; at first attempt i made changes according to code template which was actually wrong
* (experimental) AI will reclaim enemy metal maker nearby its brand new metal maker (this may occur if enemy metal maker is not armed)


Attachments:
SkirmishAI_DLL.zip [302.69 KiB]
Downloaded 41 times
KAIK_source.zip [130.34 KiB]
Downloaded 37 times


Last edited by slogic on 02 Feb 2010, 19:12, edited 1 time in total.
Top
 Offline Profile  
 
PostPosted: 29 Jan 2010, 13:22 
Spring Developer
User avatar

Joined: 22 Sep 2007, 08:51
i have these changes in 3 different commits now (pushed to master).
it was quite a mess though, please use git, and if you think git is strange, then please explain why, i would like to explain you. in the end, it will be better for both of us. ;-)
we all had our problems/confusion with git in the beginning, nothing to be ashamed of.


Top
 Offline Profile  
 
PostPosted: 30 Jan 2010, 12:18 
AI Coder
User avatar

Joined: 28 Nov 2006, 16:46
Location: Netherlands
Hey Slogic,

This paper on git gave me a better understanding of the mechanics (and thus its use). Give it a try and understand why its so epic!


Top
 Offline Profile  
 
PostPosted: 12 Apr 2010, 20:01 

Joined: 17 Feb 2007, 18:43
Location: Netherlands
KAIk has been running pretty smoothly lately, except for a recent game where it got stuck. This happend because it build its first factory right next to a rock wall, blocking the factory exit. cons vehicles couldn't exit so after a few units the bot got stuck.

maybe it should detect this situation and use the commander to start a new factory. or even better, prevent the situation at all ;)


Top
 Offline Profile  
 
PostPosted: 12 Apr 2010, 22:45 
AI Coder
User avatar

Joined: 14 Sep 2004, 10:32
Location: Cookieland
In 3 way FFA tests with shard rai and kaik under evorts, KAIK builds one or two metal extractors then builds nothing, could you look into this?

Latest evoRts starts with an engineer and not a factory so itshould be more AI friendly


Top
 Offline Profile  
 
PostPosted: 13 Apr 2010, 17:38 
Spring Developer

Joined: 08 Oct 2006, 15:58
AF wrote:
In 3 way FFA tests with shard rai and kaik under evorts, KAIK builds one or two metal extractors then builds nothing, could you look into this?


It's because all EvoRTS energy-producing buildings are "armed" with pseudo-weapons to generate FX, so KAIK thinks they are ground defenses (which it doesn't build anyway) and gets stuck because of a hardcoded "build two metal and two energy structures first" rule.

The last time I thought about refactoring this was before I started XAI, but we'll see.


Top
 Offline Profile  
 
PostPosted: 14 Apr 2010, 14:48 

Joined: 13 Jun 2005, 15:37
For my Java port of KAIK (Yep, still alive, still working on it, and it's gonna be rather playable once the Spring pureint branch gets into production :) ), I'm thinking of just opening the unit config file a lot more, so people can override categories.
So for mods where units get miscategorized (Evo, CA, everything not BA/XTA :D), people could solve it with config. Think that's a good idea? :) Not sure if there would be other snags elsewhere, 'll find out soon tho I think ^_^


Top
 Offline Profile  
 
PostPosted: 13 May 2010, 21:01 
Community Lead
User avatar

Joined: 10 Apr 2006, 04:05
Location: Finland, 1944
viewtopic.php?f=15&t=19583

Please modify your entry or add a new one to this thread to keep track of your current AI development.


Top
 Offline Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 323 posts ]  Go to page Previous  1 ... 13, 14, 15, 16, 17  Next

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group

Site layout created by Roflcopter et al.