I decided to get an idea how it works. At first look, it can be improved and rebalanced, but before discussing this we need to get clear understanding how it works now.
First of all, there are 3 important parameters. In BTS they are:
We will look at function cvGame::createBarbarianUnits in BTS and AND.
First of all, if GAMEOPTION_NO_BARBARIANS enabled - no new barbarians or animals during the game, this is simple.
Then we check - do we need to add animals? Every move we can add either animals, either barbarians, but not both of them.
When do we add animals?
We do 3 checks in AND ( 2 checks in BTS) and add animals if at least one is passed. If all three checks failed, then we add barbarians.
Check 1 - AND only. We check era parameter isNoBarbUnits and if it is false - we toss a coin. And with probability 50% we will spawn animals this move:
Check 2. How many turns have passed since the start of the game? We take the parameter iBarbarianCreationTurnsElapsed from HandicapLevel and multiply it by iBarbPercent/100 from GamespeedLevel.
In BTS, the first parameter is 50 on the settler level, 45 on chieftain, and so on, until 10 on deity. The second percentage is 100 on Normal, 67 on Quick, 150on Epic, and 400 on Marathon.
This means, for example, on a [settler marathon] game, you will always get animals for the first 200 turns (50 * 4 = 200). No barbarians, just relax and have fun, expand like crazy. On a [deity normal] game, this is only guaranteed for the first 10 turns.
In AND, the first parameter is 45, 40, 35, 20, 20, 20, 15, 10, 10. I'm not sure why it had to be tweaked a little bit, but let's leave it for now. The second parameter is 800 for eternity, then 600, 400, 300, 200, 150, 100.
So, for example, in an [settler eternity] game, animals are guaranteed for 360 turns, whereas in a [deity normal] game, it's only guaranteed for 20 turns.
Also, if you are playing with the option GAMEOPTION_RAGING_BARBARIANS, then the first parameter multiplier will be overwritten as 1 - but this is only for AND! So, this anti-barb defense will stop working from the 2nd turn in a normal game or the 9th turn in an eternity game, regardless of your handicap level. I think this is incorrect. Furthermore, you'll see that GAMEOPTION_RAGING_BARBARIANS completely ignores your handicap level in all instances (and overall it looks like some random tweaks made in a hurry).
Check 3. This is the same for BTS and AND. If the number of cities is less than 1.5 times the number of alive civilizations, you will get animals. Therefore, with GAMEOPTION_RAGING_BARBARIANS, this will be the main obstacle to spawning barbarians in the first few turns. In a deity-level game, the AI starts with an additional settler, so most of them typically settle their second city within the first 5-7 turns, regardless of game speed. After that, the barbarians will start spawning.
Therefore, in AND with [DEITY ETERNITY] and [GAMEOPTION_RAGING_BARBARIANS], you will likely start encountering barbarians from the 9th-10th turn (based on the coin toss from check 1). Considering the unit cost at this level, there is a probability that your first warrior (if you started with a worker or scout) will not be built by that time, leading to an auto-loss. This is definitely unbalanced. In BTS [DEITY MARATHON], you have 40 turns to prepare for your first barbarians, which is actually enough time to build your first warrior.
How can we fix this? I think [GAMEOPTION_RAGING_BARBARIANS] should still consider your handicap level, and it should not make your survival dependent on randomness. In BTS, you can at least survive with raging barbarians even at [DEITY MARATHON], regardless of any randomness, and this should remain the same in AND. Therefore, we should remove this addition from AND:
This was probably a desperate attempt to make barbarians 'harder,' but it should not make the game random. We can make barbarians challenging in a different way.
First of all, there are 3 important parameters. In BTS they are:
<Define>
<DefineName>MIN_ANIMAL_STARTING_DISTANCE</DefineName>
<iDefineIntVal>2</iDefineIntVal>
</Define>
<Define>
<DefineName>MIN_BARBARIAN_STARTING_DISTANCE</DefineName>
<iDefineIntVal>2</iDefineIntVal>
</Define>
<Define>
<DefineName>MIN_BARBARIAN_CITY_STARTING_DISTANCE</DefineName>
<iDefineIntVal>2</iDefineIntVal>
</Define>
I think, these are the most important parameters in barbarian spamming, as we will see further. This was a spoiler, but let's start from the beginning.in AND they are:
<Define>
<DefineName>MIN_ANIMAL_STARTING_DISTANCE</DefineName>
<iDefineIntVal>3</iDefineIntVal>
</Define>
<Define>
<DefineName>MIN_BARBARIAN_STARTING_DISTANCE</DefineName>
<iDefineIntVal>4</iDefineIntVal>
</Define>
<Define>
<DefineName>MIN_BARBARIAN_CITY_STARTING_DISTANCE</DefineName>
<iDefineIntVal>6</iDefineIntVal>
</Define>
We will look at function cvGame::createBarbarianUnits in BTS and AND.
First of all, if GAMEOPTION_NO_BARBARIANS enabled - no new barbarians or animals during the game, this is simple.
Then we check - do we need to add animals? Every move we can add either animals, either barbarians, but not both of them.
When do we add animals?
We do 3 checks in AND ( 2 checks in BTS) and add animals if at least one is passed. If all three checks failed, then we add barbarians.
Check 1 - AND only. We check era parameter isNoBarbUnits and if it is false - we toss a coin. And with probability 50% we will spawn animals this move:
This parameter is 1 starting from industrial era, so this check will work until industrial era. But the thing is that createAnimals later has it's own check based on it's own parameter - bNoAnimals, and it will be 0 already at medieval era. So, what you'll actually get:#ifdef C2C_BUILD
//TB animal mod begin
if (!GC.getEraInfo(getCurrentEra()).isNoBarbUnits())
{
if (getSorenRandNum(100, "Animal or Barb") < 50)
{
bAnimals = true;
}
}
//TB animal mod end
#endif
at ancient and classics era - get 50% moves animals, 50% moves barbarians.
at medieval and reneissanse - get 50% moves barbarians, 50% moves ... just nothing. Looks strange.
Check 2. How many turns have passed since the start of the game? We take the parameter iBarbarianCreationTurnsElapsed from HandicapLevel and multiply it by iBarbPercent/100 from GamespeedLevel.
In BTS, the first parameter is 50 on the settler level, 45 on chieftain, and so on, until 10 on deity. The second percentage is 100 on Normal, 67 on Quick, 150on Epic, and 400 on Marathon.
This means, for example, on a [settler marathon] game, you will always get animals for the first 200 turns (50 * 4 = 200). No barbarians, just relax and have fun, expand like crazy. On a [deity normal] game, this is only guaranteed for the first 10 turns.
In AND, the first parameter is 45, 40, 35, 20, 20, 20, 15, 10, 10. I'm not sure why it had to be tweaked a little bit, but let's leave it for now. The second parameter is 800 for eternity, then 600, 400, 300, 200, 150, 100.
So, for example, in an [settler eternity] game, animals are guaranteed for 360 turns, whereas in a [deity normal] game, it's only guaranteed for 20 turns.
Also, if you are playing with the option GAMEOPTION_RAGING_BARBARIANS, then the first parameter multiplier will be overwritten as 1 - but this is only for AND! So, this anti-barb defense will stop working from the 2nd turn in a normal game or the 9th turn in an eternity game, regardless of your handicap level. I think this is incorrect. Furthermore, you'll see that GAMEOPTION_RAGING_BARBARIANS completely ignores your handicap level in all instances (and overall it looks like some random tweaks made in a hurry).
Check 3. This is the same for BTS and AND. If the number of cities is less than 1.5 times the number of alive civilizations, you will get animals. Therefore, with GAMEOPTION_RAGING_BARBARIANS, this will be the main obstacle to spawning barbarians in the first few turns. In a deity-level game, the AI starts with an additional settler, so most of them typically settle their second city within the first 5-7 turns, regardless of game speed. After that, the barbarians will start spawning.
Therefore, in AND with [DEITY ETERNITY] and [GAMEOPTION_RAGING_BARBARIANS], you will likely start encountering barbarians from the 9th-10th turn (based on the coin toss from check 1). Considering the unit cost at this level, there is a probability that your first warrior (if you started with a worker or scout) will not be built by that time, leading to an auto-loss. This is definitely unbalanced. In BTS [DEITY MARATHON], you have 40 turns to prepare for your first barbarians, which is actually enough time to build your first warrior.
How can we fix this? I think [GAMEOPTION_RAGING_BARBARIANS] should still consider your handicap level, and it should not make your survival dependent on randomness. In BTS, you can at least survive with raging barbarians even at [DEITY MARATHON], regardless of any randomness, and this should remain the same in AND. Therefore, we should remove this addition from AND:
if (isOption(GAMEOPTION_RAGING_BARBARIANS))
{
iBarbsTurnsElapsed = 1;
}
This was probably a desperate attempt to make barbarians 'harder,' but it should not make the game random. We can make barbarians challenging in a different way.
Last edited: