[ANN] Baczek's KP AI 1.2

[ANN] Baczek's KP AI 1.2

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

Moderators: hoijui, Moderators

imbaczek
Posts: 3629
Joined: 22 Aug 2006, 16:19

[ANN] Baczek's KP AI 1.2

Post by imbaczek »

Announcing the first release of my very own KP AI. Features include:
- simplistic Python configuration scripting
- goal-oriented architecture
- wins 1v1 with default KP AI most of the time

Gameplay features:
- smart pointers
- smart (uh, sometimes) constructors
- handles system well, hacker so-so, network rather bad

Issues:
- doesn't know jack about "fairies"
- can't handle mines
- buildorder not customizable yet
- misuses flows
- increased cpu lag
- uses Python for scripting
- etc

DOWNLOAD v1.2 source

Installation: unzip into your spring directory.

edit: version 1.2 compatible with spring 0.79.1!
edit: updated to spring 0.80.5
Last edited by imbaczek on 30 May 2009, 15:51, edited 5 times in total.
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Re: [ANN] Baczek's KP AI 1.0

Post by zwzsg »

Awesome!
[ 0] Finalizing...
[ 0] Spring 0.79.0.1 (0.79.0.2-0-gfcaf14a{@}-cmake-tdm)
[ 0] Build date/time: May 23 2009 00:38:01
[ 0] Player NoName connected with number 0 (client version 0.79.0.1 (0.79.0.2-0-gfcaf14a{@}-cmake-tdm))
[ 0] GameID: 8b0e1b4ab5a4d73eea0389041cdf4421
[ 0] ERROR: Skirmish AI BaczekKPAI-1.0 not found!
The game will go on without it.
This usually indicates a problem in the usedAI Interface library (-),
or the Skirmish AI library is not in the sameplace as its AIInfo.lua.
Uh.... I think you forgot MSVCR90.dll
imbaczek
Posts: 3629
Joined: 22 Aug 2006, 16:19

Re: [ANN] Baczek's KP AI 1.0

Post by imbaczek »

gah. updating...

edit: MSVCR90.dll and friends
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Re: [ANN] Baczek's KP AI 1.0

Post by zwzsg »

