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 > AI : Army Movement
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   
Pages (4): [ 1   2   3   4   ]
< Last Thread     Next Thread > Post New Thread     Post A Reply
calvitix is offline calvitix
Chieftain
Strasbourg (North-Est France)
Jun 2003
time: 05:34
  Old Post 13-08-2004 20:29
Edit/Delete Message Reply w/Quote
#1 Report this post to a moderator
AI : Army Movement Got spare money?

Hi,

As I don't have any network skills, I began to work on AI understanding, specially the unit movement.

There's some playtest commands (ie with a DEBUG executable) that are very useful to understand the units' movement.
(to activate them, use the 'Command enter alternate (playtest)' Bind and then write the code)


armytext : to see the unit's Goal on the screen. I enhanced the command to see the target's coords (X,Y)
(see thread altered sources)

god : to take on or off the 'fog of war'. useful to see what the other Civs are doing. Problem, when the fog of war is Off, the AI is able to 'see' all the map too and its behavior changes. So I usually toogle it Off at the end of each turn to see what's going on, and then toogle it On before pressing Enter.

celltext : to see a value of each mappoint (used by the Settlers to find a city place).



Here's a list of my observations :

- Chokepoint : On map with islands, a lot of units are affected to Goal Chokepoint (to protect a particular point on the map, with strategic interest). The problem is that some 'chokepoints' are bad chosen

- Squad problem : the AI don't seems to group the units that have the same goal: Each unit is considered as a single squad. the only case where the group seemes to work is when a settler needs protection. I'm working on an additional algorithm to group the unit with the same goal.

- Sea transport : the algorithm seems good : when a unit has to go on another continent, it get the nearest available transport and a rally point is automatically defined. sea assault with only one or two units is the consequence of the squad problem.
It would be good to implement an escort algorithm for the sea transport units (as it exists for settlers).

- threat calculation : problem with threat calculation : too many units are affected to the goal_defend, due to a very high threat value. that's why AI sometime has got a lot of units around its city (all are affected to the city defense).
I'll make a try with a 12-units limitation for one goal. For the moment, I didn't find the origin of the problem.


I don't know if anyone else is looking for the same improvements, any experience or help w'd be appreciated...
(for people that don't have the possibility to compile the source code and want to use the playtest commands,
it is possible to give them the compiled CivCTP_dbg.exe)

Attachment: armytext.jpg
This has been downloaded 333 time(s).

E is offline E
King
July 24,2005 Ctp2 Tiles in sig!
May 1999
time: 21:34
  Old Post 13-08-2004 21:08 Visit E's homepage!
Edit/Delete Message Reply w/Quote
#2 Report this post to a moderator
Support Apolyton

I dont think anyone else has gotten into the AI except for mods. If you could fix these that would be sweet.

One question on chokepoint. Is it feasible for the computer to identify a tile with a GOOD and defend it because it has a good? This would be needed for implementing strategic resources...

Martin Gühmann is offline Martin Gühmann
Emperor
Berlin, Germany
Mar 2001
time: 06:34
Post  Old Post 15-08-2004 03:51 Visit Martin Gühmann's homepage!
Edit/Delete Message Reply w/Quote
#3 Report this post to a moderator
Re: AI : Army Movement Support Apolyton or Terrorists Win

quote:
Originally posted by calvitix
- Squad problem : the AI don't seems to group the units that have the same goal: Each unit is considered as a single squad. the only case where the group seemes to work is when a settler needs protection. I'm working on an additional algorithm to group the unit with the same goal.


I think this is the most important problem, a part of my BetterAi slic code is about grouping units. I saw an improvement afterwards I grouped them with slic. Looks like if I add the NeedsEscord flag to the attack goal I would make the AI to group the units for attack. And removing this flag would keep the AI from binding troops to settlers. However I think there should be a different algorithm for attack grouping, maybe it could be bind to the RalleyFirst flag. However grouping units for defence in cities might be a problem, because if you have 12 units there and the city is building a new unit you don't have space. So one unit should leave the city before the build event, or if the city is full the unit should be created outside of the city, but with less move points.

quote:
Originally posted by calvitix - Sea transport : the algorithm seems good : when a unit has to go on another continent, it get the nearest available transport and a rally point is automatically defined. sea assault with only one or two units is the consequence of the squad problem.
It would be good to implement an escort algorithm for the sea transport units (as it exists for settlers).


Maybe there is also an problem if the squads are to huge for the transport. Afterwards I grouped my units via slic I didn'd saw full transports, and even loading these transports by slic was tricky. If there is enough room on the transport for the stack no problem, but the stack is too big then I had to ungroup the units myself and give every unit the transport order and I think there was another problem.

quote:
Originally posted by calvitix
- threat calculation : problem with threat calculation : too many units are affected to the goal_defend, due to a very high threat value. that's why AI sometime has got a lot of units around its city (all are affected to the city defense).
I'll make a try with a 12-units limitation for one goal. For the moment, I didn't find the origin of the problem.


