Ai loading and usage in multiplayer games (missing ai dll)
Moderator: Moderators
Ai loading and usage in multiplayer games (missing ai dll)
As we all know, spring allows for AIs to be loaded from any computer and be played together in a game, with only the guy who added the bot really needing to have the AI. However, spring will complain and crash to ANY player who doesnt have the dll, even if the AI is not being loaded by them.
A fix is to rename emptyai.dll to whatever the AI you want to play against is (if it hasnt been released yet), but then people get spammed with messages (allies: X enemies: x or whatever code is in it) since it seems the AI gets loaded and used from both computers.
Im not sure about how hard it would be to make an AI only load from the computer that added it (its certainly possible since it still builds even if the non-ai loading players have renamed emptyAI.dlls), but it would be good to have, but PLEASE:
remove the couple of lines of code that give out the warning for missingAI Dll and crash spring for no reason. If they really do need to load something make it load emptyAI or something. It used to work fine a few spring versions ago as well, so i could hold public AI tests without coordinating everyone into renaming Dlls etc.
Thanks!
A fix is to rename emptyai.dll to whatever the AI you want to play against is (if it hasnt been released yet), but then people get spammed with messages (allies: X enemies: x or whatever code is in it) since it seems the AI gets loaded and used from both computers.
Im not sure about how hard it would be to make an AI only load from the computer that added it (its certainly possible since it still builds even if the non-ai loading players have renamed emptyAI.dlls), but it would be good to have, but PLEASE:
remove the couple of lines of code that give out the warning for missingAI Dll and crash spring for no reason. If they really do need to load something make it load emptyAI or something. It used to work fine a few spring versions ago as well, so i could hold public AI tests without coordinating everyone into renaming Dlls etc.
Thanks!
I think thats all thats needed! /* and */ (or a couple more for the other messages) please!!
Code: Select all
CGlobalAI::CGlobalAI(int team, const char* dll)
: team(team)
{
ai=0;
boost::filesystem::path l(dll,boost::filesystem::native);
/*if (!boost::filesystem::exists(l)) {
handleerror(NULL,dll,"Could not find AI lib",MBF_OK|MBF_EXCL);
return;
}*/
lib = SharedLib::instantiate(l.native_file_string());
GetGlobalAiVersion = (GETGLOBALAIVERSION)lib->FindAddress("GetGlobalAiVersion");
if (GetGlobalAiVersion==0){
handleerror(NULL,dll,"Incorrect Global AI dll",MBF_OK|MBF_EXCL);
return;
}
int i=GetGlobalAiVersion();
if (i!=GLOBAL_AI_INTERFACE_VERSION){
handleerror(NULL,dll,"Incorrect Global AI dll version",MBF_OK|MBF_EXCL);
return;
}
GetNewAI = (GETNEWAI)lib->FindAddress("GetNewAI");
ReleaseAI = (RELEASEAI)lib->FindAddress("ReleaseAI");
ai=GetNewAI();
callback=new CGlobalAICallback(this);
gh=new CGroupHandler(team);
ai->InitAI(callback,team);
}
Last edited by krogothe on 23 May 2006, 10:56, edited 1 time in total.

