debugging the whole thing - Page 2

debugging the whole thing

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

Moderators: hoijui, Moderators

User avatar
krogothe
AI Developer
Posts: 1050
Joined: 14 Nov 2005, 17:07

Post by krogothe »

okay debug modes working (thanks a lot chocapic!)
now the big problem is i get an error on startup on debug mode and not on release mode! this shouldnt be possible should it now? Im using the same code for both of them and running spring exactly the same way.
Im guessing it must be the project settings between debug and release, since on release it wont crash at all (on a metalmap) and on debug mode it will always crash on startup...

it looks like the problem comes from this line:

Code: Select all

for(map<int, string>::const_iterator j = units[i].def->buildOptions.begin(); j != units[i].def->buildOptions.end(); j++)
how would changing to debug mode mess it up?
User avatar
jcnossen
Former Engine Dev
Posts: 2440
Joined: 05 Jun 2005, 19:13

Post by jcnossen »

Changing build options can make bugs appear that otherwise slip through, because the variables are located at different addresses.. it's not the fault of debug mode though ;)

If it crashes there... you should be able to use the debugger to see what the current state is of those variables (though using a map<> doesn't make that easier..) You could've forgotten to set def correctly, or i....
User avatar
krogothe
AI Developer
Posts: 1050
Joined: 14 Nov 2005, 17:07

Post by krogothe »

Its unfortunate and ironic, thats one of the ~40 lines leftover from sub's code, and i havent got much clue how it works...
It was gonna be rewritten sometime but ill have to do that now to get rid of it now to be able to use debug mode
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

mwha, I reinstalled VS .Net last night. What was ti that chocapic said that got it working for you krogothe?
User avatar
krogothe
AI Developer
Posts: 1050
Joined: 14 Nov 2005, 17:07

Post by krogothe »

set the working directory as the spring directory (under project settings) and then run spring on compile (stick spring.exe on the little dialog that pops up once you compiled), should work fine from there, except for the fact that debug mode itself seems to crash KAI...
Post Reply

Return to “AI”