So setting all this to zero should help, but then I fear I break something else:

code:
// priority for fear motivations FearInvasion 1000 FearCityDefense 1100 FearPiracy 900 FearScienceRank 800 FearMilitaryRank 800 FearTradeRank 800 FearPollution 900


Actual I don't like the 12 units limitation, well you can experiment with it, but I would feel better if the problem is solved at the root.

quote:
Originally posted by calvitix
I don't know if anyone else is looking for the same improvements, any experience or help w'd be appreciated...


Well I assumed that Peter was looking into this, he talked about that he looked at the transport thing and about modification on the startegies.txt, but he never posted anything about it. Therefore I decided to give up on hesitating and exposed the startegies to personalities.txt. And I thing you shouldn't hesitate either.

-Martin

calvitix is offline calvitix
Chieftain
Strasbourg (North-Est France)
Jun 2003
time: 05:34
  Old Post 17-08-2004 12:31
Edit/Delete Message Reply w/Quote
#4 Report this post to a moderator
Support Apolyton, buy Galactic Civilizations

quote:
Originally posted by E
One question on chokepoint. Is it feasible for the computer to identify a tile with a GOOD and defend it because it has a good? This would be needed for implementing strategic resources...


It wouldn't be a problem, it is possible to add tiles with good as chokepoint.

E is offline E
King
July 24,2005 Ctp2 Tiles in sig!
May 1999
time: 21:34
  Old Post 17-08-2004 23:18 Visit E's homepage!
Edit/Delete Message Reply w/Quote
#5 Report this post to a moderator
Put an end to popups!

calvitix

thats great news I hope that means that tiles with goods anywhere could be a defendable point and later a place to put a colony or something (like civ3) or even a goal to capture those tiles.

thanks!

Peter Triggs is offline Peter Triggs
Prince
Gone Fishin, Canada
Jan 2000
time: 05:34
  Old Post 18-08-2004 10:17
Edit/Delete Message Reply w/Quote
#6 Report this post to a moderator
Get a bigger avatar today!

Hi, guys

I'm essentially computerless (posting from wherever I can at the moment) but have just bought a new one and hope to get back into things early in September.

Peter

calvitix is offline calvitix
Chieftain
Strasbourg (North-Est France)
Jun 2003
time: 05:34
  Old Post 31-08-2004 16:35
Edit/Delete Message Reply w/Quote
#7 Report this post to a moderator
AI Movement update beta1 Support Apolyton, pre-order Civilization IV

Hi,

it's time to report and release a first version of my work on Army movement and grouping.
(source code is in thread 'altered source')

the changes I made are quite heavy, and some unwanted effects on AI movement can appear.
That's why I release now that version as beta, I alone can't test if all the unwanted consequences of my modifications.
(I do test it for 2 weeks now, and it seems to work well for the moment).
I'll soon post an executable that can be used with latest playtest package for people that don't compile the sources...


Here's a list of observation and changes :

1. original AI grouping worked good for settler escort, the princip has to work for armies too...
So why isn't it working ?

1.1 There is not enough units to affect to goals (too many are defending or for garrison)

AI cities are always filled with units. 3 reasons :
- Garrison : as described in strategies.txt, a minimum of units are affected to garrison.
- Defend : units with goal Defend. not the same units as those for garrison.
- Retreat/no Goal : when a unit isn't affected to a goal, it will be affected to goal RETREAT,
so the unit goes back to the nearest city.

first problem : too many units defending : units for garrison aren't included in goal matches but are blocked in the city (and they aren't affected by the deleteobsoleteunits action, that's why we can find phalanx or catapult in AI cities during all the game).
in addition to those garrison units, some armies are affected to goal DEFENSE (depends of threat). So I give only the minimum values for garrison in 'strategies.txt'.

