Page 1 of 1

Ai loading and usage in multiplayer games (missing ai dll)

Posted: 17 May 2006, 13:15
by krogothe
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!

Posted: 18 May 2006, 16:25
by krogothe
pulleeeeezzeeee
Image

Posted: 18 May 2006, 16:28
by AF
Try the 'realemptyAI' that spectre posted in the AI forum untill it's fixed, along with demos!!!(boost::spirit parsing error0

Posted: 18 May 2006, 17:40
by krogothe
I have ^_^ but its still annoying to have to run each new guy thru the same thing when its not really needed

Posted: 23 May 2006, 10:53
by krogothe
I think thats all thats needed! /* and */ (or a couple more for the other messages) please!! :cry:

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);
}

Posted: 23 May 2006, 10:55
by krogothe
double post :/

Posted: 23 May 2006, 20:37
by AF
But then if we dont have the AI dll in a single player wont there be problems? Or are they caught later on?

Posted: 24 May 2006, 18:16
by krogothe
AF wrote:But then if we dont have the AI dll in a single player wont there be problems? Or are they caught later on?
oh right! and how would you be able to start a single player game with a dll that doesnt even exist in first place??

Posted: 24 May 2006, 20:51
by AF
Custom scripts

Posted: 24 May 2006, 20:52
by krogothe
call me ignorant, but i think the population proportion that uses custom scripts for non-existant AIs should be around 0.01 compared to players that want to play with existing AIs in multiplayer

Posted: 24 May 2006, 21:06
by AF
If something can go wrong it will go wrong and someone will complain. Best to be sure

Posted: 26 May 2006, 14:32
by krogothe
Deeeeevvvvsssss please!

Posted: 26 May 2006, 18:27
by jcnossen
I second AF, spring has hacks enough already.

Anyway, we'll fix it before the next release ;)

Posted: 27 May 2006, 13:47
by krogothe
<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3
<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3

Posted: 27 May 2006, 15:11
by NOiZE
ewwwww

Posted: 27 May 2006, 15:17
by krogothe
NOiZE wrote:ewwwww
<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3
to you too