AF:
i am ok with removing group AI support.
damn...
i used specifYer in soo many places in the code :D
shit
well.. this place is actually the least problem, as it is only there for legacy support:
in the past, a lua ai had ot be declared like this:
as you always want as little change as possible for lobbies, i included this legazy support.. though.. thinking about it, it is quite stupid anyway, as you still had to change the lobby for it. i will remove it totally, and only leave the other option, which is cleaner anyway.
shortname is used cause it refers to the shortname in AIInfo.lua, which additionally contains a name (can be seen as the long name). it is like this, cause AIInfo.lua uses the same keys like ModInfo.lua (shortName, name, description, ...) so it will remain shortName, not id. the interface does not have to be specifyed in script.txt at all, the engine handles that.
for me it would be ok to go from this:
to this:
Code: Select all
[AI]
{
shortName=KAI;
version=0.666;
}
how would it be with options then? like this:
Code: Select all
[AI]
{
shortName=KAI;
version=0.666;
[OPTIONS]
{
divLevel=4;
otherOpt=0.1;
}
}
?
of course it is not problem to make the AI report an error when both a LuaAI and an.. other ai is specifyed.
well, if you want to know the interface better, i suggest checking out the branch amd looking at RAI, KAIK and NullAI (NullAI does not use the CppLegacy wrapper, but interfaces only with the new C interface). if you dont want to check out... ask specific questions, or read everything i wrote here in this thread.
new in unitsync:
Code: Select all
Export(int) GetSkirmishAICount();
Export(struct SSAISpecifyer) GetSkirmishAISpecifyer(int index);
Export(int) GetSkirmishAIInfoCount(int index);
Export(const char*) GetInfoKey(int index);
Export(const char*) GetInfoValue(int index);
Export(const char*) GetInfoDescription(int index);
Export(int) GetSkirmishAIOptionCount(int index);
the changes to script.txt are bound to the new interface stuff... so why would you want ot include them before the interface?
we can not specify shortName and version if we still use the old AI interface stuff (directly naming the sharedLibrary).
@DJ:
yes, it was lots of work

mainly the debugging, with which i had lots of problems (not beeing able to debug well, not understanding whats wrong, and so on)
you could now start with writing a C# interface library, if you want. if you do that, use the C interface as reference (described below), and forget about JAI. it is outdated/not using the new interface. i first have to port it.
though, you would still have to compile spring yourself as well. or is the build bot able to compile branches? i dont know, but it is not such a big deal to do it yourself. if you follow the guide here
http://spring.clan-sy.com/wiki/Engine_D ... nvironment, you could be ready in less then an hour (if you have not yet installed anything you need).
if you want to do that, have a look at the following files:
rts/ExternalAI/Interface/SAIInterfaceLibrary.h
AI/Interfaces/C/Interface.h
AI/Interfaces/C/Interface.cpp
AI/Interfaces/C/InterfaceExport.h
AI/Interfaces/C/InterfaceExport.cpp
for a start, you would have to copy AI/Interfaces/C/InterfaceExport.h to AI/Interfaces/CSharp/InterfaceExport.h eg, and then start writing your C -> C# interface code in AI/Interfaces/CSharp/InterfaceExport.cpp
am tired now, sorry if i forgot something, please ask again