0.74B1 groupai crash help

0.74B1 groupai crash help

Here is where ideas can be collected for the skirmish AI in development

Moderators: hoijui, Moderators

User avatar
Bobcatben
Posts: 120
Joined: 10 Mar 2006, 17:01

0.74B1 groupai crash help

Post 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?
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

Not without any source code.

*move to AI forum*
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Post by Tobi »

moved
User avatar
Bobcatben
Posts: 120
Joined: 10 Mar 2006, 17:01

Post 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();
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Post by Tobi »

Which compiler did you compile it with?

You need to compile using MinGW, as Spring 0.74b1 is compiled using MinGW.
Kloot
Spring Developer
Posts: 1867
Joined: 08 Oct 2006, 16:58

Post by Kloot »

Or use the ABIC layer.
User avatar
Bobcatben
Posts: 120
Joined: 10 Mar 2006, 17:01

Post 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.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

Because they where all VS 2003 or above untill 0.74 when we switched to mingw32.
User avatar
Bobcatben
Posts: 120
Joined: 10 Mar 2006, 17:01

Post 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.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post 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.
User avatar
Bobcatben
Posts: 120
Joined: 10 Mar 2006, 17:01

Post by Bobcatben »

ah here we go, i compiled it with devc++, which uses gcc, and it works.
User avatar
Bobcatben
Posts: 120
Joined: 10 Mar 2006, 17:01

Post 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.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

They obviously havent changed a messagebox string.
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Post 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...
User avatar
Bobcatben
Posts: 120
Joined: 10 Mar 2006, 17:01

Post by Bobcatben »

any idea why it would generate that error when i push shift after my AI loads?
User avatar
Bobcatben
Posts: 120
Joined: 10 Mar 2006, 17:01

Post 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?
Kloot
Spring Developer
Posts: 1867
Joined: 08 Oct 2006, 16:58

Post 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).
User avatar
Bobcatben
Posts: 120
Joined: 10 Mar 2006, 17:01

Post by Bobcatben »

not sure, but im trying todo it with vc++ and abic now and its not working
Kloot
Spring Developer
Posts: 1867
Joined: 08 Oct 2006, 16:58

Post 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?
User avatar
Bobcatben
Posts: 120
Joined: 10 Mar 2006, 17:01

Post 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"
Post Reply

Return to “AI”