second problem : the RETREAT goal don't works as expected (it should retreat units from ennemy territory).
I desactivated it for the moment, until a real non trespassing action is developped (I'll working on it after cargo problem...).


1.2 The army affectation to goals (the matches) doesn't promote grouping

the matches (a link goal <-> unit) are sorted by a value that depends on goal priority, distance to goal destination...

Problem : an Army will be affected to a low priority goal that is near (with high match value) rather than a high priority goal that is far (such as SEIGE or ATTACK). So a High priority goal but that needs a lot of units will never be satisfied, because all the available units would be all affected to single low priority goals (such as Pillage, pirate, chokepoint,...)

Changes : now the matches are sorted by goal priority, and the by matches.

Unwanted effects : if a Goal uses the NeverSatisfied && UseIncrementally options, it 'll get all the available units. those options are not used for the moment (I remove it from goal RETREAT)

1.3 The condition to declare a goals satisfied (ie with enough armies) isn't optimal

Each goal has a needed_strength. a goal is satisfied if the affected army is higher than the needed strength.

Problem : that needed_strength is satisfied if the army's attack OR defense is higher.

Changes : now the sum of all parameters as to be satisfied (not only attack or defense).

1.4 The force matching in 'strategies.txt' doesn't promote grouping

The force matching values are usually about 0.6. it means for example that in order to attack an unit with 200 in defense, an attack_strength of 120 will be enough. (quite suicidal, as it has less than 30% chance success).
Personly, I only attack when I have a real chance to win the combat. So I raise the ratio values...
To attack an unit, AI will now have to regroup an army with enough strength before attacking.

All those ratio value have to be adapted (different values for the different strategies...)

2. When an army is affected to a goal, it will be released only when the goal is accomplished or cancelled.

So I try to reevaluate all the goals affectations every turns



3. with those modifs, AI now groups units, but can't ungroup them
AI don't need only grouped armies, but also single units (to explore, ...)

So I added a token 'UnGroupFirst' for several goals in 'goals.txt', and ungroup methods associated...

4. Goal Explore : new goal are only created when all old one's are accomplished.

Now, it set new goal every turns. I Changed also the resolution (an explore goal every 2 tiles instead of every 5 - perhaps can be set as constant in 'const.txt' ?).


5. too many units in cities -> problem with transports
As there is a lot of units in the cities, transports have to get out of cities to allow armies to board in.

So I use a copy of the 'make room' algorithm to expulse the transports out of city. it leaves them quite undefended,
that's why I'm working on their protection (next point)


6. Transport protection (to be done)
transport units are vulnerable, they should be protected as the settlers.


7. Road and Tile Improvement

I discovered that the Road and Tile improvement construction is only every 5 turns. changed to do it every turns.




I'm now waiting for questions,comments or eventually bug reports.
I'll go on with tests and try to work on further points :

- the transports (protection, huge armies' cargo problem)
- treaty respect (non trespassing,...)
- retreat of wounded units to heal (in city or forts)

Martin Gühmann is offline Martin Gühmann
Emperor
Berlin, Germany
Mar 2001
time: 06:34
Post  Old Post 31-08-2004 18:02 Visit Martin Gühmann's homepage!
Edit/Delete Message Reply w/Quote
#8 Report this post to a moderator
Re: AI Movement update beta1 Support Apolyton, buy Civilization 2

quote:
Originally posted by calvitix
5. too many units in cities -> problem with transports
As there is a lot of units in the cities, transports have to get out of cities to allow armies to board in.


Why have the transports to leave the city in order to to allow the army to board in? I would put the units into sleep mode and leave with the transport the city, the units are then put automaticly on the transport.

quote:
Originally posted by calvitix
7. Road and Tile Improvement

I discovered that the Road and Tile improvement construction is only every 5 turns. changed to do it every turns.


Is it really necessary to do it every turn, I mean this eats calculation time, and such a delay of 5 turns doesn't matter I think. In fact it helps the AI to save some PW for more expansive tile improvements.

-Martin

calvitix is offline calvitix
Chieftain
Strasbourg (North-Est France)
Jun 2003
time: 05:34
  Old Post 31-08-2004 18:17
Edit/Delete Message Reply w/Quote
#9 Report this post to a moderator
Re: Re: AI Movement update beta1 Full PM-box? Change here!

quote:
Originally posted by Martin Gühmann


Why have the transports to leave the city in order to to allow the army to board in? I would put the units into sleep mode and leave with the transport the city, the units are then put automaticly on the transport.



The problem is when the transport is in the city with for example 8 units, a 5-units army cannot enter in the city to sleep. it occurs only when the join point is defined as the city tile (that appends when the transport is in a city at the moment we need it), but I encounter the problem several times during my test games.



quote:
Originally posted by Martin Gühmann

Is it really necessary to do it every turn, I mean this eats calculation time, and such a delay of 5 turns doesn't matter I think. In fact it helps the AI to save some PW for more expansive tile improvements.

-Martin


it has to be discuss when we'll work on tile improvement and road. (I don't really care for the moment on calculation time, and for some games it can gives advantages (specially for roads that have to be build after pillage or pollution). can rollback the change, not a problem for me...

Martin Gühmann is offline Martin Gühmann
Emperor
Berlin, Germany
Mar 2001
time: 06:34
Post  Old Post 03-09-2004 01:38 Visit Martin Gühmann's homepage!
Edit/Delete Message Reply w/Quote
#10 Report this post to a moderator
Re: Re: Re: AI Movement update beta1 Support Apolyton, buy Call to Power 2

quote:
Originally posted by calvitix
I don't really care for the moment on calculation time


I noticed this (and I am not happy about it ), 15 seconds on the first turn of the game just for all AIs, I mean these AIs just need to find nice places for their first cities. And then there is nothing to calculate until they get their first units. I mean I want to play this game on a PC with AMD Athlon with 1333Mhz and 256MB RAM and I don't plan to buy an Earth Simulator just to play the game with 10 civs on a world map of 64*128=8192 squares.

That's an early game tedium.

-Martin

calvitix is offline calvitix
Chieftain
Strasbourg (North-Est France)
Jun 2003
time: 05:34
  Old Post 03-09-2004 11:19
Edit/Delete Message Reply w/Quote
#11 Report this post to a moderator
Re: Re: Re: Re: AI Movement update beta1 Avatar Enlargement: We've got the solution

quote:
Originally posted by Martin Gühmann


I noticed this (and I am not happy about it ), 15 seconds on the first turn of the game just for all AIs, I mean these AIs just need to find nice places for their first cities. And then there is nothing to calculate until they get their first units. I mean I want to play this game on a PC with AMD Athlon with 1333Mhz and 256MB RAM and I don't plan to buy an Earth Simulator just to play the game with 10 civs on a world map of 64*128=8192 squares.

That's an early game tedium.

-Martin



I have an equivalent PC (1200Mhz and 512MB RAM), and I don't noticed so much time during my tests. Which Version did You try ? I usually works with Final version.
With the Debug Version, allmost all the time spended is for log file writing, specially with the k_dbg_scheduler(as I added some log infos to debug the Goal priority computing).

But you're right, I have to take care of calculation Time (It is one of the main reason for me not to play Civ3 anymore....).

By searching in logs file, I discovered that the much time consumer is the agent matching (not really a surprise),
specially with a high MAX_MATCH_LIST_CYCLES. I suspect the processmatches to do 10 times the same affectation mistakes...
I'll check it soon (I'm actually working on DistancetoHomebonus that isn't correct calculated - apparently rc2xy problem)

- Calvitix

Martin Gühmann is offline Martin Gühmann
Emperor
Berlin, Germany
Mar 2001
time: 06:34
Post  Old Post 03-09-2004 21:44 Visit Martin Gühmann's homepage!
Edit/Delete Message Reply w/Quote
#12 Report this post to a moderator
Re: Re: Re: Re: Re: AI Movement update beta1 Support Apolyton, buy Civilization III: Complete

quote:
Originally posted by calvitix
I have an equivalent PC (1200Mhz and 512MB RAM), and I don't noticed so much time during my tests. Which Version did You try ? I usually works with Final version.
With the Debug Version, allmost all the time spended is for log file writing, specially with the k_dbg_scheduler(as I added some log infos to debug the Goal priority computing).


I used the Final version as well, but I also use the Inductory Edition of MS Visual Studio C++ 6, and that version does not include the optimisation options. So the additional time used for the AI is in both versions the same. However CTP2 should still be a game for low end machines, so that I can give it to father to get to know the wonderfull world of Civ, unfortunatly he has to use my old computer a K6 with 233 Mhz and 64 MB RAM. So it should also run on such a machine. I think the main problem in my case is the exploration resolution.

To test and compare the two exploration resolutions I did a game with a resolution of 2 and a resolution of 5. Here is the Incian world map after 267 turns for a resolution of 2:

Attachment: inka_world_map_test1.jpg
This has been downloaded 253 time(s).

Martin Gühmann is offline Martin Gühmann
Emperor
Berlin, Germany
Mar 2001
time: 06:34
Post  Old Post 03-09-2004 21:51 Visit Martin Gühmann's homepage!
Edit/Delete Message Reply w/Quote
#13 Report this post to a moderator
Get a bigger avatar today!

And here is a the Incian map after 267 turns with a resolution of 5. What I see is that the Incas explored more in the resolution of 5 then with the resolution of 2. One possible explanation for that issure is that possible targets are further away from each other in the 5 res version then in the 2 res version. The disadvantage of the 5 res version is that there are some spots of darkness left in the middle of explored terrain. However I don't think this is an huge issure, because in the end everything will be explored and if such things are left then it doesn't hurt the AI either. Just for the human player might it be a problem if he gets maps with such black spots.

Attachment: inka_world_map_test2.jpg
This has been downloaded 250 time(s).

Martin Gühmann is offline Martin Gühmann
Emperor
Berlin, Germany
Mar 2001
time: 06:34
Post  Old Post 03-09-2004 21:55 Visit Martin Gühmann's homepage!
Edit/Delete Message Reply w/Quote
#14 Report this post to a moderator
Support Apolyton, buy Civilization III: Complete

Now I like to talk about exploration itsself, the Incians aborted exploration at one point. On the picture we have the Southern Incian continent, it is bigger then you see here, but for some reason the Incians stopped here.

Attachment: inka_aborted_exploration_test1.jpg
This has been downloaded 248 time(s).

Martin Gühmann is offline Martin Gühmann
Emperor
Berlin, Germany
Mar 2001
time: 06:34
Post  Old Post 03-09-2004 21:57 Visit Martin Gühmann's homepage!
Edit/Delete Message Reply w/Quote
#15 Report this post to a moderator
Enter the AD-FREE zone

And the same situation in the 5 res game, well the Incians explored a little bit further then in the 2 res game, but I don't thing the differences are significant. Maybe this is a problem of the selected strategies for the Incians, in personalities.txt. However one thing I see is that the AI has units in the middle of nowhere. What do the units there.

Attachment: inka_aborted_exploration_test2.jpg
This has been downloaded 228 time(s).

Martin Gühmann is offline Martin Gühmann
Emperor
Berlin, Germany
Mar 2001
time: 06:34
Post  Old Post 03-09-2004 22:01 Visit Martin Gühmann's homepage!
Edit/Delete Message Reply w/Quote
#16 Report this post to a moderator
Support Apolyton, buy Civilization III: Complete

However in both games I see units sitting in the middle of the main civ territory:

Attachment: inka_main_test1.jpg
This has been downloaded 225 time(s).

Martin Gühmann is offline Martin Gühmann
Emperor
Berlin, Germany
Mar 2001
time: 06:34
Post  Old Post 03-09-2004 22:06 Visit Martin Gühmann's homepage!
Edit/Delete Message Reply w/Quote
#17 Report this post to a moderator
Put an end to popups!

In the case above it is the 2 res game, the units are concentrated at the coast, I think this is OK as the Incians are at war with the Scotts and the Americans on the other side of the see. However one thing I don't like about the groups is that there are more groups then necessary. We don't see 12 units at one place but rather 4 or 6. That is more vulnerable to an attack then the 12 units solution. However some more compact rallying and that would be fine for the invasion. The oversea invasion itsself seems to work, however the AI moves single ships and that is not so good, because this means that the units arrives at different points of time on the target continent, where single units are a easy goal. In fact the units should arrive at the same point of time and at the same place, a 12 statck is better then a 2 stack. In fact another problem of this fleet is that the ships have all different targets. My strategy in that case would be to move the units or enough units to one target on the other continent combine there the force and attack.

Attachment: inka_invasion_test1.jpg
This has been downloaded 226 time(s).

Last edited by Martin Gühmann on 03-09-2004 at 22:12

Martin Gühmann is offline Martin Gühmann
Emperor
Berlin, Germany
Mar 2001
time: 06:34
Post  Old Post 03-09-2004 22:21 Visit Martin Gühmann's homepage!
Edit/Delete Message Reply w/Quote
#18 Report this post to a moderator
Support Apolyton, buy Galactic Civilizations

The situation in the 5 res game is similar. But now the Incas are at war with the Germans on the other side of the Incian continent. And again a lot of units on around the Incian cities, although it is no problem for the Incas to combine there forces and march to the German cities. In fact one problem I see on this picture is that there are units on the same tile, but aren't grouped. With all the armies here the Incans could conquer all the German cities on the Incian continent and expell the Germans from the Incian continent.

Attachment: inka_main_test2.jpg
This has been downloaded 213 time(s).

Martin Gühmann is offline Martin Gühmann
Emperor
Berlin, Germany
Mar 2001
time: 06:34
Post  Old Post 03-09-2004 22:27 Visit Martin Gühmann's homepage!
Edit/Delete Message Reply w/Quote
#19 Report this post to a moderator
Support Apolyton, buy Alpha Centauri

In comparision to the Incas the Germans have it better with their invasion/reinforcement transports. We have again single ships but the Germans have a big target area with their cities at the Incian coast, so it doesn't matter if the ships don't share the same target and the fresh troops are good for the city defence. However there is also something positive to report for the Incas. There is an Incian stack with a Catapult in near Dortmund, the garrision of Dortmund just contains one unit and so in fact Dortmund will be history in two turns.

Attachment: deutsche_reinforcement_test2.jpg
This has been downloaded 210 time(s).

Martin Gühmann is offline Martin Gühmann
Emperor
Berlin, Germany
Mar 2001
time: 06:34
Post  Old Post 03-09-2004 22:34 Visit Martin Gühmann's homepage!
Edit/Delete Message Reply w/Quote
#20 Report this post to a moderator
Increase Your PM Length

The situation for other civs like the Arabs is similar. In the 2 res game the Arabs are at war with the Chinese, but were at war with the Indians on the same continent. However there are again a lot units around the capital, and that was also the case when they were at war with the Indians.

Attachment: araber_main_test1.jpg
This has been downloaded 204 time(s).

Martin Gühmann is offline Martin Gühmann
Emperor
Berlin, Germany
Mar 2001
time: 06:34
Post  Old Post 03-09-2004 22:36 Visit Martin Gühmann's homepage!
Edit/Delete Message Reply w/Quote
#21 Report this post to a moderator
Support Apolyton or Terrorists Win

The situation in the 5 res game is similar, but I would have expected that the Arabs would have taken the city of Apache. However at the current turn both civs live in peace with each other. And the cities on both sides are full with troops.

Attachment: araber_main_test2.jpg
This has been downloaded 204 time(s).

Martin Gühmann is offline Martin Gühmann
Emperor
Berlin, Germany
Mar 2001
time: 06:34
Post  Old Post 03-09-2004 22:44 Visit Martin Gühmann's homepage!
Edit/Delete Message Reply w/Quote
#22 Report this post to a moderator
Support Apolyton, buy Civilization 2

I also find the difference in exploration behaviour for the Indians. They explored a little bit more and settled a little bit more but I doubt that the difference is significant, maybe the only effect is the exploration resolution. But to veryfy this some more games are needed to check this. Left in the picture the world map of the Indians in the 2 res game right the world map for the Indians for the 5 res game after 267 turn.

Attachment: indianer_world_map.jpg
This has been downloaded 198 time(s).

Martin Gühmann is offline Martin Gühmann
Emperor
Berlin, Germany
Mar 2001
time: 06:34
Post  Old Post 03-09-2004 22:54 Visit Martin Gühmann's homepage!
Edit/Delete Message Reply w/Quote
#23 Report this post to a moderator
Inflate your Upload Space

Another thing I noticed is the settling behaviour, but actual I already noticed this in a game without your modifications calvitix, the AIs don't settle aggressivly enough. I was able to fix this in GoodMod for ApolytonPack with some text file modifications and I thought by adding those modifications to the startegies.txt I would fix it here as well, but in fact I see here in that game a settler that is obviously waiting for doomsday or whatever. Actual I think the Germans will release a settler from that ship and fill the gap, that should have been filled by the Incians ages ago. And I don't see that the too many cities strategies should be in effect here either as the Incians never hit the city limit. Another thing is that the Incans in the 2 res game have 6 settlers even if the strategies.txt tells them to have only at most 4 settlers.

Attachment: inka_west_test2.jpg
This has been downloaded 191 time(s).

Martin Gühmann is offline Martin Gühmann
Emperor
Berlin, Germany
Mar 2001
time: 06:34
Post  Old Post 03-09-2004 23:00 Visit Martin Gühmann's homepage!
Edit/Delete Message Reply w/Quote
#24 Report this post to a moderator
Increase the size of your Attachments

To the picture above, there is a gap between the Incian city of Huari and the rest of the Incian territory, I also thought that I fixed this problem.

However now to the military strength in both games the strengthes do not grow liniarly. That is a good sign, because this means that troops are using and killed in battles. However this should be more effictive. But in the end we have to investigate how it turns out in the next 300 turns. But in the end I see that we still need some improvement.

-Martin

Attachment: military_267.jpg
This has been downloaded 182 time(s).

calvitix is offline calvitix
Chieftain
Strasbourg (North-Est France)
Jun 2003
time: 05:34
  Old Post 04-09-2004 22:58
Edit/Delete Message Reply w/Quote
#25 Report this post to a moderator
Support Apolyton, buy Alpha Centauri

Hi Martin,

Thanks for all those reports

To be clear, all the changes I have done about grouping are to allow AI to group units. For the moment, the AI also comport itself as the activision developpers implemented it (contrary to Frenzy for example, I didn’t force the units to group).
I didn’t change anything for the moment about the way transports works or AI attacks, I just change the order in goal affectation to enable them.


quote:
Originally posted by Martin Gühmann
However now to the military strength in both games the strengthes do not grow liniarly. That is a good sign, because this means that troops are using and killed in battles. However this should be more effictive. But in the end we have to investigate how it turns out in the next 300 turns. But in the end I see that we still need some improvement.


So Yes, there is still a lot of work left.

A lot of improvement or problem you mention can be resolved by adjusting the values in goals.txt and strategies.txt. I’m working on it, for the moment on maps without sea (there is enough problems to solve first only with one continent…)



quote:
Originally posted by Martin Gühmann
However one thing I see is that the AI has units in the middle of nowhere. What do the units there.


To better understand what each army is doing, you can activate armytext (even in final version) by changing the m_armyTextOn variable to ‘true’ in the gfx_options.cpp constructor.
(I usually add the coords in infobar too (by desactivating #ifdef _DEBUG after the command : Concat(g_theStringDB->GetNameStr("INFOBAR_UNEXPLORED")); in infobar.cpp).


quote:
Originally posted by Martin Gühmann
And the same situation in the 5 res game, well the Incians explored a little bit further then in the 2 res game


I tried it again an it effectively appears that with a 5 resolution AI is exploring further, unless you have a lot of small islands. Perhaps it will be wise to set the value depending on map size and number of continents. For the moment, rollback to 5 will be easier.

About Calculation time, one problem is that the expore goals are added every turn with my modifications (I desactivated a condition that added explore goals only when there aren’t any left.
I tried to change it to add explore goals only when half of maxeval goals are remaining, so it improve performance and the goals are regulary added.


quote:
Originally posted by Martin Gühmann
However in both games I see units sitting in the middle of the main civ territory:


With original AI, the unused units were send back to towns. Now they stand where they are. But I don’t think those units are unused. It's probably a NO_PATH problem (please check it with armytext).

quote:
Originally posted by Martin Gühmann
We don't see 12 units at one place but rather 4 or 6. That is more vulnerable to an attack then the 12 units


The units are grouping until the needed force for the goals is reached. To have 12 units group, the force match ratio in strategies.txt can be raised (specially value_ratio (or we can add threat ratio in needed_force_computing).

Martin Gühmann is offline Martin Gühmann
Emperor
Berlin, Germany
Mar 2001
time: 06:34
Post  Old Post 06-09-2004 22:41 Visit Martin Gühmann's homepage!
Edit/Delete Message Reply w/Quote
#26 Report this post to a moderator
Increase Your PM Length

The unit that stopped exploration in the South and are fortified have no goal. The other unit was moved back, but it has no path problem, I checked the path and the path points into the sea.

Attachment: inka_south_test2.jpg
This has been downloaded 171 time(s).

Martin Gühmann is offline Martin Gühmann
Emperor
Berlin, Germany
Mar 2001
time: 06:34
Post  Old Post 06-09-2004 22:46 Visit Martin Gühmann's homepage!
Edit/Delete Message Reply w/Quote
#27 Report this post to a moderator
Support Apolyton or Terrorists Win

The fortified units in the center of the empire have no goal. Only some of the units in the center of the empire have a goal. So the AI is wasting power for attack, by not grouping and let them "sleep". At least the AI could group those unused units to 12-stacks. For the settlers it looks like the settlers should be moved to spots on the other side of the world, but all the transport capacity is used for the attack forces.

-Martin

Attachment: inka_west2_test2.jpg
This has been downloaded 166 time(s).

calvitix is offline calvitix
Chieftain
Strasbourg (North-Est France)
Jun 2003
time: 05:34
  Old Post 07-09-2004 13:53
Edit/Delete Message Reply w/Quote
#28 Report this post to a moderator
Support Apolyton buy from Amazon

Hi,
I never had seen so much unused forces! (due to personality of Incans perhaps…). I just discovered a bug in my armytext concerning 'NO GOAL'. When a unit is doing the same goal for several turns, the armytext is reset to NO_GOAL… So perhaps they weren't all unused but blocked for any reason. I'm fixing the NO_GOAL bug and I'll post the new patch soon. Could you post a savegame for this game?

Other points I'm working on (I'm in holiday this week, I expect to have time to finish them to post all I'll have done) :

Wounded units retreat:
When a unit is wounded (criterion : less than half HP), it will have bonus for defend or retreat goals, and malus for other attack goals.

Territory respect :
When non-trespassing agreement, all the goals concerning the territory will be considered as BAD_UTILITY (explore, seige, attack,…) - Only for Civ with Lawful or neutral.

Problem with garrison units :
When a city is taken (by seige force), all the group is actually affected to garrison. So I have to ungroup garrison forces (only one or two have to be affected to garrison, other can be affected to other goals.

Grouping Problems :
When units are one tile close and want to group, it appends on several cases a 'cat-mouse' play : the two units endless go to tile where the other unit was.

Pathing problems :
1. Grouped units cannot go across cities (due to max army problem). The pathfinding don't check that (it checks only the final destination), and the army is blocked. I trried to place roads to avoid the city, but the pathfinding apparently prefer going through cities.

2. When units are in enemy territory, (civilian or not), they most of the time path close to enemy cities (to use the benefits of roads). Problem : enemy bombards them (AI loose a lot of units this way). It will be wise for those units to avoid tiles that are too close from cities.

3. Roads problem : when a tile with road is polluted, AI don't build road around…

In order to realize those last points, I introduced a concept of avoid tiles (tiles that are forbidden for pathfinding). When demanding to find path, we give as parameter a list of avoid tiles.

Princip :
1. find a path without setting avoid tiles.
2. Check for each tile of path if it has enough room (or if it is too dangerous, or if the tile is polluted).
3. If such tiles are found, set them as avoid tiles and try to find another path.
4. again check…. This can be reproduced several time (MAX_CYCLES has to be defined).

I know, it's again time consuming, but I didn't find other solutions. Perhaps any ideas ?


Exploration
No idea why units aren't explore further. Perhaps they entered in war, and all units were required to set war. (It appends during my test games). The problem I have seen in games that need sea invasion is the lack of transport units (specially If the sea distance is high). As I said I first concentrate my efforts on 'One continent games' - map with only land.

With units respecting non-trespassing treaty, I experienced that AI doesn't explore much in enemy territory. So I add a new goal : GOAL_STEALTH_EXPLORE, to use special units to explore deeply in enemy territory. It works fine, except the fact that settlers ARE special units (and I have the same problem you mention, there is too much settler unit, even if there is no room left to settle… perhaps we'll have to add a condition : settler units can only be build if there is settle goals). So I have a lot of settlers coming right in my territory, a pleasure for slavers :.

Stealth Units
By observing special units, I discover they aren't very efficient : (spy trying to steal_technology on civ that don't have any,… abolitionists that try to free slaves where there isn't… I think I'll apply a filter to cancel all those stupid goals. AI so will cheat, by knowing where it's useful to send spy and other units, but it's really needed (otherwise those units are quite useless for AI - I Ttink that's why there have been desactivated in SAP…

For all the changes described here, I have to introduce several new constants in 'goals.txt' and 'strategies.txt', It seriously reduce the chances of backward compatibility (and mod compatibility). But I think we have to go in that direction to really improve the game.

As I said, I'm on holyday, so I don't know how often I'll be connected… (I'll also change my Internet connection too, I'll soon have DSL). Please be patient if I don't respond quickly next weeks…

Martin Gühmann is offline Martin Gühmann
Emperor
Berlin, Germany
Mar 2001
time: 06:34
Post  Old Post 07-09-2004 19:57 Visit Martin Gühmann's homepage!
Edit/Delete Message Reply w/Quote
#29 Report this post to a moderator
Suffering from ads?

quote:
Originally posted by calvitix
Wounded units retreat:
When a unit is wounded (criterion : less than half HP), it will have bonus for defend or retreat goals, and malus for other attack goals.


I don't think less than halh HP is a good criterion alone, you also have to consideer the military readiness, so a better criterion would be less HP then military readiness gives.

quote:
Originally posted by calvitix
Grouping Problems :
When units are one tile close and want to group, it appends on several cases a 'cat-mouse' play : the two units endless go to tile where the other unit was.


Well you have to check before the move if there is still the other unit on the destination tile to end that game.


quote:
Originally posted by calvitix
Pathing problems :
1. Grouped units cannot go across cities (due to max army problem). The pathfinding don't check that (it checks only the final destination), and the army is blocked. I trried to place roads to avoid the city, but the pathfinding apparently prefer going through cities.


I think the path finding algorithm needs to be improved in general to take this problem into consideration.

quote:
Originally posted by calvitix
2. When units are in enemy territory, (civilian or not), they most of the time path close to enemy cities (to use the benefits of roads). Problem : enemy bombards them (AI loose a lot of units this way). It will be wise for those units to avoid tiles that are too close from cities.


In my BetterAI.slc I check whether the city is a good goal if the army encounters one. In general when an army is in enemy territory, then everthing there is a possible goal. If the unit should go to a city to attack it but it encounters an enemy stack that is weak enough it attacks this stack. If the enemy stack is too strong and the army can bombard the army bombards. If it encounters on the way to another city a city that is also worth of taking then the city is taken. In conclusion I would change the goal of the army if there is something on the way. It is more intelegent to take outposts first then the capital in the middle of the empire.

quote:
Originally posted by calvitix
With units respecting non-trespassing treaty, I experienced that AI doesn't explore much in enemy territory. So I add a new goal : GOAL_STEALTH_EXPLORE, to use special units to explore deeply in enemy territory. It works fine, except the fact that settlers ARE special units (and I have the same problem you mention, there is too much settler unit, even if there is no room left to settle� perhaps we'll have to add a condition : settler units can only be build if there is settle goals). So I have a lot of settlers coming right in my territory, a pleasure for slavers :.


That's right that settlers and slavers are special units, but the setter has VisionClass: Standard and the slaver has VisionClass: Stealth. So you should rather consider the vision class, then the attribute special unit.

quote:
Originally posted by calvitix
Stealth Units
By observing special units, I discover they aren't very efficient : (spy trying to steal_technology on civ that don't have any,� abolitionists that try to free slaves where there isn't� I think I'll apply a filter to cancel all those stupid goals. AI so will cheat, by knowing where it's useful to send spy and other units, but it's really needed (otherwise those units are quite useless for AI - I Ttink that's why there have been desactivated in SAP�


That's a real problem, if the spy figures out the other civ does not have any techs to steal he should change the goal and try something else on the same city. Abolistionists should know which city has slaves has human player you know it when you arrive at the city. For the special units in Apolyton Pack, I cannot remember that they have been disabled there, the only problem there might be the settings in strategies.txt. In fact I was able to make the AI use of them in GoodMod and not only the slaver, but also Clerics. One problem I see with the special units is if they have more then one possible order, that I was only able to make the AI use of one order but not of the other orders.

-Martin

Martin Gühmann is offline Martin Gühmann
Emperor
Berlin, Germany
Mar 2001
time: 06:34
Post  Old Post 08-09-2004 22:08 Visit Martin Gühmann's homepage!
Edit/Delete Message Reply w/Quote
#30 Report this post to a moderator
Avatar Enlargement: We've got the solution

Here are both savegames, the savegame with the test1 suffix is the 2 res game the savegame with the test2 suffix is the 5 res game. Note that I used the cheat editor to switch to the Barbs in order to let the AI play, so both games are saved as Barbs.

-Martin

Attachment: viraco-barb-870n.chr.test1.zip
This has been downloaded 1 time(s).

 
Pages (4): [ 1   2   3   4   ]
< Last Thread     Next Thread > Post New Thread     Post A Reply
All times are GMT. The time now is 05:34.
Apolyton Time is 00:34.
    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.0784 seconds (93.51% PHP - 6.49% 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