[ 0] Finalizing...
[ 0] Spring 0.79.0.1 (0.79.0.2-0-gfcaf14a{@}-cmake-tdm)
[ 0] Build date/time: May 23 2009 00:38:01
[ 0] Player NoName connected with number 0 (client version 0.79.0.1 (0.79.0.2-0-gfcaf14a{@}-cmake-tdm))
[ 0] GameID: 64111b4ab4a7ce59e88785181cdf4421
[ 0] SkirmishAI1: Baczek's KP AI
[ 0] SkirmishAI1: 1.0
[ 0] SkirmishAI1: AI data directory:
[ 0] SkirmishAI1: R:\more_installed_games\TASpring\Spring79\AI\Skirmish\BaczekKPAI\1.0\
[ 0] SkirmishAI (with team ID = 1): Cheating enabled!
[ 0] Spring 0.79.0.1 (0.79.0.2-0-gfcaf14a{@}-cmake-tdm) has crashed.
[ 0] Exception: Access violation (0xc0000005)
[ 0] Exception Address: 0x65bf8d87
[ 0] DLL information:
[ 0] 0x00400000 spring
[ 0] 0x78460000 ntdll
[ 0] 0x10000000 DevIL
[ 0] 0x78000000 MSVCRT
[ 0] 0x77e70000 KERNEL32
[ 0] 0x00330000 ILU
[ 0] 0x78ed0000 ADVAPI32
[ 0] 0x770c0000 RPCRT4
[ 0] 0x78fb0000 Secur32
[ 0] 0x6fa00000 GLU32
[ 0] 0x69310000 OPENGL32
[ 0] 0x77f40000 GDI32
[ 0] 0x77e00000 USER32
[ 0] 0x51000000 DDRAW
[ 0] 0x72810000 DCIMAN32
[ 0] 0x77910000 IMAGEHLP
[ 0] 0x6fbc0000 mingwm10
[ 0] 0x7ce30000 SHELL32
[ 0] 0x70a70000 SHLWAPI
[ 0] 0x71710000 COMCTL32
[ 0] 0x74fb0000 WS2_32
[ 0] 0x74fa0000 WS2HELP
[ 0] 0x00350000 SDL
[ 0] 0x77540000 WINMM
[ 0] 0x7c340000 MSVCR71
[ 0] 0x66fc0000 freetype6
[ 0] 0x61b80000 zlib1
[ 0] 0x6ed80000 glew32
[ 0] 0x6b180000 vorbisfile
[ 0] 0x63e00000 vorbis
[ 0] 0x003a0000 ogg
[ 0] 0x003c0000 OpenAL32
[ 0] 0x75e00000 IMM32
[ 0] 0x6c8d0000 LPK
[ 0] 0x66410000 USP10
[ 0] 0x6bc00000 DrvTrNTm
[ 0] 0x6bc20000 DrvTrNTl
[ 0] 0x030b0000 UnlockerHook
[ 0] 0x030c0000 ophook32
[ 0] 0x7cd20000 ole32
[ 0] 0x779a0000 OLEAUT32
[ 0] 0x77810000 VERSION
[ 0] 0x75950000 LZ32
[ 0] 0x06330000 SSSensor
[ 0] 0x03830000 atioglxx
[ 0] 0x74f50000 msafd
[ 0] 0x74f90000 wshtcpip
[ 0] 0x77530000 wdmaud
[ 0] 0x51080000 dsound
[ 0] 0x773d0000 msacm32
[ 0] 0x773e0000 MSACM32
[ 0] 0x72c60000 CLBCATQ
[ 0] 0x5ef80000 KsUser
[ 0] 0x1f7c0000 wrap_oal
[ 0] 0x29630000 AIInterface
[ 0] 0x68380000 SkirmishAI
[ 0] 0x1e000000 python26
[ 0] 0x78520000 MSVCR90
[ 0] 0x65bc0000 boost_python-mgw44-mt-1_39
[ 0] 0x72970000 DBGHELP
[ 0] Stacktrace:
[ 0] (0) R:\more_installed_games\TASpring\Spring79\boost_python-mgw44-mt-1_39.dll(ZN5boost6python9exec_fileENS0_3strENS0_3api6objectES3_+0x187c3) [0x65BF8D87]
[ 0] (1) R:\more_installed_games\TASpring\Spring79\boost_python-mgw44-mt-1_39.dll(ZN5boost6python9exec_fileENS0_3strENS0_3api6objectES3_+0x827e) [0x65BE8842]
[ 0] (2) R:\more_installed_games\TASpring\Spring79\boost_python-mgw44-mt-1_39.dll(ZN5boost6python6detail26register_exception_handlerERKNS_9function2IbRKNS1_17exception_handlerERKNS_9function0IvEEEE+0) [0x65BDB54C]
[ 0] (3) R:\more_installed_games\TASpring\Spring79\boost_python-mgw44-mt-1_39.dll(ZN5boost6python6importENS0_3strE+0xf1) [0x65BE03ED]
[ 0] (4) R:\more_installed_games\TASpring\Spring79\AI\Skirmish\BaczekKPAI\1.0\SkirmishAI.dll [0x6839448F]
[ 0] (5) R:\more_installed_games\TASpring\Spring79\AI\Skirmish\BaczekKPAI\1.0\SkirmishAI.dll [0x683860E5]
[ 0] (6) R:\more_installed_games\TASpring\Spring79\AI\Skirmish\BaczekKPAI\1.0\SkirmishAI.dll [0x683E1A8D]
[ 0] (7) R:\more_installed_games\TASpring\Spring79\AI\Skirmish\BaczekKPAI\1.0\SkirmishAI.dll [0x68381441]
[ 0] (8) R:\more_installed_games\TASpring\Spring79\spring.exe [0x00924A59]
[ 0] (9) R:\more_installed_games\TASpring\Spring79\spring.exe(skirmishAiCallback_Unit_CurrentCommand_0ARRAY1VALS0getParams+0x10ada) [0x009486FA]
[ 0] (10) R:\more_installed_games\TASpring\Spring79\spring.exe [0x0095D1D9]
[ 0] (11) R:\more_installed_games\TASpring\Spring79\spring.exe(skirmishAiCallback_Unit_CurrentCommand_0ARRAY1VALS0getParams+0x11964) [0x00949584]
[ 0] (12) R:\more_installed_games\TASpring\Spring79\spring.exe [0x004A4C47]
[ 0] (13) R:\more_installed_games\TASpring\Spring79\spring.exe [0x00403E47]
[ 0] (14) R:\more_installed_games\TASpring\Spring79\spring.exe [0x0041F7F9]
[ 0] (15) R:\more_installed_games\TASpring\Spring79\spring.exe [0x00421F62]
[ 0] (16) R:\more_installed_games\TASpring\Spring79\spring.exe [0x008BA285]
[ 0] (17) R:\more_installed_games\TASpring\Spring79\spring.exe [0x008C39B4]
[ 0] (18) R:\more_installed_games\TASpring\Spring79\spring.exe [0x008B908B]
[ 0] (19) R:\more_installed_games\TASpring\Spring79\spring.exe [0x008B9271]
[ 0] (20) R:\more_installed_games\TASpring\Spring79\spring.exe [0x0095E4B8]
[ 0] (21) R:\more_installed_games\TASpring\Spring79\spring.exe [0x0040124B]
[ 0] (22) R:\more_installed_games\TASpring\Spring79\spring.exe [0x004012B8]
[ 0] (23) C:\WINNT\system32\KERNEL32.dll [0x77E989D5]
Sorry.


Edit: After one or two more releases, and adding one more .dll, it works. Well, it doesn't use the config, but that doesn't prevent it from winning just by using bits.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: [ANN] Baczek's KP AI 1.0

Post by AF »

The wonders of the C API make this new release possible, congratulations on your first release =)

*ticker tape parade*
imbaczek
Posts: 3629
Joined: 22 Aug 2006, 16:19

Re: [ANN] Baczek's KP AI 1.1

