Apolyton Archive  |  Preserved copy of the Apolyton Civilization Site and its forums as they stood in September 2005. Read-only; nothing here can be posted to or replied to.  |  Forum index |  About this archive |  The 1998–2001 UBB forums
Today on Apolyton WARDELL INTERVIEW PROMO A.C.S. HISTORY CHAPTER 4 GET CIV4 /w FREE PLUS! A.C.S. PHOTO GALLERY GET A.O.M. V1.1
Apolyton Civilization Forums
main| civ2| civ3| civ4| smac| ctp2| ron| moo3| galciv| galciv2| alt| about|
ApolytonPLUS | register | search | faq | new posts | pm (-/-) | upload | members
hall of fame new! | civgroups | civgroups news | interviews | the column | radio | chat | directory | news | store | PLUS
Apolyton Civilization Forums : Powered by vBulletin version 2.0.3 Apolyton Civilization Forums > Call To Power II > CtP2-Source Code Project > DEBUG: How to debug?
Show a Printable Version | Email This Page to Someone! | Receive updates to this thread | Report this to Apolyton news!
CivGroups
CTP2 Source Code Project (59): Not a Member - Join

bottom of page
  
Author
Thread    < Last Thread     Next Thread > Post New Thread     Post A Reply
Lui2 is offline Lui2
Chieftain
Saarbruecken
May 2004
time: 06:36
  Old Post 04-06-2004 02:53
Edit/Delete Message Reply w/Quote
#1 Report this post to a moderator
DEBUG: How to debug? Suffering from ads?

I'm interested in understanding how the game works and maybe will someday also help to fix some errors.

I've downloaded the source and compiled and linked the exe for Win32 Debug with VS6.0.

Had no problems to debug the program startup. But when it comes to the execution of some specific stuff in the yyparse function of ldl.tab.c file, the program takes control over the debugger (as far as i guess) and I can't debug anymore what's happening.

Can someone give me some hints, what I have to do, so I can debug throug the C++ source code during a game.

Is it only possible with a remote debug or exist other easier ways?

Played also around with the starting parameters "runinbackground" and "nonexclusive" but this did not help.

Solver is offline Solver
Apolyton Duke Of Something
Latvia, Riga
Sep 2000
time: 07:36
  Old Post 04-06-2004 14:33 Visit Solver<br><img src=/forums/images/staff-icon.gif>'s homepage!
Edit/Delete Message Reply w/Quote
#2 Report this post to a moderator
Suffering from ads?

When you run the debug version of the game, Win32 Debug, it will create a number of log files, in the logs folder and in the game folder itself. From these you can track down call stack and events pretty well, as well as see what the memory leaks are. They're probably the most useful thing when debugging CtP2.

Fromafar is offline Fromafar
Prince

May 2003
time: 06:36
  Old Post 04-06-2004 22:09
Edit/Delete Message Reply w/Quote
#3 Report this post to a moderator
Support Apolyton or Terrorists Win

FWIW, I have "nointromovie nonexclusive" as program arguments for debugging.

The first one should not really matter - apart from saving you some time at start-up.

Without the second one, I used to lose control at the end of ui_Initialize in civ3_main.cpp. With it, 2 cursors (the usual Windows one and the CTP2 hand) will appear, and I am able to switch between the application and the debugger. However, the debugger is a bit slow when switching. It takes about 1 or 2 seconds to get responsive. But apart from that, it works fine.
If your video card supports it, and you have a second monitor, you may want to try out the "multimon" option instead. I can't use it, because my video card does not support more than 1 monitor.

When stepping through one of the files that have been generated by Lex and Yacc, you may get confused somewhat. Guided by the generated #line-statements, the debugger will sometimes switch to the input file (ldl.y in your case). Unless you really want to debug these specific files, you may avoid this by simply not stepping into ldlparse/yyparse when debugging.

Lui2 is offline Lui2
Chieftain
Saarbruecken
May 2004
time: 06:36
  Old Post 05-06-2004 21:22
Edit/Delete Message Reply w/Quote
#4 Report this post to a moderator
Inflate your Upload Space

Thanks that you took the time to answer my question.

Meanwhile I also added the parameter "notimeslice" and the debugging now works nearly perfect, also without a second monitor.

EDIT:
And it's also a good idea to deactivate virus scanning on the directories the c++ compiler writes to.

Last edited by Lui2 on 13-06-2004 at 13:26

drulius is offline drulius
Warlord
Lubbock, Tx USA
Jan 1970
time: 23:36
  Old Post 05-07-2004 03:22
Edit/Delete Message Reply w/Quote
#5 Report this post to a moderator
Browse Apolyton AD-FREE

I have successfully compiled and built a _dbg.exe with the 2004.06.05.CTP2.All.zip code compilation.

Should I be able to execute the _dbg.exe immediately after the build completes? The way I got it to work was to copy the _dbg.exe and a .dll (anet2?) to the directory where my playtest game is installed. Then I changed the project/debug path setting to the game dir path from the code dir path. Now I can start the game by pressing F5 in vc++. I have played about 50 turns this way. With 23 AI civs, I saw the "NO_CONTACT_DECLARE_WAR" assertion failure on about 35 of the turns.

I added the "nointromovie nonexclusive notimeslice" program arguments, and I can sometimes see the two cursors. But I can never use either one independantly, and most attempts to force vc++ to the top hang both programs. If an assertion pops up, I can click retry and go to vc++ or click ignore and go back to the game. But otherwise, once the game starts going I'm locked into playing unless an assertion pops up. Is there a way to toggle between the game and the debugger with a keypress or something?

I was able to load a saved game started with the playtest build from early May (the last one posted in .zip format) Once it loaded, I noticed the movement delay bug mentioned in the playtest thread, this behavior did not exist when I originally saved the playtest game.

When I ended the first turn, it took about 50 minutes for it to be my turn again (about 30 civs). During that time at least half of the AI civs threw an assertion failure at gs/slic/sliccmd.cpp line 414 where it seems a certain struct sliccmdExpValue (v) has a ->type but not a ->sym

code:
Assert(v->type == EXP_VAL_SYM || v->type == EXP_VAL_TEMP_SYM); SlicSymbolData *sym = (SlicSymbolData *)v->sym; Assert(sym); // line 414 if(!sym) { strcpy(sliccmd_output, ""); return; }


I also saw a couple of "NO_REFUEL_BASE" (not exact) assertion failures before AI fighters dropped out of the skies. (couldn't see them, heard them crash)

When I ended the next turn, both programs hung during the second or third AI's turn. But since I had walked away, the hang might be because my computer went into sleep mode while I was away. (I had to completely reboot through "ctrl-alt-delete shutdown" to get back)

What's the best way to configure my system to assist the project? I get lost in the code pretty easily, but I can accurately report what happens when things act up. I plan to update as soon as the next .all code changes pack is issued, and then to stay up to date as each new change is posted. Any other suggestions?

Lui2 is offline Lui2
Chieftain
Saarbruecken
May 2004
time: 06:36
  Old Post 05-07-2004 04:32
Edit/Delete Message Reply w/Quote
#6 Report this post to a moderator
Help yourself to an AD-FREE life

I also use the parameter "runinbackground" and can easily switch between the VC++ and the ctp2 application with CTRL-TAB. But I'm not sure, if that is the reason for your problems.

Sometimes the screen is a bit mixed but by repeating CTRL-TAB i can always get it right.

Check that you have a clean installation without any mods and than add the changed source code and data files.

And take care about virus checkers. They slowed my start of debugging with a factor of 100 or so. Now the game starts in debugging mode nearly as fast as the normal game.

The "NO_CONTACT_DECLARE_WAR" assertion will be called when a slave driver is making a raid for slaves and the civilization of the attacked city had no contact before with the owner of the slave driver. I have this on my lists to change to suppress this assertion warning.

Martin Gühmann is offline Martin Gühmann
Emperor
Berlin, Germany
Mar 2001
time: 06:36
Post  Old Post 05-07-2004 21:00 Visit Martin Gühmann's homepage!
Edit/Delete Message Reply w/Quote
#7 Report this post to a moderator
Support Apolyton

I wouldn't run a game in debug mode with 32 civs or 28 civs, with so many civs in the game the game is slow already slow even in a non debug invironment. With all the extra stuff that is done in the debug version like logging and writing events to a file you can expect to see the game much slower then in a non debug invironment, the slowdown is even notable with 10 players but at least manageable.

-Martin

calvitix is offline calvitix
Chieftain
Strasbourg (North-Est France)
Jun 2003
time: 05:36
  Old Post 29-07-2004 11:06
Edit/Delete Message Reply w/Quote
#8 Report this post to a moderator
Getting AI Logs Support Apolyton, buy Civilization III: Complete

Hello,

Question about Logs :
I can get the diplomacy logs, main logs civ3logsxxx.txt, but I didn't manage to get the AI logs. could anyone help me ?

I try several Playtest commands
(god to see the entire map,
armyText to see the army goal on the screen,
...)

but the command ailog debug_level team_idx doesn't seems to work :

I saw in source code 4 levels of log (OFF -> Detailled)
but the command ailog in C3Cmdlines seems to be empty.

the command aidebug goal_type player didn't succes as well.

Martin Gühmann is offline Martin Gühmann
Emperor
Berlin, Germany
Mar 2001
time: 06:36
Post  Old Post 29-07-2004 22:51 Visit Martin Gühmann's homepage!
Edit/Delete Message Reply w/Quote
#9 Report this post to a moderator
Lose 30 kilos (of popups)

I think they would be written into the civ3logsxxx.txt files the was a line in the source, that has to be changed to enable all logs or a selection of the logs. But I can't recall were to find them. Peter posted a bout them.

-Martin

  < Last Thread     Next Thread > Post New Thread     Post A Reply
All times are GMT. The time now is 05:36.
Apolyton Time is 00:36.
    top of page
Rate This Thread:
Forum Jump:
Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is ON
vB code is ON
Smilies are ON
[IMG] code is ON
 




Contact Us - Apolyton Civilization Site - Support Us!

Building a better Apolyton through better information. Click here and take our poll!
Non-US visitors, click here!

Powered by: vBulletin Version 2.0.3
Copyright ©2000, 2001, Jelsoft Enterprises Limited.

Page generated in 0.0361 seconds (86.83% PHP - 13.17% MySQL) with 36 queries
Page Loading Time:

Support Apolyton: Amazon USA | Amazon UK | Amazon DE | Amazon FR |
Support Apolyton and get FREE PLUS, Buy from Chips&Bits: Galactic Civilizations | Galactic Civilizations: Deluxe Edition | Call to Power 2 | Civilization: The Boardgame | GURPS/ Alpha Centauri | Alpha Centauri | Civilization IV | Civilization III: Complete |


Front Page | Civilization IV | Civilization III | Civilization II | Call to Power II | Alpha Centauri | Master of Orion III
Rise of Nations | Galactic Civilizations | Galactic Civilizations II | Misc
Alt.Civs | Civ I | C:CtP I | About | News | Directory | Apolyton Store | Forums | Chat | Columns | Interviews | Newsletter
Scenario League | CSC | Clash of Civs | Spanish Site | CtP Maps | Cradle of Civ | WesW's Ctp1/2 Site | Civ3 Haven

apolyton.net | apolyton.com | civilization2.net | civilization3.net | civilization4.net | civilizationiv.info | calltopower.net | galciv.net | galciv2.net | moo3.net