jdog5000
Revolutionary
*** NOTE ***
strategyonly has updated this mod component for BTS, you can get it here!
BarbarianCiv Description
Version 0.85
By jdog5000
The goal
In this mod, barbarian cities, if left to their own devices, will eventually "settle down" into full blown civs!
Note on this version
BarbarianCiv is a component of my modpack, Revolution Mod, and has been released as a stand-alone component primarily to allow it to be added to other mods that may not want the rest of the Revolution functionality. This component comes in two flavors which work slightly differently: Python only and SDK enabled. The Python only version is provided mainly for modders who would like to avoid changes to the SDK for whatever reason. The differences between the two versions are:
In Python only:
- Must set DoGameStartKill = True to see any effect
- A few AI civs will be killed off before the first turn of the game. These can then take over barb cities later.
In SDK version:
- Do not need to kill civs off at game start (little potential gain from doing so)
- Completely new civs, not previously in the game will appear when barb cities "settle down"
The Basic Idea
Barb cities will settle down probabilisticly, with several factor determining the odds. When a civ takes control of some barb cities, they're given a bunch of freebies to make them competitive. How the new civ is chosen depends on whether you're doing Python only (random from list of killed off civs) or SDK enabled (random from never alive).
More details
The decision to have barbarian cities "settle down" into a full-fledged civ is based on the properties of the barb cities. At the end of every turn, all barbarian cities are examined for two things: total population of neighboring barb cities, and culture. The city with the highest population (including neighboring barb cities) and the city with the highest (non-zero) culture have a chance of organizing. The higher the total barb population around a city, the higher the odds it and its neighbors turn into a civ. Once a barb city starts to get some culture, it has pretty good odds of spawning a civ.
Once the cities for the new civ are selected. There are two types of barbarian consolidation, militaristic and builder. Both get a base set of defensive units and workers in every city, plus all techs known to a majority of the world. The new civ also gets a great person (to symbolize the leader who organized the horde), with the GP type depending on the type of consolidation. The populations of all the cities are increased. Their captial is given walls and a granary. If the cities have some culture, the new civ gets half of the total. These general effects for both types of "rise of the barbs" are intended to partly catch them up with the rest of the world.
Militaristic consolidation is the most interesting in my view. It's intended to mimic the affect of Ghengis Khan or the Vikings. The new civ is given a crap load of offensive units and will declare war on a random opponent in the area. If there are no other civs in the area, the new civ is given some boats to go raiding! Odds of a militaristic buildup increase if the new leader is Aggressive or Expansionist. Militaristic new civs will be behind in economic or social technology. They also get free barracks. Gameplay spoilers: This aggressive new civ will have a very tough first wave, and often succeed in taking a couple cities and pillaging large areas. However, they don't have the infrastructure to maintain the drive and will usually stall or lose their gains (unless you're really unprepared).
Builder consolidation is intended to mimic the rise of a new civ that isn't particularly militaristic. This type of civ gets additional techs from the list of known techs. They are not explicitly given any new techs, but may use their GL to discover something new. They are also given a bunch of extra infrastructure: extra worker, free settler, and some buildings like libraries, lighthouses, and forges (if they have the tech). Gameplay spoiler: While not as exciting as the Military buildup, this type is the more dangerous in the long run. If they start up in a big empty area (like on a Terra map), they can grow into the upper echelon of the game. However, if attacked early, they will crumble.
Notes on use
If you want to see some barbarian cities settle down, make sure there's enough space for them on the map. A full standard map game will probably only see a couple of barb civs emerge.
One fun experiment is start a large world with only a handful of civs, then let the barbarians fill in the gaps. (To do this with the Python only version, you would need to set KillFraction to something high)
On Terra maps, the "new" world will not be as empty as before.
Note to modders
If you want to play around with the mod, turn on DebugMode in the ini file. This enables a keyboard shortcut Ctrl-Shift-B that forces the creation of a civ from barb cities if there are any (and empty slots that can be filled). It also turns on some debug output (if your CivIV.ini file has debug logging turned on). Then with the world builder you can see what the mod would do if the random roll had created a new civ in that particular instance.
How to merge
This mod component uses DrElmerGiggles custom event manager and config parser components, many thanks to him for putting them together! I highly recommend you adopt this convention for your mod, it makes merging event driven components much easier. If you are using these conventions, the only needed changes are:
Move BarbarianCiv.py to your mod's Assets\Python folder. If using SDK version, also copy over dll to your mods Assets folder.
Copy the BarbarianCiv settings from BarbarianCiv.ini to "(Your ini file name).ini"
Make sure CvConfigParser can find your mod folder, probably by changing the contents of CvModName.py.
In CvCustomEventManager.py, add import BarbarianCiv to the top of the file. Then, in __init__, add:
config = CvConfigParser.CvConfigParser("(Your ini file name).ini")
if( config.getboolean("BarbarianCiv", "Enable", True) ) :
BarbarianCiv.BarbarianCiv(self, config)
Done! BarbarianCiv will register its own event and popup handlers and you're on your way. If you're not using this convention, then you need to figure out how to register the events and popup handlers covered in BarbarianCiv's __init__ file and make sure it can find the config settings.
Compatibility
This mod should be quite compatible with any mod that adds units, civs, or technologies. When giving the former barbs units, I search for the best buildable ones by UnitClass or AI type. The main potential source of compatibility problems would come from not using the custom event manager convention, you then have to be sure events are passed to all the appropriate functions.
The Files
SDK enabled version: here
Python only: View attachment BarbarianCiv.zip
strategyonly has updated this mod component for BTS, you can get it here!
BarbarianCiv Description
Version 0.85
By jdog5000
The goal
In this mod, barbarian cities, if left to their own devices, will eventually "settle down" into full blown civs!
Note on this version
BarbarianCiv is a component of my modpack, Revolution Mod, and has been released as a stand-alone component primarily to allow it to be added to other mods that may not want the rest of the Revolution functionality. This component comes in two flavors which work slightly differently: Python only and SDK enabled. The Python only version is provided mainly for modders who would like to avoid changes to the SDK for whatever reason. The differences between the two versions are:
In Python only:
- Must set DoGameStartKill = True to see any effect
- A few AI civs will be killed off before the first turn of the game. These can then take over barb cities later.
In SDK version:
- Do not need to kill civs off at game start (little potential gain from doing so)
- Completely new civs, not previously in the game will appear when barb cities "settle down"
The Basic Idea
Barb cities will settle down probabilisticly, with several factor determining the odds. When a civ takes control of some barb cities, they're given a bunch of freebies to make them competitive. How the new civ is chosen depends on whether you're doing Python only (random from list of killed off civs) or SDK enabled (random from never alive).
More details
Spoiler :
The decision to have barbarian cities "settle down" into a full-fledged civ is based on the properties of the barb cities. At the end of every turn, all barbarian cities are examined for two things: total population of neighboring barb cities, and culture. The city with the highest population (including neighboring barb cities) and the city with the highest (non-zero) culture have a chance of organizing. The higher the total barb population around a city, the higher the odds it and its neighbors turn into a civ. Once a barb city starts to get some culture, it has pretty good odds of spawning a civ.
Once the cities for the new civ are selected. There are two types of barbarian consolidation, militaristic and builder. Both get a base set of defensive units and workers in every city, plus all techs known to a majority of the world. The new civ also gets a great person (to symbolize the leader who organized the horde), with the GP type depending on the type of consolidation. The populations of all the cities are increased. Their captial is given walls and a granary. If the cities have some culture, the new civ gets half of the total. These general effects for both types of "rise of the barbs" are intended to partly catch them up with the rest of the world.
Militaristic consolidation is the most interesting in my view. It's intended to mimic the affect of Ghengis Khan or the Vikings. The new civ is given a crap load of offensive units and will declare war on a random opponent in the area. If there are no other civs in the area, the new civ is given some boats to go raiding! Odds of a militaristic buildup increase if the new leader is Aggressive or Expansionist. Militaristic new civs will be behind in economic or social technology. They also get free barracks. Gameplay spoilers: This aggressive new civ will have a very tough first wave, and often succeed in taking a couple cities and pillaging large areas. However, they don't have the infrastructure to maintain the drive and will usually stall or lose their gains (unless you're really unprepared).
Builder consolidation is intended to mimic the rise of a new civ that isn't particularly militaristic. This type of civ gets additional techs from the list of known techs. They are not explicitly given any new techs, but may use their GL to discover something new. They are also given a bunch of extra infrastructure: extra worker, free settler, and some buildings like libraries, lighthouses, and forges (if they have the tech). Gameplay spoiler: While not as exciting as the Military buildup, this type is the more dangerous in the long run. If they start up in a big empty area (like on a Terra map), they can grow into the upper echelon of the game. However, if attacked early, they will crumble.
Notes on use
If you want to see some barbarian cities settle down, make sure there's enough space for them on the map. A full standard map game will probably only see a couple of barb civs emerge.
One fun experiment is start a large world with only a handful of civs, then let the barbarians fill in the gaps. (To do this with the Python only version, you would need to set KillFraction to something high)
On Terra maps, the "new" world will not be as empty as before.
Note to modders
If you want to play around with the mod, turn on DebugMode in the ini file. This enables a keyboard shortcut Ctrl-Shift-B that forces the creation of a civ from barb cities if there are any (and empty slots that can be filled). It also turns on some debug output (if your CivIV.ini file has debug logging turned on). Then with the world builder you can see what the mod would do if the random roll had created a new civ in that particular instance.
How to merge
This mod component uses DrElmerGiggles custom event manager and config parser components, many thanks to him for putting them together! I highly recommend you adopt this convention for your mod, it makes merging event driven components much easier. If you are using these conventions, the only needed changes are:
Move BarbarianCiv.py to your mod's Assets\Python folder. If using SDK version, also copy over dll to your mods Assets folder.
Copy the BarbarianCiv settings from BarbarianCiv.ini to "(Your ini file name).ini"
Make sure CvConfigParser can find your mod folder, probably by changing the contents of CvModName.py.
In CvCustomEventManager.py, add import BarbarianCiv to the top of the file. Then, in __init__, add:
config = CvConfigParser.CvConfigParser("(Your ini file name).ini")
if( config.getboolean("BarbarianCiv", "Enable", True) ) :
BarbarianCiv.BarbarianCiv(self, config)
Done! BarbarianCiv will register its own event and popup handlers and you're on your way. If you're not using this convention, then you need to figure out how to register the events and popup handlers covered in BarbarianCiv's __init__ file and make sure it can find the config settings.
Compatibility
This mod should be quite compatible with any mod that adds units, civs, or technologies. When giving the former barbs units, I search for the best buildable ones by UnitClass or AI type. The main potential source of compatibility problems would come from not using the custom event manager convention, you then have to be sure events are passed to all the appropriate functions.
The Files
SDK enabled version: here
Python only: View attachment BarbarianCiv.zip