Page 1 of 1
How to get an AI working in x86_64 linux?
Posted: 08 Nov 2007, 23:00
by tunafish
I installed spring and springlobby, xta and a few maps. Spring starts up fine when I put in just one player, but game ends instantly after the countdown. (obviously).
When I started trying to get an AI working, things started to get hairy.
AAI that came with the game complains lack of some files, and says to look in a log for details. however, I cannot find the log where it claims it to be. some log files were created under .spring/AI, but they are empty.
The KAI that came with the game starts otherwise fine, but instantly after the countdown spring freezes, and starts to use ever more memory. I killed it some time after it had gone past 3gig, I only have 1 gig on the machine so it was obviously completely frozen at that time with 2 gig in swap.
The KAI 0.2 I found for 64bit linux did the same thing.
I couldn't find any other ai's for 64 bit, and 32 bit ones crash instantly at the beginning of the game.
Please help, I just want a working AI.
Posted: 08 Nov 2007, 23:46
by imbaczek
Your best bet is to compile spring from source. Look around the forum and/or wiki for details.
Posted: 09 Nov 2007, 02:02
by LordMatt
Well I compiled from source and I still can't use AIs (or at least I can't use the empty/test AI).
Posted: 09 Nov 2007, 13:37
by BrainDamage
LordMatt wrote:Well I compiled from source and I still can't use AIs (or at least I can't use the empty/test AI).
did you test that by launch directly spring and select "test AI xyz " directly from menu?
FYI you can't detect/select them using tasclient under wine due to evident incompatibilities
Posted: 09 Nov 2007, 14:33
by LordMatt
Hmm I tried making a symbolic link to /usr/local/lib/spring/AI in my wine folder but it still doesn't show the AIs. How to fix?
Posted: 09 Nov 2007, 16:01
by BrainDamage
LordMatt wrote:Hmm I tried making a symbolic link to /usr/local/lib/spring/AI in my wine folder but it still doesn't show the AIs. How to fix?
tasclient can't read symbolic links, and searches only in the windows installation dir
even if it would one of the above, you'd have to edit tasclient so it would list .so togheter with .dll (or instead)
to finish, wine translates linux paths to windows paths (example z:\usr\share\springAI\...) so you'll have to edit the script manually afterwards or it will pass the wrong AI path to spring
conclusion: linux AI + tasclient under wine = won't happend
solution: use a cross-platform lobby and will work out the box
Posted: 09 Nov 2007, 16:09
by LordMatt
Brain Damage wrote:
tasclient can't read symbolic links, and searches only in the windows installation dir
Not true, TASClient has no difficulty reading my maps, mods, etc. through symbolic links (see wiki, installation of TASClient with wine).
Brain Damage wrote:
even if it would one of the above, you'd have to edit tasclient so it would list .so togheter with .dll (or instead)
Could I link a .so file to a .dll file?
Brain Damage wrote:
to finish, wine translates linux paths to windows paths (example z:\usr\share\springAI\...) so you'll have to edit the script manually afterwards or it will pass the wrong AI path to spring
Well how does it send all the other paths correctly?
Brain Damage wrote:
conclusion: linux AI + tasclient under wine = won't happend
solution: use a cross-platform lobby and will work out the box
I don't wanna.

Posted: 09 Nov 2007, 16:20
by BrainDamage
LordMatt wrote:Brain Damage wrote:
tasclient can't read symbolic links, and searches only in the windows installation dir
Not true, TASClient has no difficulty reading my maps, mods, etc. through symbolic links (see wiki, installation of TASClient with wine).
well, for me doesn't i guess my wine has something wrong
LordMatt wrote:[Could I link a .so file to a .dll file?
yes, tasclient would then send the path to that symbolic link (wasn't aware that they'd work for someone), even tho, as i posted would use a windows path wich is incompatible
LordMatt wrote:Well how does it send all the other paths correctly?
easy: it doesn't, if you look at the script, while maps & mods are sent just by pointing the name (since they are handled by the spring virtual file system)
Code: Select all
Mapname=Archers_Valley_v1.smf;
GameType=xtape.sd7;
as you saw in the wiki instructions, you had also to send the address of the data folders in spring editing .sprinrc so it would find the relative paths using vfs
the ais are sent as full path
Code: Select all
AiDLL=/usr/share/games/taspring-linux-svn/AI/Bot-libs/AAI.so;
try to do the symbolic link of an AI in your wine AI data folder, then try to launch spring
it should fail, then look at wich path tasclient used in the script file and you'll see a windows-like path wich is incompatible with linux builds of spring
EDIT: i looked at the guide, i was right, you're not reading symbolic links trought tasclient, you're reading them trought spring, wich is different, your maps/mods are in the wine folder, and the link in in the spring data (wich is indexed by vfs and supports symbolic links), try to invert the things (eg. put your maps/mods in your linux data folder and do a symbolic link in the wine folder) and it tasclient will stop detecting them
Posted: 09 Nov 2007, 17:52
by AF
=s I cant see how braindamage figured out that you were using tasclient despite you saying you used springlobby at the top.
Have you tried the native versions of both aflobby and spring lobby?
Posted: 09 Nov 2007, 18:20
by tunafish
Yes. i don't think the problem is the lobby. KAI 64-bit build just appears to be bugged somehow (like stuck in a loop and continuously allocating more memory.)
I'm a developer myself, so I'm looking at debugging this but so far I'm out of luck.
How do you debug the AIs in this project anyway?
Posted: 09 Nov 2007, 18:33
by LordMatt
AF wrote:=s I cant see how braindamage figured out that you were using tasclient despite you saying you used springlobby at the top.
Have you tried the native versions of both aflobby and spring lobby?
He was responding to me, not the OP.
Posted: 09 Nov 2007, 18:53
by AF
ah, in that case
tunafish, have you tried aflobby? Does ti give the same issue?
Posted: 09 Nov 2007, 23:58
by LordMatt
Brain Damage wrote:
yes, tasclient would then send the path to that symbolic link (wasn't aware that they'd work for someone), even tho, as i posted would use a windows path wich is incompatible
Well it turns out that's not what happens. If I link
Code: Select all
/usr/local/lib/spring/AI/Bot-libs/TestGlobalAI.so
to
Code: Select all
/home/matt/.wine/drive_c/Program Files/Spring/AI/Bot-libs/TestGlobalAI.dll
I get
Code: Select all
AIDLL=AI/Bot-libs/TestGlobalAI.dll
in my script.txt.
Then with sed I change the line to
but I still get an error.
Edit: got it working when I added the rest of the path with sed to make
Code: Select all
AIDLL=/usr/local/lib/spring/AI/Bot-libs/TestGlobalAI.so;