A few simple questions about modding.

Cyrus of Persia

Warlord
Joined
Feb 26, 2011
Messages
114
I'm new to modding for CIV5 and learning. Have just a few quick questions.


1. Is it possible to modify the rate at which food requirement for pop growth increases in a city? (15 --> 25 --> 33 --> 44, etc)

2. Is it possible to modify the rate at which culture requirement for border growth increases in a city?

3. What about the rate of increase of culture requirement for policies? Modifiable? (aside from number of cities modifier, I assume that's doable)

4. How about the rate increase of cost of buying tiles as well as the base cost?

5. Is it possible to change the benefit that a CS gives you (like food for maritimes or Culture for cultural CSs) to something else such that lets say a maritime CS doesnt give food anymore but gives gold or hammers or something...? Also is it possible to change how much they give?


I have more but cant think of them now. Thanks for any help. Simple short answers will do. Thank you.
 
Yes, yes, yes, yes, no.

Most of the first four are in GlobalDefines. It's not hard. Changing city-states like that, however, is impossible.
 
Thanks for the help :).

About the hurry feature, obviously there is a game file for this "CIV5HurryInfos.xml". Does the game actually have a hurry feature other than for great engineers? Is it possible to actually implement the hurry features?

I'm new to the game, I havent played it enough to see it all yet. I played a bit and the game was so bad I didn't bother past the 100th turn realizing the only way this game would be worth playing is if modded. hence my simple and basic questions.

I used to mod for Civ3 and am a good general modder. So I'm trying to learn different aspects of the game which are not so easily discovered.

Also, is the game policy branches limited to 10? is each branch limited to 5 options? (for modding)
 
Does the game actually have a hurry feature other than for great engineers? Is it possible to actually implement the hurry features?

Yes, you can create new units that can be used to rush like a Great Engineer, with varying amounts. For instance, in my own mod I've got a Golem unit that rushes for approximately what it cost to build, so it's a decent way to transfer production between cities. (It's also a somewhat weak combat unit and can do some basic worker actions, so you might not want to rush with it.)

I didn't bother past the 100th turn realizing the only way this game would be worth playing is if modded.

Play a full game, at least once, before you try the balance mods. I know it's a cliche, but the game gets better as you get into the middle of the game. Once each empire has a few spare luxuries, a positive cash flow, and armies consist of a variety of units (especially cannons/artillery backing up troops) it gets more interesting. Once you know how these things change, it'll be a lot easier to understand what changes are good.
Of course, then it starts sucking again in the endgame, since you'll quickly reach a point where you're absolutely going to win and it's just a question of "mopping up". So lots of mods have tweaked the balance to keep that last part from happening, especially my own. Anyone who adds future eras to the game needs to tie it to something like this, or else the players will never get TO your new content.

Also, is the game policy branches limited to 10? is each branch limited to 5 options? (for modding)

No, and no. The number of branches is limited to 10 by the UI, but if you're willing and able to edit the UI files that then you can add more. (A few people have, but it's not easy.) Adding new policies within a branch is much easier; in my own mod, I added an additional (and more powerful) policy to each branch, and gave each a tech prerequisite so that you couldn't rush to them in the early game. To win with culture, that means 35 unlocks instead of 30, and the game handles it just fine.

