Noob project questions: +XP for garrisons?

Iceco

Warlord
Joined
Oct 27, 2010
Messages
188
First of all, hello all and may my thread be free of newbie sins. (Like, say, beginning your posting career by making a new thread.)

The problem
I would like to make a mod that adds an alternative for units to gain XP (and eventually promotions), so as to give peace-oriented players a chance to improve their units and have a fighting chance against others who are constantly fighting and earning promotions.
Troll: "It's called the Barracks, Armory and Military Academy." Answer: That's typically the buildings a peace-oriented player skips, or is that me failing at Civ?

The solution(s)
I was thinking of letting garrisoned units earn XP one way or another, namely:
- Replacing one(/all?) of the +XP buildings to give XP every turn instead of on unit creation. The problem is that giving it to barracks could make it overpowered, the armory would bring it out of eyesight of the target audience of peaceful players and the Academy is too late in the game. Using all would make it a feature oriented towards aggressive players and make it overpowered.
- Adding/editing another building for this purpose. I was thinking of editing the forge, because of its place in the tech tree (around the time as when you get the option for the production to gold/science) and its requirement of an iron source would make it scarce enough not to work overpowering. (Though again, the peaceful, small empires are less likely to have a source of iron nearby.)
Alternatively, I could just add a 'training camp' at that stage.
- A production to XP perk. It's maybe the most straightforward option (25% production to XP). My guess would be to add it to the Civil Service tech, but that one already is a rather powerful one.
- A perk (like the +1 food perk of Civil Service). Giving all garrisoned units, regardless of the specific buildings of its city, a small XP gain (1XP per turn?) is the most simplistic solution, but maybe a little too. Could be balanced with a requirement of a hill nearby or something. And again, Civil Service seems the best candidate.
- A combination of the above. Like a Civil service perk, requiring a Barracks.

The questions
- To begin with: Is it possible? I'm reading through Kael's guide and begin to think it would need to go beyond XML.
- Is it something people want? No point in doing something no one is even remotely interested in.
- What is the best way to implement it? Give your feedback on what implementation is the best.

Other
If people have little hope I'll be able to do pull this off, but actually do want to see this happen, they're welcome to hijack it.
The same goes for making it part of your bigger mod. It's a small feature, so if someone wants to add it to a larger mod, I'm fine with that. (Though we aren't at that stage yet.)
 
I think it'd be nice to be able to make Barracks cost high maintenance to give XP to garrisoned units every turn. I mean it'd have to be a really light amount (a combat trained unit will always be more experienced than a schooled unit) but it should be enough to matter.
 
The questions
- To begin with: Is it possible? I'm reading through Kael's guide and begin to think it would need to go beyond XML.
- Is it something people want? No point in doing something no one is even remotely interested in.
- What is the best way to implement it? Give your feedback on what implementation is the best.
i don't think theres any xml you can set that will give xp like that, but you can do it with lua. check for combat unit in city with building then add xp, first GetExperience(), then calculate and apply with SetExperience(value)
 
I think it'd be nice to be able to make Barracks cost high maintenance to give XP to garrisoned units every turn. I mean it'd have to be a really light amount (a combat trained unit will always be more experienced than a schooled unit) but it should be enough to matter.
I guess it would be 1XP, versus the 4XP a unit gets from combat. That seems about right, as in combat you'll also be able to 'train' several units at once, compared to the one unit that would benefit from the Barracks.
The problem would be that it would favour ranged units, as they currently get lower XP (2XP) from combat, I believe. For them, the garrison would mean a significant boost.

If we wouldn't change the Barracks itself, another way to balance it would be to add a change modifier, so the +1XP would only have a chance of 50% to be applied or something (unless of course the game allows for decimals in the XP, in which case there is no issue to begin with).

However, I think modifying the Barracks could be annoying for those that like that cheap and quick +15XP. I think one of the other options is better.
i don't think theres any xml you can set that will give xp like that, but you can do it with lua. check for combat unit in city with building then add xp, first GetExperience(), then calculate and apply with SetExperience(value)
Great.
I'll look for some how-to's for LUA and probably dissect some existing LUA mods to see how to do it.
 
Could go as far as making this a new building type called a Military Academy or something, then having each of your cities with one would unlock West Point as a Wonder which is a better version of it.

But that'd be later down the line.
 
I like the idea of making it a national wonder, though without the need to build everywhere.

For example: National Training Center, requires a barracks in the city to be build. Provide 1 or 2 exp each turn. Since you could only build one being, a national wonder, I don't think it would be to powerful. However attaching it to every barracks I think would be to powerful, unless you slow down the exp gain, which would be hard to add fractions of a point of exp. But I do love the idea.

Every civ should have some elite troops.
 
Similar ideas were successfully implemented in various Civ4 mods (e.g. RifE, IIRC); I recall their implementations having an XP cap meaning one could train units in cities up to a certain XP level but then no further -- additional XP could only be acquired through combat. Methinks implementing a similar system in Civ5 would be on the agenda for various modders, no?
 
I like the idea of making it a national wonder, though without the need to build everywhere.

For example: National Training Center, requires a barracks in the city to be build. Provide 1 or 2 exp each turn. Since you could only build one being, a national wonder, I don't think it would be to powerful. However attaching it to every barracks I think would be to powerful, unless you slow down the exp gain, which would be hard to add fractions of a point of exp. But I do love the idea.

Every civ should have some elite troops.

I think either National or World Wonder would be awesome, National would probably be more fair.

Also I think some number of them should be required, maybe not all of your cities but like 3-5
 
The national wonder sounds like a good idea, though I don't really think a 1 or 0.5 XP per turn would quickly overpowered any way. (Warring nations get 4XP per attacking unit per turn, easily netting close to 20XP per turn in full combat.)
I don't know if you can give national wonders other requirements than the 'must have building x in all cities', but others will probably be able to tell us. However, I don't think this needs to be made easier. Big tech/military empires don't actually need this bonus, it's more intended for the small cultural empires that are generally a little behind on techs and can't gain XP the conventional way.
If not a wonder, perhaps you can limit the amount of instances of that building by giving it an incremental maintenance cost per time it is built? (Though again, that does sound like it's not possible.)

An implementation with an XP cap lends itself more for more 'casual' methods, that don't pose that many limits as a national wonder or building with high maintenance. For example, you could have the Barracks, Armory and Academy have their +15XP gradually apply (1XP/turn) to units that don't have that much yet or more interestingly, that weren't created in that city. Though I don't think units have a variable defining what city they were built in.
This method would be more of an extension of the military strategy, rather than a balance for those missing out on opportunities to gain XP.

Is the straightforward production to XP solution discarded? For me it seemed like the most honest way to give your units an XP boost in times of need. (At a 25% conversion rate, that would mean a normal rate in a mid-game city of 20 production and a significant rush in late-game production cities.)
 
Back
Top Bottom