 |
|  |
 |
|
NelsonAndBronte
|
|
One request (From Peter Triggs) was around exposing the number of passes the AI uses to compare its armies against goals. This number is at present hard coded in Scheduler.cpp :
code:
sint32 Scheduler::s_max_match_list_cycles = 6;
I changed this line to
code:
sint32 Scheduler::s_max_match_list_cycles = g_theConstDB->GetMaxMatchListCycles();
And added to Constdb.h
code:
//added DWT
sint32 m_max_match_list_cycles;
//added DWT
sint32 GetMaxMatchListCycles() const { return m_max_match_list_cycles; }
Finally added to Constdb.cpp a new token TOKEN_MAX_MATCH_LIST_CYCLES, which corresponds to a const.txt name of MAX_MATCH_LIST_CYCLES.
If I've done this all correctly, all you need to do is to add a new entry MAX_MATCH_LIST_CYCLES to Constdb.txt and you can set the number of passes to whatever you want.
Hopefully I'll will receive the game soon to try this out myself!
Attachment: maxpasses.zip
This has been downloaded 5 time(s).
|
|
|  |
 |
|
Peter Triggs
|
|
Gone Fishin, Canada
Jan 2000 time: 05:31
|
|
Thanks, NelsonandBronte,
Now all I've got to get is MS VC++6 so that I can try this out.
|
|
|  |
 |
|
Fromafar
|
|
Yeah, the static variable will be initialised right at the start of the program, before g_theConstDB will have been created.
Fortunately, there is an easy solution. Because s_max_match_list_cycles is only referenced once, you may remove/bypass it completely, and replace the occurrence in CtpAi.cpp with a direct call to g_theConstDB->GetMaxMatchListCycles().
At the time of the call, the database(s) will have been loaded.
|
|
|  |
 |
|
Fromafar
|
|
Hi Martin,
Did you include the wrong version of constDB.cpp in the altered source code update? After downloading, I got the "extra comma" problem that you reported some posts ago.
Another problem is that this modification requires const.txt to be updated. Unfortunately, this does not only apply to the regular game (included in the update), but also to the scenarios.
I think we have to add some mechanism to make the variables optional in const.txt, and use the original hardcoded value (6) when missing.
Last edited by Fromafar on 22-11-2003 at 23:53
|
|
|  |
All times are GMT. The time now is 05:31. Apolyton Time is 00:31. |
top of page
|
|
|
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
|
|
|
|
|
|