# Let's document GlobalDefines.xml!

Discussion in 'Civ5 - Creation & Customization' started by JohnnyW, Jan 14, 2011.

1. ### DeussuThe Omniscient

Joined:
Oct 21, 2010
Messages:
167
Location:
Finland
I'm gonna try too.

INDUSTRIAL_ROUTE_PRODUCTION_MOD (50) = Production bonus given to cities connected to the capital via railroad (+50 %)

LAKE_MAX_AREA_SIZE (9) = Determines how large a lake can be (9 tiles)

POLICY_COST_DISCOUNT_MAX (-75) = Determines the cap as to how much policy costs can be reduced (-75 %). At the moment I can't come up with any way to decrease them more than 50%.

EMBARKED_NOT_CIVILIAN_COMBAT_STRENGTH (500) = i.e. Songhai's embarked units have a strength of 500. Maybe this value applies to embarked units capable of defending themselves.

PLOT_UNIT_LIMIT (1) = Sounds like this is the notorious 1UPT?

ZONE_OF_CONTROL_ENABLED (1) = Boolean value (1 = true). Determines whether moving next to an enemy unit uses more movement than normal.

CITY_CAPTURE_DAMAGE_PERCENT (50) = After the city has been capture, its health is set at 50% (10 hp/20 hp)

CITY_RANGED_ATTACK_STRENGTH_MULTIPLIER (50) = Percentage of the city's attack strength (i.e. a city with 50 attacks a unit as if it had 25 strength.)

GREAT_GENERALS_THRESHOLD (200) = The amount of experience required to spawn a Great General.
MIN_EXPERIENCE_PER_COMBAT (1) = Minimum experience gained in combat.
MAX_EXPERIENCE_PER_COMBAT (10) = Maximum experience gained in combat.

SCORE_FUTURE_TECH_MULTIPLIER (10) = Each future tech researched grants this many victory points.
ALLOW_EXTENDED_PLAY (1) = Allows "One more turn..." option.

At least it's something.

2. ### deanejDeity

Joined:
Apr 8, 2006
Messages:
4,859
Location:
New York State
Why not create an account at the modiki? The page is blocked to unregestered users because of spamming and vandalism problems we've been having at the wiki.

Joined:
Feb 2, 2010
Messages:
1,052
Location:
Lancaster
4. ### deanejDeity

Joined:
Apr 8, 2006
Messages:
4,859
Location:
New York State
Why use the 2K one when we have our own? Or should I just delete the entire civ5 section of ours, since everyone only seems to care for the 2K one?

5. ### SamBCEmperor

Joined:
Feb 2, 2010
Messages:
1,052
Location:
Lancaster
Not many people care for the 2K one!

I keep contributing to that one because I was using it before I started contributing to discussion or anything here.

It also makes more sense to me to go with an official wiki because it does get some contributions from devs, and there's not too much sense splitting efforts, but on the other hand there are advantages to a fan one (like better host support in terms of mediawiki extensions, I'd bet), and everyone gets to have their own preferences. I've just decided to start actually putting stuff up rather than telling others they ought to. Maybe if I do that, and let people know I'm doing it, more folks will join in.

Joined:
Oct 8, 2010
Messages:
658
Location:
USA
Oops!

7. ### BomberEscortDon't be alarmed; this is a kindnessSupporter

Joined:
Jul 28, 2003
Messages:
1,125
Gender:
Male
Location:
Kansas City
NUKE_UNIT_DAMAGE_BASE (3) = 3 HP base damage to a unit
NUKE_UNIT_DAMAGE_RAND_1 (4) = 0-4 HP random damage from level 1 or 2 nuke
NUKE_UNIT_DAMAGE_RAND_2 (4) = 0-4 HP random damage from level 2 nuke
NUKE_NON_COMBAT_DEATH_THRESHOLD (6) = Non-Combat units take 6HP of damage
NUKE_LEVEL1_POPULATION_DEATH_BASE (30) = 30% of the pop is killed by Atomic Bomber
NUKE_LEVEL1_POPULATION_DEATH_RAND_1 (20) = 0-20% of the pop is killed by Atomic Bomber
NUKE_LEVEL1_POPULATION_DEATH_RAND_2 (20) = 0-20% additional pop is killed by Atomic Bomber
NUKE_LEVEL2_POPULATION_DEATH_BASE (60) = 60% of the pop is killed by Nuclear Missile
NUKE_LEVEL2_POPULATION_DEATH_RAND_1 (10) = 0-10% of the pop is killed by Nuclear Missile
NUKE_LEVEL2_POPULATION_DEATH_RAND_2 (10) = 0-10% additional pop is killed by Nuclear Missile
NUKE_LEVEL2_ELIM_POPULATION_THRESHOLD (5) = City less than or equal to this population is destroyed when hit with a Nuclear Missile
NUKE_CITY_HIT_POINT_DAMAGE (50) = Reduces city hit points by 50%

8. ### JohnnyWGave up on this game

Joined:
Oct 8, 2010
Messages:
658
Location:
USA
I've edited the OPs with the given info, thanks! Also added 1 or 2 others.

9. ### ThalassicusBytes and Nibblers

Joined:
Nov 9, 2005
Messages:
11,057
Location:
Texas
Clarifying this a bit, cost =

a: GameDefines.GOLD_PURCHASE_GOLD_PER_PRODUCTION
b: GameDefines.HURRY_GOLD_PRODUCTION_EXPONENT
c: cost
m: Building.HurryCostModifier

Also... their rounding function rounds down instead of to the nearest multiple of ten. This is rather puzzling because not much processing power is saved:

Down:
math.floor(num * 10^places) / 10^places

Nearest:
math.floor(num * 10^places + 0.5) / 10^places

10. ### DarkhourWarlord

Joined:
Nov 15, 2005
Messages:
165
Location:
Melbourne, Australia
i just have to say i found this thread.. well done.. its very helpful and should be a sticky

Joined:
Sep 21, 2005
Messages:
3,063
Location:
Los Angeles, CA
I've posted this in other threads, because I changed them in my mod, but here goes. I'm not just going to write one sentence for each, because it's just a little more complex than that.

Code:
```DIPLO_VICTORY_ALGORITHM_THRESHOLD (28) =
DIPLO_VICTORY_BEYOND_ALGORITHM_MULTIPLIER (35) =
DIPLO_VICTORY_TEAM_MULTIPLIER (1.1) =
DIPLO_VICTORY_DEFAULT_VOTE_PERCENT (67) =```
You need (67 - 1.1*N)% of the total votes to win (rounded down I believe), where N is the number of civilizations in the game (counting both regular civs and city-states, but NOT adding 1 for the U.N.). So on a default Small map (6 civs + 12 city-states), you'd need 47.2% of the votes assuming no one was eliminated along the way. Note that as civilizations and/or city-states are eliminated the percentage required goes up (N gets smaller), which can make the game effectively unwinnable by diplomacy if enough city-states go away.
So, the Default Vote Percent is the 67 in that equation, and the 1.1 is the Team Multiplier.

The remaining two variables form a cap: If there are more than 28 civs (Algorithm Threshold) in the game, just set the victory threshold to 35% (Beyond Algorithm Multiplier). 67 - 1.1*28 = 36.2, so 29 civs is where it'd be hitting 35% anyway. 28 civs really only comes up on the largest map sizes, and many civs will be eliminated before reaching the U.N, so this almost never comes up in practice. But for modding purposes, this'd allow you to set a flat percentage; if the Threshold was set to 0, then the Multiplier becomes a flat victory threshold. So you could say that it's ALWAYS 50% to win, regardless of map size, by setting these to 0 and 50.

The result of how these four are set up is that if you modify one of these variables, you'll need to also modify at least two others. Otherwise, the "cap" variables will be discontinuous with the normal scaling, unless you want one of the two methods to go away entirely.

12. ### sylvanllewelynPerma-newb

Joined:
Oct 19, 2006
Messages:
1,391
Why bother with difficulty levels, just give us sliders so we can set our own AI bonuses for every reasonable category.

13. ### SamBCEmperor

Joined:
Feb 2, 2010
Messages:
1,052
Location:
Lancaster
What does that have to do with GlobalDefines.xml?

14. ### sylvanllewelynPerma-newb

Joined:
Oct 19, 2006
Messages:
1,391
Difficulty levels are nothing but set values in GlobalDefines.xml, if they give us a more user-friendly interface like sliders when we setup our game, we can fix the game to our liking. "Customisable difficulty levels" should be a marketable feature, not hidden.

15. ### JohnnyWGave up on this game

Joined:
Oct 8, 2010
Messages:
658
Location:
USA
Okay, but that's something to discuss in another thread, thank you.

16. ### JA_LambWarlord

Joined:
Aug 19, 2009
Messages:
231
Location:
The changing Dark Continent
Hi. is this thread still operable? Can we add to it? will the powers that be transfer to modiki so that noobies like me can easily find it? or is it a ?

17. ### 3335dCCtP Player

Joined:
Jun 15, 2012
Messages:
642
I think that the meanings of globaldefines were quite straightforward. The DLL is the real challenge.

18. ### GedemonModderSuper Moderator

Joined:
Oct 4, 2004
Messages:
9,729
Location:
France
the global defines are sometime very confusing, same for Lua functions and even more for their variables, that's one of the reasons that modding had started slowly on civ5, now with the DLL it will be much easier to document all that.

19. ### JA_LambWarlord

Joined:
Aug 19, 2009
Messages:
231
Location:
The changing Dark Continent
Gedemon, thank you for trying to diffuse the above situation, by the thoughtless remarks of "335d" who quite literally offended all the people who submitted entries to this well intentioned effort to demystify the GlobalDefines File for those with a lower IQ than himself.

Obviously he has not modded in Civ4, where the XML files actually could be expanded and directly affect the game!

Anyway let me add my 2 cents worth of knowledge for this file.

LAKE_PLOT_RAND (160) = In Civ4 these were the same numbers. It meant that for every 160 tiles of the map there was a random roll, to include a lake.
PLOTS_PER_RIVER_EDGE (12) = That means that a river will usually be of 6 plots length, unless the map-script overrides this limit.
RIVER_SOURCE_MIN_RIVER_RANGE (4) = A river should flow at least 4 plots from it's source, unless the map-script overrides it.
RIVER_SOURCE_MIN_SEAWATER_RANGE (2) = 2 plots from the coast river start, governs forced rivers when a game is balancing areas to make them better for settling.

BUILDING_PRODUCTION_DECAY_PERCENT (99) = The amount of decay that is allowable for a building to reach, if started then dropped lower in the building que, if other City builds take preference, before it is dropped from the que altogether.
UNIT_PRODUCTION_DECAY_PERCENT (98) = The amount of decay allowed for a unit to reach, if started then dropped lower in the building que, if other City Builds take preference, before it is dropped from the que altogether.

USE_FIRST_RING_INFLUENCE_TERRAIN_COST (0) = The first ring Influence Cost around a city. When a city is founded, the first ring costs nothing in culture or gold.

MIN_START_AREA_TILES (4) = An area of less than 4 tiles will not be picked by the map script as a starting area for a CS or a Civilization.

MIN_DISTANCE_OTHER_AREA_PERCENT (75) = 75% of the basic 9 tiles distance defined by (Sirian) W. Thomas, in the basic map-script of Starting Assigns.

From what I have seen of the GlobalDefines File, I'll be very surprised if experienced dll modders of Civ4 will not encounter dear and known friends in this dll. I wonder how many will now port over to CiV.

20. ### RafalafChieftain

Joined:
May 2, 2017
Messages:
18
Gender:
Male
Location:
PA, USA(Originally from Szczecin, Poland)
Question: by cost you mean the cultural cost or the gold cost?