Page 1 of 3

0.74B1 groupai crash help

Posted: 05 Dec 2006, 02:06
by Bobcatben
i been working to get my groupai to compile for 74b1, i finnaly got it to compile, but it crashes once its loaded into the game, when it debugs, it shows it crashing when its trying to access the AI callback pointer, any ideas?

Posted: 05 Dec 2006, 12:54
by AF
Not without any source code.

*move to AI forum*

Posted: 05 Dec 2006, 13:58
by Tobi
moved

Posted: 05 Dec 2006, 16:15
by Bobcatben
thats just the thing, the lines its crashing on, or so the debugger says, are the same as any other ai code

Code: Select all

void CGroupAI::InitAi(IGroupAICallback* callback)
{
	this->callback=callback;
	aicb=callback->GetAICallback();

	commands.clear();
	CommandDescription cd;

	mode = on;

	srand(aicb->GetCurrentFrame());

}
the debugger says it crashes on

Code: Select all

	this->callback=callback;
	aicb=callback->GetAICallback();

Posted: 05 Dec 2006, 16:55
by Tobi
Which compiler did you compile it with?

You need to compile using MinGW, as Spring 0.74b1 is compiled using MinGW.

Posted: 05 Dec 2006, 16:58
by Kloot
Or use the ABIC layer.

Posted: 05 Dec 2006, 22:49
by Bobcatben
well that sucks, ive never used a compiler all by itself in windows, how come all of the ais, and spring itself still have vc++ projects then.

Posted: 05 Dec 2006, 22:50
by AF
Because they where all VS 2003 or above untill 0.74 when we switched to mingw32.

Posted: 05 Dec 2006, 22:56
by Bobcatben
can i make vc++ use mingw to compile it, or do i have to try to get it all to work in another ide and make it use it.

Posted: 05 Dec 2006, 23:06
by AF
You can make it in VS but you have to pass spring something compiled in Mingw32.

For Skirmish AIs however you can use anything as long as your using the C interface and not the c++ interface. If you're using the C++ interface (all the major AIs) your forced to use mingw32 to compile.

Posted: 05 Dec 2006, 23:14
by Bobcatben
ah here we go, i compiled it with devc++, which uses gcc, and it works.

Posted: 08 Dec 2006, 15:33
by Bobcatben
hmmm, now one of my groupais works fine, the other if you press shift after its loaded... spring blows up, says spring asked the vc++ runtime to terminate in a improper manner.... i thought spring wasnt compiled in vc++ anymore.

Posted: 10 Dec 2006, 02:18
by AF
They obviously havent changed a messagebox string.

Posted: 10 Dec 2006, 12:52
by Tobi
Every windows program uses MSVCRT.dll (or one of the later versions specific to VC 7 or VC 8 ). It doesn't have the slighest relation to the compiler used, only to the platform used...

Posted: 10 Dec 2006, 23:59
by Bobcatben
any idea why it would generate that error when i push shift after my AI loads?

Posted: 13 Dec 2006, 19:52
by Bobcatben
ok so, since i cant get it to be stable with gcc, im trying to use the abic layer thing, i did what it said but its still crashing like without it, is there anything special i need todo to make it use it?

Posted: 13 Dec 2006, 22:42
by Kloot
Which version of g++ are you compiling your AI with? The one bundled with devcpp is old, it should be 4.1 at a minimum (ABIC or not).

Posted: 13 Dec 2006, 23:02
by Bobcatben
not sure, but im trying todo it with vc++ and abic now and its not working

Posted: 13 Dec 2006, 23:27
by Kloot
Are you sure you are only including the ABIC headers, ie. that you aren't breaking pointer opacity somewhere by including headers from the regular interface or other parts of Spring (like unitdef.h and featuredef.h) as well? Also, when your AI dies, what (if anything) gets written to infolog.txt?

Posted: 14 Dec 2006, 01:21
by Bobcatben
nothing is written past the dummy global AI loading.

it wont compile if i dont include
"ExternalAI/IGroupAI.h"

and

"ExternalAI/IGroupAiCallback.h"