Post by imbaczek »

thanks. the new C interface certainly made it a lot easier to make a new AI. (sidenote: java AIs should work, too, AFAIK the critical bugs are fixed :))

btw new release - no major code changes, but hopefully will work on systems without python installed.

DOWNLOAD
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: [ANN] Baczek's KP AI 1.0

Post by hoijui »

yeah!!!
i am worth something!
.. well my work..
thanks guys! ;-)

and.. of course.. gratulations too!!
.. will try to compile on linux...
Niarro
Posts: 1
Joined: 17 Jul 2006, 05:08

Re: [ANN] Baczek's KP AI 1.1

Post by Niarro »

Hrm... unzipped it to my Spring directory, although the AI's not showing up when trying to add bots O.o Granted, newb here, so I'm probably doing something wrong, but... X3;
imbaczek
Posts: 3629
Joined: 22 Aug 2006, 16:19

Re: [ANN] Baczek's KP AI 1.1

Post by imbaczek »

did you restart your lobby after unzipping? also, you probably need springlobby to use it, tasclient is broken.
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Re: [ANN] Baczek's KP AI 1.1

Post by zwzsg »

Ok, that last version gave no errors and built byte and pointer.

I don't really like that weird w9xpopen.exe being dropped in my Spring folder though (the AI works when it's deleted anyway). And don't forget to edit the description, that AI does stuff!

I'll have to test it a bit more, and then redo my skirmish generators to make use of it.
imbaczek
Posts: 3629
Joined: 22 Aug 2006, 16:19

Re: [ANN] Baczek's KP AI 1.1

Post by imbaczek »

w9xpopen.exe is a part of python, i don't like it either, but without it you won't be able to use parts of python. edit: otoh, spring requires win2k at the very least, so maybe i can do without it...

i'll edit the description asap, thanks for a reminder.
imbaczek
Posts: 3629
Joined: 22 Aug 2006, 16:19

Re: [ANN] Baczek's KP AI 1.2

Post by imbaczek »

top post updated, version 1.2 with no changes but support for spring 0.79.1.
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Re: [ANN] Baczek's KP AI 1.2

Post by zwzsg »

I find dropping ten .dll in Spring root rather messy. Would appreciate if you could find a way to link statically. Or at least to drop them somewhere far hidden into the AI subfolder tree.

Otherwise keep up the good work. Would be cool if it knew more about the special abilities, as I consider that AI play are for learning the game, so having the AI demonstrate all uses of all units is a must.

Also, how does it manage to use the dispatch button for instance? Maybe I need to know how you do that so that I don't break it, and so that I know how to make other special commands and powers easy to access to your AI.
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: [ANN] Baczek's KP AI 1.2

Post by hoijui »

@baczek:
zwzsg wrote:I find dropping ten .dll in Spring root rather messy. Would appreciate if you could find a way to link statically. Or at least to drop them somewhere far hidden into the AI subfolder tree.
this should alreayd be possible. place the dlls into a dir fodler called lib in the AI folder, eg:

Code: Select all

AI/Skirmish/BKPAI/0.1/lib/yourDll.dll
or possibly, if the dll wont change often you should be able to use this:

Code: Select all

AI/Skirmish/BKPAI/common/lib/yourDll.dll
both of these have not yet been tested, but i add these folders to the JVMs binary library path.
its qorth i try i guess.
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Re: [ANN] Baczek's KP AI 1.2

Post by zwzsg »

I tried dropping a bunch of Baczek's KP AI 1.2 into \AI\Skirmish\BaczekKPAI\1.2\lib and it didn't work:

Image

Doesn't look like the folders you mentionned are in the path.
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: [ANN] Baczek's KP AI 1.2

Post by hoijui »

DOH!
this lib dir works for java based AIs only! (if they want to dynamically load native libs).
sorry! was kind of away when i wrote that (once more).

edit:
is it possible to programmatically add a dir to the library path?
imbaczek
Posts: 3629
Joined: 22 Aug 2006, 16:19

Re: [ANN] Baczek's KP AI 1.2

Post by imbaczek »

it may be possible to change PATH on windows and LD_LIBRARY_PATH on linux during runtime, but no idea if it'll work. there may be a better way btw.
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: [ANN] Baczek's KP AI 1.2

Post by hoijui »

that were exactly my thoughs. including the 'there might be a better way'.

an other option would probably be to simply always load all dynamic libraries in the lib dir through dlopen(), before loading the actual SkirmishAI.so.
I see no negative effect with this, as long as the lib dir does not contian reduntant .so's
imbaczek
Posts: 3629
Joined: 22 Aug 2006, 16:19

Re: [ANN] Baczek's KP AI 1.2

Post by imbaczek »

what will happen if the ai ships with a different lib than spring already loaded...?
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: [ANN] Baczek's KP AI 1.2

Post by hoijui »

hmm.. i dont know, i guess things would go wrong :D

so you think AIs should not have the lib dir?

(btw, i fgured that the dlopen() way would not work anyway)
asking in a C++ forum, they said there is no other way to do this then chanigng the env vars.
Post Reply

Return to “AI”