The only UI headaches come from having to rearrange the icons to get the arrows to draw correctly. If you go to the thread for my mod, I've got a screenshot there of the Policies window with the extra policies added and things rearranged a bit better; it's in the sixth post of the thread. The only real headache is that the icons are placed on what's effectively a 3x5 grid where two boxes can't be adjacent in X values at the same Y (meaning it's more like 3x3 but with the ability to stagger the boxes a bit). So you can't put more than 9 policies in a single branch, and more than 6 would really limit your ability to set prerequisites. Although like with the 10-branch limitation, anyone who knows how to edit the UI can easily resize the boxes to fit more of them in, I suppose.
 
Excellent. Thanks for the help. This is very promising as I have some really good ideas.

Is it possible to have "negative" requirements for policies? By this I mean: you have to NOT have taken "A" to be allowed to take "B". Sort of like policy branches but for policies themselves, within the same branch.

Also where can I learn more about this grid you speak of? Is it the the "Modding Manual" PDF file?
 
Is it possible to have "negative" requirements for policies? By this I mean: you have to NOT have taken "A" to be allowed to take "B". Sort of like policy branches but for policies themselves, within the same branch.

Not as far as I know. There's probably some way to manually disable a policy as an option in Lua, but I don't know of one and it'd probably be extremely buggy. (And like many other things, the AI would be utterly incompetent at it.)

Also where can I learn more about this grid you speak of? Is it the the "Modding Manual" PDF file?

No. It's built into the Lua that draws the windows. Each branch's box can have three possible GridY values, each of which designates a distinct row. But the GridX can have 5 possible values, and the spacing between each is barely half the width of the policy buttons used. The result is that if you had one policy with GridX=2 and one with GridX=4, they'd look adjacent (with just enough room between them for an arrow to pass through), and if you tried using 2 and 3 they'd overlap.
Thus, while it's technically a 3x5 grid, you can't actually fit more than 3 boxes on each row without overlapping the buttons for the various policies. In practice, it's not hard to add a sixth policy to each branch (which is exactly what I did) but going higher than that really limits your ability to arrange the buttons in a way that shows the dependencies well.

The easiest way to see this is just to open up the Policies file yourself, look at the GridX and GridY values for each policy, and compare with a picture of the window.

A similar logic goes for technologies on the tech tree, except without the overlap issue; they're actually placed on a 10x15 grid (which can easily be extended in the x-direction; it's 10x25 in my mod), and the tech entries simply declare a "GridX" and "GridY" value for each tech. TechTree.lua and TechTree.xml then place the box in the appropriate spot on the screen to form that grid.
To make up for its simplicity in positioning, the tech tree has a much more complicated logic for drawing dependency arrows. It's far easier to break the arrows, if you're trying to have a tech lead to/depend on several techs with different X values.
 
great. Thanks guys.

If I wanted to to create a branch to represent a government type with its respective policies, I would also need to implement a system where the player could change the government if he wanted, which would imply a switching away from one branch to another.

Has anyone already implemented a way to switch policies? Is that possible? Or are you always stuck with what you pick to the end of the game?
 
Oh one more thing,

Is it possible to give production penalties for annexing new cities? such that your new captured city would have a penalty (by percentage for example) to its production or gold output. Is it possible?

If not normally possible... do you think it could be made possible through civ traits or through policies?
 
You can already switch policies, you just don't get the culture back... if you take a branch, and then a branch that's mutually exclusive with it, the earlier branch gets 'turned off', and you can spend a policy choice turning it back on, which turns the newer branch off.
 
Oh I c. heh, thank goodness.

and one more thing (sorry :crazyeye: ), is it possible to make unit upkeep exponentially more? so your firrst unit might cost 1 gpt , but your 5th unit might cost 2gpt. possible?
 
Through XML, no. Through Lua, it's not hard to subtract money from each civ each turn, with the amount depending on the number of units you have. The AI, as usual, would have no idea how to deal with this, though. It'd keep making more units, and not understand why its money kept going down.
 
Anyone know this...

Can a building be made to require the city to have "x" number of citizens before the building can be built?

Also can cities be made to be capped population-size-wise based on availability of certain buildings? For example your city wouldn't grow past size 20 without a hospital.
 
Can a building be made to require the city to have "x" number of citizens before the building can be built?

No. There's a "LevelPrereq" that breaks cities into "small", "medium" and "large", and you can have buildings depend on being in a size category that way. But it's not adjustable to an explicit size.

Also can cities be made to be capped population-size-wise based on availability of certain buildings? For example your city wouldn't grow past size 20 without a hospital.

Like practically anything else, it's possible to do this in Lua (at the end of each turn, check the city. If it doesn't have building X and is at size Y, then remove an amount of food equal to its surplus.), but if you do so then the AI will have no clue why its cities aren't growing. So it'd be horribly unbalanced in favor of the player.
 
