Fix for the Barbarians... sort of

HellboundHeathcliff

Deity
Supporter
Joined
Dec 22, 2001
Messages
2,007
Location
Rochester, NY, USA
When i first read about the barbarian preference for the NW/SE axis i was a little confused because i always seemed to have exceptions. While working on a newer The Ancient Mediterranean Mod (soon to be available) i figured out part of the barbarian problem.

Adding NoAIPatrol=1 to your ini file in an attempt to speed the turns up by reducing the AI movement of units affects the barbarians as well. With this flag set, they just fortify where they are and won't move unless an enemy unit is on the NW/SE axis somewhere on the map.

By just changing it to NoAIPatrol=0 they wander around more. They still have the preference for the NW/SE axis but because they move around, they are also more likely to get on it.

The Barbarians will also attack off the prefered axis ocassionally. I have not tested enough to determine if it is the ini file flag or the activity setting and don't plan on doing so. What I do know is that with NoAIPatrol=0 *AND* Raging barbarians, they will attack off axis. They are still predictable and won't always attack in other directions but it does make them more interesting, less predictable and thus more dangerous.

I do have an unproven theory on when they will attack off axis: When the barbarians want to go somewhere, they almost always choose the higher defensive terrain to move to first. If you have a unit on the off axis tile they would prefer to move to they will attack.

EDIT: Justus II did some testing and posted the results here:
http://forums.civfanatics.com/showpost.php?p=2217331&postcount=22

Edit: SirPleb has posted a comprehensive list of observed barbarian behavior:
http://forums.civfanatics.com/showpost.php?p=2221471&postcount=37

Edit: ainwood has made a small utility for those players who are uncomfortable modifying the ini file: http://gotm.civfanatics.net/civassist/BarbFixer.zip

To summarize what we know so far about how the NoAIParol flag affects barbarians (and now playable civs thanks to Justus II):

a) Absence of NoAIPatrol flag is the same as NoAIPatrol=1 for C3C only. PTW defaults to =0, C3C defaults to =1.
b) NoAIPatrol=0 in your conquests.ini file is the only way to turn patrolling back on in C3C for all AI units including barbarians. This restores the barbarian activity close to PTW expected behaivior.
c) The barbarians still have the preference for the NW/SE axis and remain somewhat predictable with AI patrolling allowed BUT they WILL attack off axis. You can still lead them around by moving units on and off the axis and predict which tile they will move to if one tile has a higher defensive bonus than the others.
d) The ini file is read only when C3C is first started. Therefore, if you want to change the flag mid game, you must exit the game and restart it.

(I always played with =0 assuming it was the same as no flag and is why i noticed discrepancies)
 
Since i'm on the subject of barbarians:

Any scenario with a premade map will use the barbarian activity level from the last randomly generated game you started and ignore the barbarian activity setting on the scenario properties tab in the editor.
 
Watorrey,

This is great!

One question though -- which directory is this file in? Where can I find it? What is the whole name of the .ini file?

I've looked at the 'main' ini file in conquests, but I don't seem to have that line. Maybe I'm not experiencing the bug?

Thanks,

Breunor
 
You're just not making it worse by adding the line to the conquests.ini file. One of the Firaxians told us about the flag to help people who were having long turn times. As it turns out, it makes the barbarian problem worse as well.

I don't know if there is a difference between not having it at all and having it set to 0.
 
I remember somewhere during the PTW days that Soren mentioned he didn't know what he did that changed the barbarian behavior. It may or may not be about the same time we found out about the NoAIPatrol flag and thus may or may not be the total cure for PTW barbarians. I suspect they tried fixing it for conquests not realizing the flag was a problem and screwed it up worse. Lots of guessing on my part here.
 
Caps Lock, Shift, and animation preferences only affect the units you can see. Units you cannot see are not animated at all. That was done in an early vanilla patch to speed turn time. Just calculate new position and place it there.
 
[Edit]Please ignore the next paragraph. It turns out that it wasn't a safe bet at all that the default value is zero, and that changes everything. Read on in this thread to find out more.[/Edit]
I think it is a safe bet that the default is "NoAIPatrol=0" and that therefore this information doesn't affect most people - if they've never modified their setup (I haven't) they should get the slightly more random barbarian behaviour.

I think I have an explanation for what is happening here.

First some rules governing some behaviour as I understand them:

1) By its name it seems fairly clear what the NoAIPatrol flag can be expected to do - if it is set then an AI unit which has nothing better to do will stay in one place instead of patrolling somewhat randomly.

2) I think the Conquests land barbarians are completely predictable. They'll destroy a defenseless unit if it comes right under their nose. They'll move if there is something (human or AI) on the NW/SE axis, up to some distance limit. (I'm pretty sure at least 5 - I think I've seen a barbarian move due to a move of mine that far away.) Otherwise they'll stay put.

3) If a barbarian decides to move it may or may not move directly toward the unit which triggered it. It will often be that it would take the barbarian the same number of turns to reach a unit by moving off the axis. E.g. to reach a unit two tiles NW the barbarian might start by moving W. (N next turn will reach the destination in two steps, same as moving diagonally would have.)

