Barbarian units spawn logic

elotar

Chieftain
Joined
Jan 16, 2014
Messages
30
Do anybody know what logic barbarians use when choosing what unit to spawn in a camp (if there are several technologically available)?

I'm playing with Smart AI, there is an annoying problem with tendency of barbarians to leave camp. Got an idea of dirty fix - make an unmovable unit to sit there, but obviously only one such unit is needed, after it camp should spawn regular units.
 
It's random from the list of combat, non-defensive only, units that the Barbs can train at any given tech. It's also biased towards, naval (if on the coast), fast attack (mounted units) and defensive (melee combat troops mainly) units.

The code is in CvBarbarians::GetRandomBarbarianUnitType()
 
Top Bottom