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: infrastructure
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
Peter Triggs is offline Peter Triggs
Prince
Gone Fishin, Canada
Jan 2000
time: 05:32
  Old Post 30-11-2003 15:13
Edit/Delete Message Reply w/Quote
#1 Report this post to a moderator
DEBUG: infrastructure Inflate your Upload Space

Some time ago I noticed that you can't create a custom build queue with 'infrastructure' in it. I tracked it down to ui\interface\EditQueue.cpp:

code:
case k_GAME_OBJ_TYPE_INFRASTRUCTURE: c3files_fprintf(saveFile, "CAP\n"); break; case k_GAME_OBJ_TYPE_CAPITALIZATION: c3files_fprintf(saveFile, "INF\n"); break;


After making the obvious change, you can create custom queues that correctly contain these items, and save them. But you can't load them. I tried using the VC++ debugger (first time) but didn't get anywhere. Any help here would be appreciated.

Fromafar is offline Fromafar
Prince

May 2003
time: 06:32
  Old Post 03-12-2003 00:23
Edit/Delete Message Reply w/Quote
#2 Report this post to a moderator
Get a bigger avatar today!

It is a bit difficult to offer help on the VC++ debugger without knowing more details (what are you trying to do? what does/doesn't work?).

But anyway, you may even run the debug executable without using the debugger. When attempting to load the new build queue, you should get an Assert (failure) popup.
This will direct you to BuildQueue::Load in gs\gameobj\bldque.cpp.

Peter Triggs is offline Peter Triggs
Prince
Gone Fishin, Canada
Jan 2000
time: 05:32
  Old Post 03-12-2003 04:00
Edit/Delete Message Reply w/Quote
#3 Report this post to a moderator
Support Apolyton, buy Civilization III: Complete

Thanks, I think I've got it now. These lines were missing from BuildQueue::Load,

code:
case 'C': Assert(buf[1] == 'A' && buf[2] == 'P'); if(buf[1] == 'A' && buf[2] == 'P') { category = k_GAME_OBJ_TYPE_CAPITALIZATION; type = 0; } else { continue; } break; case 'I': Assert(buf[1] == 'N' && buf[2] == 'F'); if(buf[1] == 'N' && buf[2] == 'F') { category = k_GAME_OBJ_TYPE_INFRASTRUCTURE; type = 0; } else { continue; } break;


It seems to work now, but I'll try it a few more times with different queues to be more sure.

Actually, what I was really interested in is the question "Why doesn't the AI use infrastructure?" I've tracked this one down, too, and have got them using it. The problem now is to get them to stop using it: infrastructure and capitalization never get built, so they'll just stay there.

child of Thor is offline child of Thor
Emperor
UK
Jan 2002
time: 05:32
  Old Post 03-12-2003 23:35
Edit/Delete Message Reply w/Quote
#4 Report this post to a moderator
Get a bigger avatar today!

quote:
Originally posted by Peter Triggs ......edit........

Actually, what I was really interested in is the question "Why doesn't the AI use infrastructure?" I've tracked this one down, too, and have got them using it. The problem now is to get them to stop using it: infrastructure and capitalization never get built, so they'll just stay there.


I never thought i'd find something funny in one of these types of threads
Just out of curiosity Peter, the code you come up with to fix certain problems; is it already in the program but not finished , or do you create it from scratch? thanx for the smile

Peter Triggs is offline Peter Triggs
Prince
Gone Fishin, Canada
Jan 2000
time: 05:32
  Old Post 04-12-2003 00:17
Edit/Delete Message Reply w/Quote
#5 Report this post to a moderator
Support Apolyton buy from Amazon

In this case - the code that I wrote today that does get them to stop using infrastructure/capitalization - it was adapted from something that I'd previously written in SLIC. But sometimes, like the code I quoted immediately above, it was just a matter of noticing that those lines were in Editqueue but not in Buildqueue.

Martin Gühmann is offline Martin Gühmann
Emperor
Berlin, Germany
Mar 2001
time: 06:32
Post  Old Post 04-12-2003 21:34 Visit Martin Gühmann's homepage!
Edit/Delete Message Reply w/Quote
#6 Report this post to a moderator
Browse Apolyton AD-FREE

How did you solve this problem, Peter. Do you remove infrastructure/capitalization from the build queue and let the AI decide again or do you make the to reconsider its decision.

-Martin

Peter Triggs is offline Peter Triggs
Prince
Gone Fishin, Canada
Jan 2000
time: 05:32
  Old Post 05-12-2003 06:13
Edit/Delete Message Reply w/Quote
#7 Report this post to a moderator
Browse Apolyton AD-FREE

I put in a few lines so that whenever it discovers an advance, it looks through it's cities and clears the buildqueue's of those cities that have infrastructure or capitalization on top. There's already code in the game that will clear an AI's buildqueue on the first turn of war, so I think this should be ok. If there's a problem, we can clear the buildqueue of any AI civ that is at war but is using infrastructure/capitalization.

BTW, if you haven't come across this and you want to see something incredibly complicated, switch on k_DBG_SCHEDULER in main_InitializeLogs of civ3_main.cpp. The options for this are set in c3debug.h:

quote:

typedef void (* CivExceptionFunction) (void);

#define k_DBG_ALL 0xffffffff
#define k_DBG_NONE 0x00000000
#define k_DBG_INFO 0x00000001
#define k_DBG_AI 0x00000002
#define k_DBG_NET 0x00000004
#define k_DBG_GRAPHICS 0x00000008
#define k_DBG_DATABASE 0x00000010
#define k_DBG_FILE 0x00000020
#define k_DBG_GAMESTATE 0x00000040
#define k_DBG_UI 0x00000080
#define k_DBG_FIX 0x00000100
#define k_DBG_SLIC 0x00000200
#define k_DBG_SCHEDULER 0x00000400
#define k_DBG_SCHEDULER_DETAIL 0x00000c00
#define k_DBG_SCHEDULER_ALL 0x00001c00
#define k_DBG_DIPLOMACY 0x00002000
#define k_DBG_MAPANALYSIS 0x00004000


You can choose any combination of these in the above function.

But beware, k_DBG_SCHEDULER, which prints out the debug info for how the AI 'tasks it's units', spews out up to 5 m of log files per turn. Azmel must have the patience of a saint.

  < Last Thread     Next Thread > Post New Thread     Post A Reply
All times are GMT. The time now is 05:32.
Apolyton Time is 00:32.
    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.0448 seconds (88.87% PHP - 11.13% 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