Based on the above, one result of setting NoAIPatrol=1 will be that AI units will less often trigger barbarian movement. By wandering less they'll less often cross the NW/SE axis of some barbarian. All subsequent events which seem more random are probably just the result of the above rules from the slightly more varied barbarian activity triggered by the AIs. I.e. the patrol flag has nothing at all to do directly with the barbarian bug, the barbarian bug is unrelated and they're totally predictable in the NW/SE axis bug either way this flag is set.
 
If you have The Ancient Mediterranean mod installed, set the large map to debug and play around with it, if so inclined. That map is FULL of barbarians and there is a HUGE difference in thier behavior depending on that flag.
 
I started a new game with Patrol off and seems to make a big difference. I have no other Civ near my yet and the barbs are acting much different. I am playing Middle Ages Scenario at Diety with raging barbs.

I understand what SirPleb is saying. To add one one more point: the barbs are appear to be patrolling now and when they patrol, this 5 tile range that catches their attention is expanded.
 
C3C at least, ignores the scenario barb activity setting and uses the barb activity setting you choose in your last random game. The only way to know 100% what your current setting is, is to use Ainwoods seedbeast to check a .sav
 
EDIT: After more testing, I've determined that my earlier tests, listed below, were done with Patrol turned off! For more details, see my new post HERE. The rules listed below do apply to the ‘default’ setting, with no NoAIPatrol line set, or if the line is set at =1, the default. However, if AI patrolling is enabled (NoAIPatrol=0), it DOES affect barb movement directly, and causes them to move (somewhat) randomly, which is covered in my later post linked above. Sorry for the confusion! :)

As I've spent a lot of time helping Watorrey playtest The Ancient Med mod, I've played multiple games with DEBUG mode on (so you see all AI and barb units), and the NoAIPatrol does seem to affect the barb behavior significantly.

EDIT: This line no longer applies:
However, after doing some more testing today (on my lunch break ;) ) I agree with SirPleb's thoughts, that it is the increased AI movement that is triggering the more ‘random’ barb movement.


I've done some more testing, and AI (or human) movement along the NW/SE axis will ALWAYS trigger AI movement, with a few conditions:

1. The movement must END on the axis, moving through the axis (via road, or 2-move units that move through the axis, and end on another tile row) does not trigger it.
2. Range is 12 tiles (maybe 13) I've seen movement triggered at 12 tiles away, but not at 14.
3. The availability of a direct path to the movement does not matter. In my testing, we had some barb camps on the European side of the Bosphorus straits, and Troy’s position (and early movement) across the strait triggered barbs to move. Interestingly, they did not move directly SE toward the AI movement, but rather moved north. I’m assuming they do a standard path calculation, which tells them they have to go around the Black Sea, so they head that direction (even though it would take 40 turns to get there…). This may explain some seemingly random moves, if they are triggered by AI that they can’t reach directly, but could in theory get to. I THINK continents matter, if there is NO land-only path available (i.e. the AI is on an island), the Barbs will not react, I haven’t seen reaction from Britain for continental movement, but I didn’t thoroughly test it, as most were outside the 12-tile range.
4. When triggered, the AI will chose the path that allows it to move to the best defensive terrain, if several tiles are equally distant from the AI, even if this takes them off the axis.

The problem with these rules, of course, is frequently the barb’s reaction movement takes them off of the axis from the original trigger unit (or city), and so the next turn, they don’t detect anything, and fortify where they are. They do not ‘remember’ the target or it’s previous location, it’s not like a ‘goto’ order, which would at least get them into the general area. Not only does this make for less effective barbs, they can also be easily exploited.

Edit: Removed incorrect references
When NoAIPatrol set to 1 (or with it not in the .INI file), Barbs that do not have any movement along those axis do not react. The only time they will move without a unit on the NW/SE axis is if they detect a defenseless unit (scout, worker, settler) that they can reach in one turn. This could be adjacent, or 2 moves (in any direction) for barbs with a move of 2. Note that in this case, they have to be able to move to the target, so if they are 2 tiles away, but all forest, the barb can’t reach them in one turn and won’t react at all.

Final paragraph deleted, invalid assumptions usually lead to invalid conclusions! :crazyeye:
 
Interesting stuff- after reading that I could add the noAIaptrol line I did so and can't say I noticed a change in barbie activity, but this does all seem to make sense. Now, dare I removed the patrol line? The AI always builds huge navies and patrols throughout my seas with it off, taking forever to get through...
 
Justus II: I'm glad you used your valuable lunch time ;) to take this further than i had. Although it may be an indirect effect, i think i'll leave the line in my sig since it does affect them.

Mr. Do: I recommend leaving the flag set to 0. You can always hit the Caps Lock key on the turns where large AI unit numbers are slowing things down for you. This is what i have always done.

None of the above explains why they will attack off axis occassionally unless my unproven theory is correct.
 
Well, I already do use the "hold shift" trick, but seeing 60 boats going up and down my coasts every turn is somewhat infuriating, shift or no shift.

Also I did see a barbarian unit attack a unit directly east of it once, but that may have been because it moved south and then east, or just a very random encounter.
 
Top Bottom