 |
|  |
 |
|
Locutus
|
|
ACS CTP1/2 Manager & Civ4 Co-Manager
|
 |
Hengelo, The Netherlands
Nov 1999 time: 06:15
|
|
A few months ago, Harlan and I worked together on creating an improved version of the Alexander the Great Scenario that came with CtP2 (actually, we already started doing this even before CtP2 was released). Due to time contraints and technical difficulties we gave up on this after a while. Now, with most of the MedMod work done and with Harlan once again motivated to work on this, we decided to continue our work (actually, this was already a few weeks ago but school and other stuff kept me rather busy). Our plans are not nearly as ambitious this time as they were last time, mainly because Harlan plans on having this finished before Civ3 comes out but we still have some technical difficulties to work out and could use all the help we can get, esp. from SLIC coders. If anyone wants to help out with the project, please let us know, we would be very grateful.
Failing that, I'm would also be very happy if some of you could take a moment to look at the main problem we're currently dealing with and let us know what you think. Stray thoughts, suggestions, complete solutions, anything is welcome, 'cause quite frankly I'm bummed Here it is:
The problem has to do with large stacks. If in CtP2 an army is moving from A to B and it along the way encounters another of the same civ, one of two things can happen. If the size of both armies combined is smaller or equal to 12, the moving army continues along its way without disruptions (no problems here). However, if both armies combined are larger than 12, the moving army stops right in front of the second army and does nothing. It will fortify and wait until the blocking army moves out of the way. However, if this other army is standing in that position because it's defending a city or some other defensive point, the army that was moving to a target will be stuck behind this defensive army forever (unless the goal it was trying to achieve no longer exists). The moving army never decides to deviate from the shortest path and continue via a detour or split up and send the army through in parts, it simply sits there and does nothing. In the Alexander the Great Scenario this is quite a problem because there are a lot of road chokepoints surrounded by desert or mountains and a defensive army in or near FE Tarsus can block any Persian reinforcements from reaching the Ionian cities when the Macedonians are conquering these. This is not the only case though and overall it really decreases AI performance (it's not unusual to have 3 or more stacks stuck behind a defensive chokepoint), in Harlan's eyes it even makes the scenario unplayable. Problems in solving this is 1) there is, as far as I can see, no proper way of detecting when units are stuck like this and 2) actually getting the units passed the blocking stack. I have no idea how to deal with the first problem and as far as the second problem goes, I can come up with some radical things such as teleporting the stack or destroying the blocking stack, but it's still difficult to detect where the stack was going in the first place and working out the details.
Any help anyone could give us would be very much appriciated...
|
|
|  |
 |
|
Immortal Wombat
|
 |
in perpetuity
Dec 2000 time: 05:15
|
|
It all depends on finding out which stack is defending, and which is trying to move...
How about something that fires when a unit is fortified outside a city, which keeps a record of how long the units have been there. Then, after 10 turns or so, however long seems to work best, to create invisible railroads like player1 suggests, next to the tile the stack is in.
The enemy AI shouldn't be able to use it, because it can't move into the enemy ZOC, but the reinforcements behind the defensive stack will. Once it attempts to use it, you can reset the fortification turn counter, and pillage the railroads. Maybe you could pillage before the reinforcements use it, but so they still complete the move Then the route would be changed, but the goal the same. If not, then the AI gets a small movement bonus each time. (Its not like it will use it to cheat on the human...)
|
|
|  |
 |
|
Locutus
|
|
ACS CTP1/2 Manager & Civ4 Co-Manager
|
 |
Hengelo, The Netherlands
Nov 1999 time: 06:15
|
|
Okay, I give up, I'm gonna need your help once again guys: can anyone tell me why the code below doesn't work? I'm probably overlooking something really stupid but I can't get the game to produce tile improvements (rest of the the code works fine)...
code: HandleEvent(EntrenchUnit) 'AG2_CreateRailRoad' post {
location_t tmpLoc;
unit_t tmpUnit;
int_t i;
tmpUnit = unit[0];
Message(g.player, 'AG2_GotHere'); // test code
for (i = 0; i < 8; i = i + 1) { // check all neighbours
Message(g.player, 'AG2_GotHere2'); // test code
GetNeighbor(tmpUnit.location, i, tmpLoc);
Terraform(tmpLoc, 1); // test code
Event:CreateImprovement(0, tmpLoc, 1, 0); // this doesn't work!!!
}
}
// messages are for testing purposes only, string ripped from info_str.txt
Messagebox 'AG2_GotHere' {
Text(ID_IA_PILLAGE_SUICIDE);
}
Messagebox 'AG2_GotHere2' {
Text(ID_IA_TERRAFORM_DEAD_TILE);
}
|
|
|  |
 |
|  |
All times are GMT. The time now is 05:15. Apolyton Time is 00:15. |
top of page
|
| archivepost |
|
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
|
|
|
|
|
|