Modder's Documentation

Joined
Jul 5, 2004
Messages
23,562
Location
Canberra, Australia
This thread will contain documentation that is of interest to C2C modders.

INDEX


 

Attachments

  • Civ Check art.7z
    2 MB · Views: 169
Last edited:
The BUG (Basic Unaltered Gameplay) mod is one of the base mods used in C2C. Others are Sevo' Pedia (with Roamty's extensions) and RevDCM

Adding an option in BUG by AIAndy
The BUG config XML assigns the INI file in the Options tag. For me the UserSettings folder with those ini files is directly in the C2C mod folder.

To add a BUG option there are 3 steps:
  1. Add the option to an XML file in Assets/Config
  2. Add the checkbox display to the right Python file in Assets/Python/BUG/Tabs
  3. Add the text for the option display in Assets/XML/Text

Best check revision 1230 where I added an option to the C2C tab.

 
Working with the SVN

1) Create an empty folder somewhere not inside 'program files'
2) Rigth click and drag the root folder of your working copy to this new folder
3) Select the 'export without versioned files' option
4) Move the result into your mods folder (and rename it from C2C to Caveman2Cosmos)

Before committing changes to the SVN
Tip 1
Do an SVN update before you commit.

Any files you have locally modified that are ALSO modified in SVN since your base bversion will be flagged as conflicting and you can use the SVN merge tool to resolve the conflicts (which is likely to be extremely straight-forward for what you are describing).

Once flagged conflicts are resolved do your commit.

Warning this will cause problems if you are deleting content since the update will put back the files you want to delete.

Tip 2 - before doing a commit right-click and do a 'SVN diff' on every file marked as changed before you commit to verify the changes are what you expect them to be.
 
SSpawn XML is used to set the spawning rate of barbarians, including animals and Neanderthals. It can also be used to spawn barbarian invasions for scenarios.

To use this method rather than the default BtS method you will need to turn off the BtS method for units by editing the Unit Infos entry for the unit and removing any Terrain or Feature Native entries. If you don't you will get both methods being used.

Elements
  • Type - Unique name for this spawn definition
  • UnitType - Unit that will be spawned
  • iTurns - average number of turns between spawns for each possible spawn resource (this is then normalized for game speed, so the number here is for epic, and gets larger with slower game speeds in proportion). LARGER = SLOWER spawn.

  • iGlobalTurns average number per turn globally (adjusts for the number of spawn points) optional
  • iMaxLocalDensity - number of local tiles per unit already present after which further already present units (of the spawned type) will inhibit the spawn - so if set to 5 this is saying to stop spawning if there is one Neanderthal per 5 tiles. Area set at 7x7, so 49 tiles. A setting of 49 means unit will not spawn if another exists within the entire 49 (7x7) block area. This is currently the maximum, and thus LEAST DENSE setting.

  • iMaxAreaTotalDensity tiles/spawn-unit-type after which (i.e. - if more than that density of units exists)the spawn is inhibitted for the entire area (aka land or water mass) optional
  • iMaxAreaUnitDensity optional
  • iStartDate - start year for this spawn
  • iEndDate - end year for this spawn (year is self-normalizing to game speed which is why I went that way)
  • bTreatAsBarbarian optional - if set to 1, indicates the spawned unit is effectively a barbarian, and hence is turned off by game option NO_BARBARIANS and doubled by RAGING_BARBARIANS
  • bNoSpeedNormalization optional
  • bNotInView optional - Only spawn on plots which are not in sight of a player (default is false)
  • bNeutralOnly optional - Only spawn in unowned territory aka not in cultural borders (default is true)
  • rateOverrideDefineName optional - name of a global define value which can be used to adjust the spawn rate - it is a percentage and can be any value from 0 upwards (set to 100 in what I have pushed). Higher numbers imply more spawns, with 100 being the pure XML-defined rate - I put this in to give players an easy way to adjust the overall setting. Note need doco on how to set up a new one.
  • bHills optional
  • bFlatlands optional
  • bLatitudeAbs optional
  • iMinLatitude optional
  • iMaxLatitude optional
  • BonusTypes optional - List of the bonuses the unit can spawn from. Spawn is inhibitted if the tile containing the bonus is owned or is occupied by a non-barbarian unit
    • BonusType - Bonus name
  • TerrainTypes optional
    • TerrainType
  • FeatureTypes optional - List of the Features the unit can spawn from.
    • FeatureType
  • FeatureTerrainTypes optional - List of the Terrain the unit can spawn from
    • TerrainType
  • SpawnGroup optional
Refer to the document "Bonuses Features Terrain.txt" in the "Docs" folder for a list of those elements.

Notes
  • if iGlobalTurns and iTurns are BOTH used they are addative and you'll get the spawn rates from both as if theye were independent spawns essentially.

  • To avoid confusion:
Both iGlobalTurns and iTurns are the average number of turns until a spawn happens. So an iGlobalTurns of 5 for a bear means that on average every 5 turns a bear will spawn somewhere in the world, independent of the number of spawn points (but only on the spawn points).

An iTurns of 5 for a bear means that on every single spawn point a bear will spawn on average every 5 turns (which can be a LOT of bears if there are many spawn points).​


Edit make sure I have everything from - initial here and here and here plus here and http://forums.civfanatics.com/showpost.php?p=10936230&postcount=138.
 
Last edited:
@DH - could you edit these into the tags post for the spawnInfo. They are the extra tags AIAndy added, which don't seem to have been documented:

iGlobalTurns - average number per turn globally (adjusts for the number of spawn points)

iMaxAreaTotalDensity - tiles/spawn-unit-type after which (i.e. - if more than that density of units exists)the spawn is inhibitted for the entire area (aka land or water mass)

Note - if iGlobalTurns and iTurns are BOTH used they are addative and you'll get the spawn rates from both as if theye were independent spawns essentially.
 
@DH - could you edit these into the tags post for the spawnInfo. They are the extra tags AIAndy added, which don't seem to have been documented:

iGlobalTurns - average number per turn globally (adjusts for the number of spawn points)

iMaxAreaTotalDensity - tiles/spawn-unit-type after which (i.e. - if more than that density of units exists)the spawn is inhibitted for the entire area (aka land or water mass)

Note - if iGlobalTurns and iTurns are BOTH used they are addative and you'll get the spawn rates from both as if theye were independent spawns essentially.
To avoid confusion:
Both iGlobalTurns and iTurns are the average number of turns until a spawn happens. So an iGlobalTurns of 5 for a bear means that on average every 5 turns a bear will spawn somewhere in the world, independent of the number of spawn points (but only on the spawn points).
An iTurns of 5 for a bear means that on every single spawn point a bear will spawn on average every 5 turns (which can be a LOT of bears if there are many spawn points).
 
New tag: iMaxAreaUnitDensity - Limits spawn density similar to iMaxAreaTotalDensity but only considers units of the same type.
Changed tag: iGlobalTurns - 100 means one spawn per turn on average somewhere on the map, a smaller number means more (20 is 5 per turn).
Not yet explained tags:
  • bNeutralOnly - Only spawn in unowned territory aka not in cultural borders (default is true)
  • bNotInView - Only spawn on plots which are not in sight of a player (default is false)
  • rateOverrideDefineName - Reference a global define that modifies the spawn chance, 100 = normal spawn chance
  • bHills - Allow spawning on hills (default is true)
  • bFlatlands - Allow spawning on flatlands (default is true)
  • bLatitudeAbs - Mode for defining the max/min latitude (absolute value or not). If true (values from 0 to 90), then min 30, max 60 will spawn in the temperate regions both north and south. If false (values from -90 to 90), the same min/max will spawn only in the north temperate region.
  • iMinLatitude, iMaxLatitude - Define the minimum and maximum latitude in which spawning is allowed (default is anywhere).
  • TerrainTypes - List of terrains without any features that is allowed for spawning (so grassland here does not make the spawn valid for forested grassland).
  • FeatureTerrainTypes - In addition to the FeatureTypes list this also limits the terrain below the feature. So feature forest and featureterrain grassland will allow spawning on forested grassland but not forested plains.
 
@AIAndy and/or Koshling

Could you make a the following new buildings tags? Note if they already exist what are the tags for them?

1. Free Electricity (aka power) for every city in the world, even other nations.

2. A Free Building for every city in the world, even other nations.

Many thanks in advance.

Yes. What do you have in mind to use them out of interest? As to when, you'll need to give us some idea of priority - it shouldn't be hard, just a matter of prioritization.
 
Yes. What do you have in mind to use them out of interest? As to when, you'll need to give us some idea of priority - it shouldn't be hard, just a matter of prioritization.

I would like to make the Fusion Power Plant give Power to every city (and of course reduce it from a limit of 3 per nation to 1 in the world). Note that is #1 can't work then #2 should be able to do it indirectly with a good-like building. I would like to have both just in case I want to have another wonder that gives say a "good" to every city in the world.
 
I would like to make the Fusion Power Plant give Power to every city (and of course reduce it from a limit of 3 per nation to 1 in the world). Note that is #1 can't work then #2 should be able to do it indirectly with a good-like building. I would like to have both just in case I want to have another wonder that gives say a "good" to every city in the world.

Why would anyone want to build something that gave power to every city in the world, even those of their opponents? Every city of mine, yeh sure, my team, maybe. My worst enemy? No thanks.
 
Why would anyone want to build something that gave power to every city in the world, even those of their opponents? Every city of mine, yeh sure, my team, maybe. My worst enemy? No thanks.

That would be the trade off. I am going to switch the 3 Gorge Dam to power only a continent. So lets say you got that but you had more cities on another landmass. Then your only choice is to individually power them or power the whole globe.

Likewise you could just wait until some other nation builds it, but then you would miss out on the local benefits of the Fusion Power Plant wonder.
 
That would be the trade off. I am going to switch the 3 Gorge Dam to power only a continent. So lets say you got that but you had more cities on another landmass. Then your only choice is to individually power them or power the whole globe.

Likewise you could just wait until some other nation builds it, but then you would miss out on the local benefits of the Fusion Power Plant wonder.

Yuck. It seems a very unrealistic trade-off. Why would you skip something that can power all YOUR cities everywhere and leap straight to powering the entire world? (from both a realism and a gameplay perspective)
 
Yuck. It seems a very unrealistic trade-off. Why would you skip something that can power all YOUR cities everywhere and leap straight to powering the entire world? (from both a realism and a gameplay perspective)

For the same reason that you cure Smallpox. Or more likely so you can hold all those other nations to ransom.:satan:
 
For the same reason that you cure Smallpox. Or more likely so you can hold all those other nations to ransom.:satan:

How would you hold them to ransom (especially an AI that won't likely know what you are talkign about)?
 
That would be the trade off. I am going to switch the 3 Gorge Dam to power only a continent. So lets say you got that but you had more cities on another landmass. Then your only choice is to individually power them or power the whole globe.

Likewise you could just wait until some other nation builds it, but then you would miss out on the local benefits of the Fusion Power Plant wonder.

Maybe to fix that we need a tag that allows 1 per continent/Area ?

Edit: Er... to clarify... the effect applies only to the player's cities on that continent/Area, but can be built more than once? Maybe this can be done with existing tags or as a project?
 
But at 10,000,000 MW of power the Fusion Power Plant could power the entire planet. And since the plant gives +100,000 :hammers: I was going to change it so every city on the planet had like +100 :hammers:.

I doubt I would ever build it. Assuming less than bald the cities on the planet are mine it's a larger net gain for my competition than for me.
 
Top Bottom