When do barbarian units enter cultural borders

Barb Galleys use UNITAI_ATTACK_SEA and thus require their own AI function CvUnitAI::AI_barbAttackSeaMove(). Obviously, you won't find any AI_attackCity or AI_targetCity calls in there, as boats are only allowed to attack units outside cities. Also, there aren't any similar NumCities-thresholds implemented here and the AreaAI of their area (= water!) has no effect. So once they are around, they will check their valid options in the following order:
  1. flip a coin (50% chance) and -if lucky- check whether an improvement can be pillaged this turn (AI_pillageRange(iRange=1))
    --> they will move onto Fishing Boats in adjacent tiles and pillage them
    .
  2. check whether an enemy unit can be attacked on this or on the next turn (AI_anyAttack(iRange=2, iOddsThreshold=25))
    --> they will target your Work Boats 4 tiles away; this can be exploited to keep them away from your improvements by some nice disco-fox dancing ;) or to lure them into the fishing grounds of your neighbors
    .
  3. check whether an improvement can be pillaged within 4 turns ((AI_pillageRange(iRange=4))
    --> they will use their advanced AI radar to spot your improvements 7 tiles away :eek:, however, this radar can only detect improvements in the fog, if they exist for more than 20 turns (improved knowledge!, 5 turns for land units and improvements on land); the closest improvement "wins" (max(pillageValue/pathTurns))
    .
  4. AI_heal()
    .
  5. AI_patrol()
    --> move into a random adjacent tile (iValue = 1...10,000); prefer unowned tiles (+20,000) and tiles not adjacent to borders (+10,000); if movement points left, recalculate ALL options (if the patrol-move reveals a "fresh" improvement, that was hidden from the AI radar in the fog before, option 3 will now be enabled and the respective mission (AI_pillageRange(iRange=4)) will be pushed)

At what time will the game spawn barb Galleys?
  • the era of barb animals must be over (NumCities >= 3/2*NumPlayers; GameTurns > Handicap.BarbarianCreationTurnsElapsed * GameSpeed.BarbPercent)
  • the barbs must know Sailing

How do barbs acquire their techs?
  • Their real research rate is almost guaranteed to be 0, since they aren't allowed to have a Palace (8 commerce) and thus suffer from high maintenance (but they don't lose units via STRIKE).
  • So they merely receive the 1 free beaker everybody gets (BASE_RESEARCH_RATE) for their current research plus 3% (BARBARIAN_FREE_TECH_PERCENT) of the cost of a tech scaled by the percentage of players who know it for each technology each turn. Hence, if the majority of the players in the game knows Sailing, it won't be long until the first barb Galleys come visit your fishing grounds.
 
How does barb visibility work, I'm not entirely sure how that is calculated. Do they just see everything?
 
They generally see all units and cities within the current search radius for a specific mission -- this radius is a function of their base movements and the passed iRange argument. Improvements are a bit special, they need to be revealed already or be old enough (see above), otherwise they get a pillage value of 0 and thus won't be pillaged. The barbs always know exactly where their target city is located (mostly your capital or coastal city with a wonder).
 
When does barb annimals stop to spawn and how?
 
Barb Animals start appearing after game turn 5 (hard coded, independent of game speed). As mentioned earlier the game stops spawning them if both of the following two conditions are met:
  1. The average number of (non-barb) cities per player must be >= 1.5.
    .
  2. A certain number of game turns must have elapsed (depending on difficulty [iBarbarianCreationTurnsElapsed] and game speed [iBarbPercent], marathon is special with 400%).

So in a quick deity game animals are usually only created in just 1 IBT (5->6).

When the era of barb animals is over, the existing creatures are not eradicated in 1 major extinction event. Instead, the game kills off 1 animal per turn until they are all gone and will insert regular barb units (Warriors, Archers, ...) as they are "needed" during the next IBT (can be > 1 unit/turn!, ALL required units are created immediately).
 
Great info Dan as usual. :) Just a quick question, do roads also count as improvements when it comes down to border improvement pillaging?

I have an idle worker waiting for BW with barbs roaming around. Should I build a road on a border tile? :crazyeye:
 
TMIT: Yes I'm pretty sure from experience that they have attack courage as it seems they are less likely to attack a strong position, like archer vs archer on forested hilltop.