No. There's a "LevelPrereq" that breaks cities into "small", "medium" and "large", and you can have buildings depend on being in a size category that way. But it's not adjustable to an explicit size.



Like practically anything else, it's possible to do this in Lua (at the end of each turn, check the city. If it doesn't have building X and is at size Y, then remove an amount of food equal to its surplus.), but if you do so then the AI will have no clue why its cities aren't growing. So it'd be horribly unbalanced in favor of the player.

Spatzimaus - do you know what these small/medium/large sizes are? Are they a specific number? Or do they represent a specific criteria like how much food/how many buildings/how much culture/etc a city has?
 
as always Spatzimaus to the rescue, the most responsive helpful person I've met on this forum so far. Once again thanks a great bunch for the quick answer.

I meant to ask this question as well but slipped my mind. Does the amount of experience a unit can gain from normal combat (not barbs) have an adjustable maximum? So that a unit can only gain so much XP.

I also second markusbeutel's question. :)

@ markusbeutel: I live in the same city as you! :cool:
 
as always Spatzimaus to the rescue, the most responsive helpful person I've met on this forum so far. Once again thanks a great bunch for the quick answer.

I meant to ask this question as well but slipped my mind. Does the amount of experience a unit can gain from normal combat (not barbs) have an adjustable maximum? So that a unit can only gain so much XP.

This can be easily capped for XP received from both attacking and defending.

It's in the CIV5UNITS.xml:

<XPValueAttack>3</XPValueAttack>
<XPValueDefense>3</XPValueDefense>
 
I dont understand. What is 3?

I'm trying to limit how much experience a unit can gain overall in order to limit how many promotions it can receive.

The thing you mention, is that what that does? It sure doesn't seem like it.

3... !
 
I dont understand. What is 3?

I'm trying to limit how much experience a unit can gain overall in order to limit how many promotions it can receive.

The thing you mention, is that what that does? It sire doesn't seem like it.

3... !

Ahh - what I posted only determines how much XP you get from an individual attack or defense. I'm not sure how you would cap the overall amount a unit receives.
 
Spatzimaus - do you know what these small/medium/large sizes are? Are they a specific number?

I don't know. The sizes are set in the CitySizes table (in the BasicInfos directory), but there's no number associated with them, which means it might be hard-coded inside the engine, adjustable based on era, or depending on culture/buildings. My guess is that it's UI-based, telling the game whether to draw a big sprawl or not, but that could depend on a lot of different factors.

Regardless, I've used it in my mod, where some buildings can only be build in larger cities. It helps keep the build lists from getting out of control, but I'm not sure what the exact triggers are. If you're trying to make something like in the older games, where growth absolutely stopped at size 7 and 13, then no, as far as I can tell you can't (Good riddance, IMO.)

If you're trying to cap growth with buildings, you can get a similar effect just by increasing the exponential part of the growth curve, and then adding more food storage buildings along the way. So just when the growth starts getting unmanageably large and your cities stall out, a new building suddenly reduces the amount of food needed for the next size and you're off again. (Take a wild guess whether I have a mod that does exactly this.)

Does the amount of experience a unit can gain from normal combat (not barbs) have an adjustable maximum?

No. Other than barbarians, there's no cap. You can cap the amount of XP for a single combat (currently Min=1, Max=10), although that's overridden by multipliers in other tables. For instance, I had a unit with a base XP per fight of 5, which then had a +100% XP promotion, AND a +100 XP policy, and it was getting 20 XP per fight.

You can also make it so that fights within your borders are multiplied by a constant, either up or down (default is 100, obviously).

Ahh - what I posted only determines how much XP you get from an individual attack or defense.

Actually no, it's very strange. The amount you get from an attack is set in GlobalDefines, and is a function of type classes. So air units bombarding get one number, ranged units bombarding get another, melee units get another, et cetera. These are listed as EXPERIENCE_ATTACKING_UNIT_MELEE, EXPERIENCE_DEFENDING_UNIT_AIR, and so on.

The value in the Units table doesn't seem to be used, or at least not under normal circumstances.
 
Back
Top Bottom