Really? For me it's been the opposite. The game I'm playing now has seen barb axemen attack fortified longbowmen on hills and cities, ignoring improvements. I even had barb warriors attacking my scouting dog soldier in a previous game. In my experience, barbs are pretty darn suicidal.
 
Just a quick question, do roads also count as improvements when it comes down to border improvement pillaging?
Yes, they do. Although (as you hinted at) roads/railroads aren't Improvements technically but Routes instead, they do have an AI_pillageValue > 0 which is required to trigger the AI_pillageRange mission.

Really? For me it's been the opposite. The game I'm playing now has seen barb axemen attack fortified longbowmen on hills and cities, ignoring improvements. I even had barb warriors attacking my scouting dog soldier in a previous game. In my experience, barbs are pretty darn suicidal.
If only their suicidal tendencies were a bit more stable... I have described the barbs' fluctuating attack courage in post#12 of this thread.

~~~~~~~~~~~~


A quick tip on fogbusting:

I'm not sure how many of you fellow civfanatics know about the GlobalDefines value MIN_BARBARIAN_STARTING_DISTANCE = 2 and already exploit it. It means that new barbarian units are not allowed to spawn within a 2 tile radius of ANY existing unit (including other barb units) on the map. This rule allows very efficient "fogbusting" on smaller landmasses. Here is an example (spoiler for current LHC Huayna Capac checkpoint 1):
Spoiler :

2 Quechuas and 1 Scout are all I need to keep my lands barb-free :D. It is not required to have active vision for all the tiles (the fog doesn't matter). I've changed the Dotmap-function of BUG to display the no-spawn areas for my three units.

Note that barb cities CAN appear 2 tiles away from my units if the tile is in the fog though.
 
So why was this thread never made into an article?
 
I'm not sure how many of you fellow civfanatics know about the GlobalDefines value MIN_BARBARIAN_STARTING_DISTANCE = 2 and already exploit it.

Whoah! :eek::eek::eek: That was certainly worth the price of admission! :lol: Thanks, Dan. :goodjob:
 
That's certainly a great revelation when it comes to fogbusting, I had no idea this was the case. That should help alot. :)
 
So basically the range around a unit is just a BFC but with the corners as well? And this may be a dumb question since we already have a way to exploit them but...does this count for barb galleys as well?
 
In light of this information we can't talk about fogbusting any longer, just as it was impossible to talk about the geocentrism of the universe when it was discovered that the sun is the center point in our planetary system.

Perhaps we should call it spawnbusting henceforth but since that's actually a longer word I'm open to suggestions. Maybe barbusting? :)
 
Hump-catting...similar to bear-blasting!!!

Wow, I didn't realize that the fog was irrelevant...just wow. That's REALLY helpful info danf...

I often thought it strange, because on occasion I'd "risk" a warrior who was fortified on a hill near some terrain that was still fogged, but didn't want to contribute another unit to bust 1 tile. The term fogbusting is definitely misleading! I actually *was* busting those tiles, and never knew it. It seemed odd, but I just counted myself lucky :lol:.

If I use this info I can often get away with busting away barbs with warriors alone on immortal more easily (I manage it in a lot of games already actually)...nice nice.
 
Are barb cities also prevented from forming within two tiles of all units? I think no but maybe my memory is faulty on that, that is, prevented from having culture within 2 tiles after forming. Technically that's possible with 3 tiles away citiy-formations I suppose.
 
Are barb cities also prevented from forming within two tiles of all units? I think no but maybe my memory is faulty on that, that is, prevented from having culture within 2 tiles after forming. Technically that's possible with 3 tiles away citiy-formations I suppose.

I really, really doubt cities can appear under conditions where units can't, but I've been wrong before.

You need to go back and reread Dan's post :lol:, he specifically said in his post they can.

Note that barb cities CAN appear 2 tiles away from my units if the tile is in the fog though.
 
You need to go back and reread Dan's post :lol:, he specifically said in his post they can.

To summarize - cities can appear within 2 spaces of your units if and only if it is still fogged.

Great info on this subject BTW - never knew any of this either!
 
Another question:

Is it possible to pop barb warriors from a hut at the very beginning of the game? If there are no barb animals at all before turn 5, I'm guessing that barb warriors can't pop so soon either. Is this true?
 
Top Bottom