Dom Pedro's Promotion Project

Dom Pedro II

Modder For Life
Joined
Apr 3, 2002
Messages
6,811
Location
Exit 16, New Jersey
Greetings, folks...

I thought I'd let you all in on what I've been working on lately.

I've been working on a big bundle of features for promotions that I need for my mod and I'll be releasing as a modcomp so other people can use them.

But the list includes:

Requirements for Promotion:

Prerequisite Civic: Just as it sounds... a player needs to have this civic to get the promotion.

Prerequisite Bonus: Player has to have a specific bonus to get the promotion... does not support multiple bonuses. (I'm not that qualified yet :) )

Prerequisite Building: Since this isn't like training or constructing units and buildings in cities, this simply checks whether the player has one of the specified buildings anywhere... so it's best for wonders.

Prerequisite State Religion: Again, since it's not city-by-city, it's based on the current state religion rather than the religion of any one city.

Civ-specific Promotions: Basically, narrows the civilizations that can get a particular promotion.

Requires Battle: This basically prevents you from being able to acquire a promotion if the unit has not yet won a battle... so you can't just get tons of stacking free XP points and level right on up the line... the unit actually has to do some fighting.

Requires Victory: The unit has to actually win a battle. Withdrawing isn't good enough.

Requires Slave Capture: This has no use in vanilla Civ... but combined with other mods that allow for capturing slaves, this will be a requirement for a promotion.

Promotion Effects:

Unit Stack Modifier: This alters a units strength based on the number of units on the tile... there's two values for this: the modifier percent and the "threshold". The threshold is the number of units that can be present on one tile before the modifier takes effect. A negative value has a specific formula that reduces the penalty for each additional unit beyond the threshold so that it's not possible to get to 0 strength or a negative value. A positive value simply adds up the number of units multiplies it by the modifier percent and then multiplies that by the current strength.

Foreign City Defense Modifier: This reduces or increases the effectiveness of a defending unit based on the cultural percentage of the city... i.e. if there's less of that civilization's people in the city, the unit's defense ability is lowered.

Anti-Promotion Modifier: Just what it sounds like... you can have promotions that work against units with other promotions.

Unit Class Modifier: Promotions that target specific unit classes rather than only Unit Combats (the original Unit Combat Modifier has not been touched)

Make Invisible: This promotion feature makes a unit invisible.

Terrain Invisibility: This makes a unit invisible when its on a specific terrain type.

Feature Invisibility: Same as above but with features.

Terrain Withdrawal Change: Alters the withdrawal chance of a unit when attacking from the specified terrain.

Feature Withdrawal Change: Same as above but with features.

Terrain First Strikes Change:Adds or subtracts first strikes based on the terrain the unit is in.

Feature First Strikes Change: Same as above but with features.

Terrain Heal Change: Changes the heal rate of a unit (only that unit, not the healing of other units on the stack) based on the terrain it's on.

Feature Heal Change: Same as above but with features.


Ok, so why all these things? The terrain stuff was inspired by something I saw in the FfH forum about units being invisible on certain terrain and decided it was a great idea and I wanted to be able to have the same thing myself. So then I started to look around at what else I could change and came up with these things.

As for the requiring the capture of slaves, I want this to make a civ-specific promotion for the Aztecs... and I want to do away with the Jaguar unit. Jaguars couldn't be built... becoming a Jaguar was a right that had to be earned on the battlefield by capturing at least five slaves to be sacrificed. So this would allow a unit to be upgraded to a Jaguar when it captures a slave and has the XP needed for another promotion.

The Unit Stack Modifier is intended for several reasons... 1) to help break up the stack of doom. 2) I want certain units to be particularly powerful when alone but not when traveling in groups... in particular, I want this for special ops units. If they're traveling with a huge army, they sort of lose their effect. It's also meant to be used as part of a much broader change to the combat system I'm planning.

The Foreign City Modifier is meant to be used for Raiding traits that give powerful offensive capacity to those civilizations but at the cost of being less able to hold what they take. Again, it's part of much more broad changes I've got planned for the future.


Lastly... what's my progress? Have I got something solid here or are these just the fevered dreams of a madman? Well, let me assure you that every single one of these things has been put by me into the SDK already... Some are not completed, some are having some snags (which I'll be sure to pester more experienced coders about), but I'm going to start running tests very shortly and then will be looking for beta testers sometime after I've run my own tests.

Comments? Questions? Criticism? Suggestions?
 
Unit stack promotions and civ specific promos sound cool, but this one..

Requires Slave Capture: This has no use in vanilla Civ... but combined with other mods that allow for capturing slaves, this will be a requirement for a promotion.

sounds simply super killer sweet. :)
 
would be nice if "Unit Stack Modifier" could be set to type of units too like in my mod (like if there are 5 str of melee a bonus is given).

Also add flee/withdraw on defend promotions.
Add attack/defend effect, so you don't have to make it that way I have (having a defence negative bonus on all terrain/features and a combat bonus).
 
Spartan117 said:
any idea of the actual default values the different promotions are adding?

Well, I've not actually been able to start testing this yet, so I'm not really sure... This is not going to be a mod in and of itself, so whatever promotions I do include in the modcomp will be there mostly for the purposes of demonstrating the new features.

For the purposes of my own mod, the values are going to be very different within the context of the new system I have in mind. See below for more details.

Zuul said:
would be nice if "Unit Stack Modifier" could be set to type of units too like in my mod (like if there are 5 str of melee a bonus is given).

I may expand upon this later, but right now, I want to keep it relatively simple. At the moment, I envision it being useful as penalties for the reasons I mentioned above, but it might also be used in something like a fantasy mod if one wanted to have a unit that's very weak but grows stronger with each unit on its tile... like it's being powered by their auras or something.

Zuul said:
Also add flee/withdraw on defend promotions.

This is a bit beyond the scope for now, but I would definitely like to add the ability for defenders to withdraw as well. The problem with withdrawing defenders is: where do they go? Do they flee directly back? If they're in a city, do they leave the city even if they're the last defender? It'd require more than just adding a promotion affecting the chances of such a withdrawal.

Zuul said:
Add attack/defend effect, so you don't have to make it that way I have (having a defence negative bonus on all terrain/features and a combat bonus).

You mean like the old Civ game Attack/Defend values? There are already tags that give bonuses or penalties depending on whether a unit is attacking or defending another kind of unit, but if you mean something that applies for all units, maybe that could be done in the future.


Some additional promotions and features I'm intending to do are:

first strikes and withdrawal chances when attacking across rivers or from boats... in my mod these will be rather limited in application however... I think I may give these to Marines, but specifically I want them because I want to add a Crocodile and Hippopotamus animal units that can attack you and I want them to linger around rivers and swamps.

Terrain/Feature modifiers for bombard rate Basically, this will increase or decrease the bombard rate of a siege unit depending on the tile. I want to give Catapults, Trebuchets, etc. a slight bonus when bombarding a city from hills and a slight penalty when bombarding from Forests/Jungles.

Penalty for fighting on foreign soil This would be used to reduce combat effectiveness when fighting on any tile not owned by that player. (added)

The Alamo Effect This may or may not be a promotion in the future... It may be because it will give more moddability, but I do not intend to use it as such... essentially, what this does is, if the unit is the last defender in a city (or the only defender if there were no other units there to begin with) before it dies, it gets a boost to strength thus enabling it to fight on a little longer.

What do I want to use it for? It's part of a general expansion of the Aztecs... the Teocalli, the Aztec temple, was not only a religious structure but also an arsenal and a fortress. If a city was attacked, the Teocalli was the last structure to fall... the invaders would burn it, and this would be a symbol that the city had truly fallen. So the idea here is that the Teocalli will be a last ditch defensive structure... but what I may do is use python to give the "Alamo" promotion to a unit if the conditions are met that the building is present and the unit is the only unit in the city.

Basically, in the Age of Man, each civilization is different. Instead of one unique unit and one unique building, there are many... and each supports each other and pushes that civilization into a particular strategy for victory.

In addition to that, I also want just blanket bonuses and penalties for each civ that I've chopped up into modules... so a civilization might be classified as Nomadic, Tribal, and Imperialist or Sedentary, National, and Isolationist. Some of these would be static, others dynamic... for example, whether a player is Agrarian or Pastoralist is dependent on where they start. Similarly, being Seafaring, Plains People, Jungle Dwellers, Arctic, Hill People is also dependent on where you start. And the bonuses will minimize the impact of a very bad starting location, but the downside is that you may find it more difficult to move into other environments.

Promotions will be key to doing this since different civs with different traits will get different promotions right off the bat.

And this feeds into the next part... the changes in the combat system:

I'm dividing up promotions conceptually if not mechanically into several different categories...

Skills - Promotions as they are now... earned through combat that alter a unit's skills.
Formations - A unit will be created with different formations... the formation can be changed as well.. and different formations will make units more or less vulnerable to other kinds of units.
Equipment - Units will now have different kinds of equipment that will be able to be replaced and upgraded throughout the game to A) reduce the disparity between different generations of units but still requiring strong research to make new equipment available B) to allow existing units to be specially tailored to fight certain units.

For example, Torpedoes and Rockets are now two "promotions" available for Fighters. You can fit a Fighter with Torpedoes and they'll blast ships out of the water, or you can fit them with rockets and they'll wreak havoc on Tanks and Infantry... but try to use torpedoes on Tanks or rockets on Ships and you'll find them rather ineffective.

So this will require some python work so that you can bring up a widget to display a current unit and allow you to reconfigure them to have certain promotions... equipment promotions CANNOT be gained through XP... and skill promotions CANNOT be swapped. And units that have been refitted will not be able to move that turn. All units will have a default configuration, and civilization traits will alter what equipment a unit starts off with depending on their strategic preferences.

Then there's also Trait promotions like I discussed above that are given to units depending on their civilization's traits.

The different promotions will be distinguished as such... the skill promotions, which are basically all existing promotions in the game, will remain blue. Formation promotions will be a red version with that same kind of stenciled look, and equipment will be a green version. The traits, however, will be more colorful, artistic pictures that'll add a little more life to things.

This was the reason I was asking about changing the display of promotions in the main interface... I'll need to make it easier to organize since units will have a lot more promotions even though they won't have too many more "skill" promotions.

Another thing once I've got the promotion features released is exploring the possibility of switching graphics depending on the equipment. People said you can't add new animations, but I'm wondering if one can change the path of existing animations... I noticed that there seems to be a way to set NIFs and set KFMs... so I'll have to do some experimenting (unless somebody already knows the answer). But I would like to be able, if you switch to Torpedoes, for example, for Fighters to have a torpedo attack, or if you switch from a Swordsman with metal armor to one with leather armor that the unit's graphics would change to reflect this.

All of that is, of course, much farther down the line. Right now it's a matter of getting these current promotion features working. I just thought I'd let you all in on what's planned for the future.
 
All of this sounds great. I'm going to have to rethink my promotion proposals for Composite XL, if this is in the near future.

Dom Pedro II said:
This is a bit beyond the scope for now, but I would definitely like to add the ability for defenders to withdraw as well. The problem with withdrawing defenders is: where do they go? Do they flee directly back? If they're in a city, do they leave the city even if they're the last defender? It'd require more than just adding a promotion affecting the chances of such a withdrawal.

If you ever decide to implement this (and I think that would be a good thing), I would say that it should...
1. Only apply to units with a defense bonus smaller than X
2. A successful retreat should move the unit to a random unoccupied tile if it is available. If no unoccupied tiles ar available, the unit dies.

On the topic of withdrawal mechanics, I'd like it if different level units withdrew at different points in battle...a level 1 unit might withdraw at half damage, a level 2 unit at one-third damage, a level 3 unit at one-quarter damage, etc.

For ideas:
How about improvement attack/defense modifiers? I'm thinking something along the lines of
"Entrench I - +20% defense on Roads and Railroads"
and
"Overwhelm I - +20% attack on Roads and Railroads"
or, similarly...
"Homestead I - +20% defense on Farms, Windmills, Watermills"
"Pillage I - +20% attack on Cottages, Hamlets, Villages, Towns"
...You get the idea.

I've mentioned it elsewhere, but an attrition mod (with attrition-reducing promotions) would be very nice, but that might be beyond the scope here. Was this what you were aiming for with the "heal rate" promotions, and/or is it creatively doable with said promotions (IE changing heal rate in all territory to different negative levels and using heal rate promotions to push that rate into the black).

Latitude promotions?
(I could see this overlapping unnecessarily with terrain-specific proms; I can't think of useful applications, but mention it because someone might be able to think of a creative use for it...the idea would be to provide effects that only exist when the unit is within a given span of latitudes. Perhaps something weather related?)

Cover Promotions?
(Promotions that exist only when a unit is within range of a "free" unit of a given type)
Example: Close Air Support - +25% Attack and Defense under Fighter Air Cover
Beachhead - +25% Attack when attacking from same square as at least one Battleship

Promotions with varying effects by technology...
(This could be applied to a *lot* of different promotions)
Example: Sharpshooters (requires Rifling) - +15% Strength, +10% with Assembly Line, +10% with Optics, +10% with Communism, etc.
...You may be trying to achieve this effect with "equipment" or promotion upgrades, but its an idea. Just one Promotion with gradually increasing effects.

Mod-specific promotion tags...
I'm thinking specifically for Revolution Mod, where a unit can only be promoted with "Counter-Revolution" when the revolution index is high.

Combined Arms/Formation promotions (not far off from "cover", above):
Example: Tercio (Musketman) - +2 First Strikes when stacked with at least one Pikeman
Tercio (Pikemen) - +25% Strength when stacked with at least one Musketman
 
GRM7584 said:
If you ever decide to implement this (and I think that would be a good thing), I would say that it should...
1. Only apply to units with a defense bonus smaller than X
2. A successful retreat should move the unit to a random unoccupied tile if it is available. If no unoccupied tiles ar available, the unit dies.

I was thinking of something along those lines.. but I think I'll work it as such:

XOX
XOX
XXX

Where the O is the attacker and the O is the defender and the X's represent valid retreat tiles and the X's represent invalid retreat tiles.



For ideas:
How about improvement attack/defense modifiers? I'm thinking something along the lines of
"Entrench I - +20% defense on Roads and Railroads"
and
"Overwhelm I - +20% attack on Roads and Railroads"
or, similarly...
"Homestead I - +20% defense on Farms, Windmills, Watermills"
"Pillage I - +20% attack on Cottages, Hamlets, Villages, Towns"
...You get the idea.

I was considering something like this actually... dunno whether I'll do it or not. I don't want it to get to the point where the AI has absolutely no idea how to fight effectively anymore. But yes... it makes sense for roads to give some entrenching ability.

I've mentioned it elsewhere, but an attrition mod (with attrition-reducing promotions) would be very nice, but that might be beyond the scope here. Was this what you were aiming for with the "heal rate" promotions, and/or is it creatively doable with said promotions (IE changing heal rate in all territory to different negative levels and using heal rate promotions to push that rate into the black).

The issue of attrition and supply lines is being worked in later where units store a certain amount of food or fuel and then gradually that supply is worn down unless connected to the rest of the empire by supply.

Latitude promotions?
(I could see this overlapping unnecessarily with terrain-specific proms; I can't think of useful applications, but mention it because someone might be able to think of a creative use for it...the idea would be to provide effects that only exist when the unit is within a given span of latitudes. Perhaps something weather related?)

The only circumstance I could really see this being useful with is for ships on ocean tiles because an ocean tile is an ocean tile regardless if it's at the south pole or the equator. So you could have something like "Braving the North Seas" (too long-winded I know) that could reduce chances of being sunk in the rough seas farther north.. of course, that would also require that there be storms implemented...

Cover Promotions?
(Promotions that exist only when a unit is within range of a "free" unit of a given type)
Example: Close Air Support - +25% Attack and Defense under Fighter Air Cover
Beachhead - +25% Attack when attacking from same square as at least one Battleship

Dale has something similar to this already in his mod, and this would not really require any new functionality or tags for the promotions... just python changes that would check to see if the unit is within range of the Fighter or Battleship and apply the promotion if it is. It would function very much like Jeckel's Fort mod except that instead of checking if the unit is on a fort, it would check to see if there were any of the specified units in range.

Promotions with varying effects by technology...
(This could be applied to a *lot* of different promotions)
Example: Sharpshooters (requires Rifling) - +15% Strength, +10% with Assembly Line, +10% with Optics, +10% with Communism, etc.
...You may be trying to achieve this effect with "equipment" or promotion upgrades, but its an idea. Just one Promotion with gradually increasing effects.

Yes, this is basically the idea... for example, Riflemen start of with "Muzzle-Loader Rifles" and then get "Breech-Loader Rifles" which increases their strength... similarly, Musketmen go from "Matchlocks" to "Flintlocks"

Mod-specific promotion tags...
I'm thinking specifically for Revolution Mod, where a unit can only be promoted with "Counter-Revolution" when the revolution index is high.

Yes, I would like things to be used with jdog's mod as it will be a cornerstone of my mod. However, I've not delved into his code at all and so I wouldn't know where to begin doing that... but I can definitely say this is a big maybe at some point if he does not do it himself.

Combined Arms/Formation promotions (not far off from "cover", above):
Example: Tercio (Musketman) - +2 First Strikes when stacked with at least one Pikeman
Tercio (Pikemen) - +25% Strength when stacked with at least one Musketman

This is akin to what Zuul was saying earlier... and it seems like a pretty sound idea. I may get around to it eventually, but right now, I'd like to just get this simplified version working correctly. :)
 
A retreating unit should first move to friendly units near if there are any, else random location away from the attacker.
 
Zuul said:
A retreating unit should first move to friendly units near if there are any, else random location away from the attacker.

Ah, excellent point... the presence of a friendly unit should override the form I presented above, or a friendly city... in the absence of a friendly unit or a friendly city, it will follow the previously-mentioned plan.

But I dunno if I would pick a random tile... maybe it should be based on unit stats. So if it gets a defense bonus on hills and there's a hill one square away, put it on the hill.
 
That sounds even better, but maybe its better to retreat to a road so you can move futher next turn?
 
I thought I'd present a little more on some of the attributes I am implementing.

Unit Stack Modifier

There will be two tags in the XML for this:
Code:
<UnitStackModifier>
   <iUnitStackModifier>-10</iUnitStackModifier>
   <iUnitThreshold>1</iUnitThreshold>
</UnitStackModifier>

A positive value in iUnitStackModifier will increase the maximum strength of a unit when it's on a tile with more units. A negative value will decrease the maximum strength of a unit when it's on a tile with more units.

If the value is positive, the computer simply takes the number of units on the plot and multiplies it by the modifier value. So if you have 12 units (including the one with this promotion) and the iUnitStackModifier value is 10%, then the unit gets +110% Strength.

If, on the other hand, the value is a negative, the computer uses a different formula which reduces the penalty for each additional unit on the tile.

So, for example, at -10% with 12 units total on the plot, the unit would get a strength penalty of -68.62%. At 5%, you get a strength penalty of -43.12%. So I recommend a value between 5 and 10%. I myself am going to use 6%.

The iUnitThreshold tag determines how many units must be on the tile for there to be any effect. The default value is 1. So if the unit is on a tile by itself, there is no change. A value of 0 in iUnitThreshold would cause the effect to start even when the unit is by itself on a tile... so it's recommended not to go any lower than 1.

If we set iUnitThreshold at 5, for example, then that penalty from using 10% with 12 units in total on the plot would be reduced to -52.17% and with 5% reduced to -30.17%.

To put that into practical terms... a Swordsman with 6 Strength would be reduced to 2.87 Strength with -10% and 4.19 Strength with 5% if there are 11 other units with it on the same plot.

Note: This does not count in city tiles. There is no penalty or bonus on city tiles at this time.


Foreign Plot Modifier

The Foreign Plot Modifier isn't up on the first post because I added just yesterday... but what the Foreign Plot Modifier does is very straight forward. It gives a bonus or a penalty to units based on whether they are on an enemy plot. In this first version, there will be nothing regarding neutral or friendly plots.

For that reason, there is no multiplying factor here. Whatever value you put in is the amount it will reduce the unit's strength by. For my purposes, I'm probably using -10% because I want to make it a bit tougher for the civilizations with this trait promotion, but I don't want to cripple their opportunity for offensive war.


Foreign City Defense Modifier

The Foreign City Defense Modifier is in the first version of these promotion improvements relatively simple.

If the city the unit is in has less than 50% of its own culture in it, it has an effect. It can be a bonus or a penalty depending on what you want to do with it. I'm using it as a penalty personally.

The maximum value the game will accept is -10% if it's a negative value. Why -10%? Because the modifier is multiplied by every 10% of non-player culture there is in the city. Therefore, a city that is 0% of a player's culture will result in the unit having a strength of 0. Anything higher than that would give it a negative value and that's no good. So even if you put in -20%, the computer will just cap it at -10%.

So I recommend a value of -1% or -2% to give a penalty between 10 and 20% with a newly-conquered city.

There is currently no "culture threshold". In other words, you can't set it so that there has to be less than 75% of your culture or 25% of your culture at this point. I do plan to change this later however... probably in the very next version of this modcomp.


Status Report

I'm currently putting the finishing touches here and there and will begin testing within the next couple of days.

That's all for now! :)
 
Realy nice looking project, I'd like to second the unconditional Attack and Defence tags for future versions (their realy simple to implent too).

Also I've always though their should be some modifiers on the Entrenchment abilities of units, their could be modifiers for the maximum amount of entrenchment (currently 25%) and the per turn rate of entrenchment (currently 5%). Imagine having a unit that entrenched at 10% at turn up to a maximum of 50%, it would be an excelent defender but quite vulnorable when moved. Promotions along this line could create some interesting strategic choices.

I'm eagerly awaiting your mod and would ofcorse like to get the source for the CCCP as I expect Ket will want all these new features in the XL Mod (I know I do) If your in need of any assistence PM me and I'll see what I can do.
 
Impaler[WrG] said:
Realy nice looking project, I'd like to second the unconditional Attack and Defence tags for future versions (their realy simple to implent too).

Noted.

Also I've always though their should be some modifiers on the Entrenchment abilities of units, their could be modifiers for the maximum amount of entrenchment (currently 25%) and the per turn rate of entrenchment (currently 5%). Imagine having a unit that entrenched at 10% at turn up to a maximum of 50%, it would be an excelent defender but quite vulnorable when moved. Promotions along this line could create some interesting strategic choices.

Yes, I've been considering exactly this sort of thing. Machinegunners would be good candidates for fortification bonuses.

I'm eagerly awaiting your mod and would ofcorse like to get the source for the CCCP as I expect Ket will want all these new features in the XL Mod (I know I do) If your in need of any assistence PM me and I'll see what I can do.

Thanks for the offer of help (I might need it ;) ), and of course, I'll make the source code available.
 
This looks like a HUGE mod, Dom Pedro. Just a thought re:attrition though. I was thinking of implementing something similar, and came to a conclusion that it should berelatively simple to implement.

In pseudo-code terms, you would need to define 'is OwnedPlot' (not sure how to include allied plots in thise definition), then have a pathfinding routine detect a units distance from a plot which fits this definition. If it is over a certain distance, then said unit gets an 'out of supply' promotion-which grants it a -X% strength penalty.

Anyway, just a thought.

Aussie_Lurker.
 
Aussie_Lurker said:
This looks like a HUGE mod, Dom Pedro.

Well, the mod itself is not what I'm working on right now. I'm just working on the functionality for the mod. So stuff mentioned in the first post is all I'm adding right now. There's not going to be any attrition or anything in this modcomp. That's all stuff for the future.

Just a thought re:attrition though. I was thinking of implementing something similar, and came to a conclusion that it should be relatively simple to implement.

In pseudo-code terms, you would need to define 'is OwnedPlot' (not sure how to include allied plots in thise definition), then have a pathfinding routine detect a units distance from a plot which fits this definition. If it is over a certain distance, then said unit gets an 'out of supply' promotion-which grants it a -X% strength penalty.

Again, this is outside the scope of this specific modcomp, but I do intend to work on an attrition system in the near future. In fact, it was the component I was trying to tackle first before I realized I had know idea what the hell I was doing :)

So I figured I'd cut my teeth on the promotions first.

Anyway, the unit supply system as I have planned is a direct extension of several other mods made by some awesome mod makers out there that will integrate the supply lines into a larger economic system.

The system works as such: A unit requires yields.. Production, Food, and Fuel. The Fuel I'm building in off of cfe's Magic mod... and the stockpile of food and production I'm taking from Chinese American's More Trade Routes mod.

Every turn, certain amounts of each are parceled out to the units. And different units will require different yields... So a Tank will require Fuel and Production but not Food and an Infantry will require Production and Food but not Fuel.

So each unit has a maximum amount of each that it can carry and each turn it expends some of that stored yield... infantry units will expend food every turn, armored units will expend fuel only when they move for example. If the unit is on a valid plot to be resupplied, the unit's stored yield is refilled. If it isn't, it continues to be depleted without being refilled.

Now, for the food, there's also foraging to be taken into account... basically, if an infantry unit doesn't have a supply line, it'll still be alright if it's on a tile that can support it. In terms of one unit, this isn't really significant... most tiles, except desert, will have enough food yield to provide for a unit. But if you have five infantry units moving across terrain, each of those will require 1 Food per turn... if the terrain only has 2 Food, then two units will be supplied, the others will continue to deplete their reserves until they have none left and then they'll start to take damage for each additional turn they remain out of supply.

Mechanized units requiring Fuel don't take damage from a lack of fuel. They just lose the ability to move. So they can still defend.

Pillaging a tile that's a food-producing improvement will give the total yield of the tile to the units on the stack.. so, for example, if you have two units on a tile and they pillage a Corn Farm on a Flood Plain, it'll give (what is it? five food before biology?) Anyway, it'll give one food for each till it runs out. Anything exceeding the unit's maximum capacity is just wasted. But then, of course, next turn, you're on a plot that can only provide three food and not five.

But this system is good I think because it makes supplies a factor without making them the be all and end all... you can successfully wage war without really taking them into account, but you'll be even more successful if you do.

This system sounds very complicated, but in fact it's only slightly more complicated than the the Civ2 method of supply which removed 1 Shield (or Food depending on the kind of unit) for a unit's support. It's just the matter of determining when a unit is within the legal bounds to be resupplied that's the more complex part. And even then, everything's pretty much automatic.

Of course, it's all academic at this point... it may be a complete disaster when I try to implement it, or it might be the best thing ever. I just won't know until I try it.
 
I also want, at some point, to implement a "Home City" value for units a la Civ2.

There's a lot of different uses I have planned for this...

1) I want to add another promotion attribute later that works like the Unit Stack Modifier except that it limits the effecting units to units that have a different Home City than the unit with the promotion. This will be an attribute of the "Tribal" trait promotion given to Tribal civilizations which will give a strength penalty to multi-city(tribe) armies.

2) It was suggested that for jdog's Revolution mod that he have some of a player's units defect when a revolution occurs... the idea was shot down on the basis that there was no way to determine the city of origin for each unit and so it would be silly to have units from a loyal city defecting... problem and the solution :)

3) I'm considering the possibility that for certain civics such as Feudalism, each city will be responsible for bearing the burden of supplying their units rather than the support being taken from the national pool of resources.

4) Reasons as yet undetermined, but I'm sure there will be more... ;)
 
(As if I haven't given you guys enough to comment on....)

Here's another two promotion attributes that's on my to do list... I dunno what to call the attribute, but the Promotion I'll be using it for in my mod will probably be called Scorched Earth.

What do they do? Well, one has it so that just before the last unit in a city dies (if it has the promotion), the unit burns absolutely everything of value to the enemy before leaving... even Wonders. There's a random factor that determines how much it actually manages to destroy however, but the point is to make sure the enemy doesn't get a hold of anything that might be of value.

The second attribute does the same thing except for defending units on worked plots. The player would also get the pillage value in gold of the improvement being destroyed. Represents whatever isn't nailed down being packed up and shipped to the rear for the continuation of the war effort.
 
Dom Pedro II said:
(As if I haven't given you guys enough to comment on....)

Here's another two promotion attributes that's on my to do list... I dunno what to call the attribute, but the Promotion I'll be using it for in my mod will probably be called Scorched Earth.

What do they do? Well, one has it so that just before the last unit in a city dies (if it has the promotion), the unit burns absolutely everything of value to the enemy before leaving... even Wonders. There's a random factor that determines how much it actually manages to destroy however, but the point is to make sure the enemy doesn't get a hold of anything that might be of value.

The second attribute does the same thing except for defending units on worked plots. The player would also get the pillage value in gold of the improvement being destroyed. Represents whatever isn't nailed down being packed up and shipped to the rear for the continuation of the war effort.

I have already seen pillaging gold modifiers; is there a promotion tag for pillaging as a "free action" (no movement point cost)? If so, this would be another tag to fit under the Scorched Earth idea, since it is an offensive tactic as well.

Another idea, I'm not sure if it already exists somewhere: A Decoy promotion that forces the unit to always defend first. I think I've seen it for unit types before, but I could be wrong.

I'd also like it if, before the discovery of Economics, a unit with a certain tag had a chance of "converting" existing buildings or improvements into fortifications. Say, for instance, an appropriately tagged unit pillages a windmill in enemy territory, there might be a small chance that rather than receiving gold, a fort is constructed on the tile, replacing the windmill. Alternatively, say that one captures a city (destroying the walls in the process) *but* the city happens to have a number of buildings and wonders...if one of these non-wall buildings is also 'destroyed' during the capture it is instead converted into a new set of walls (or, if a wonder/national wonder is destroyed, they could be converted into a castle). This sort of resourceful promotion could be granted automatically to some units (I'm thinking of Crusaders and some UUs) and available for others normally.
 
Dom: I was thinking about the implementation of your mod and realized that the addition of so many variables to the CvUnit class will result in a considerable incresse the the game memory consumption as units are instantiated many many times in the game. It probably wont be enough to cause any realy seriously deteterious effects, I'm thinking of minimizing long term memory bloat. I would recomend that you look into using reduced sizes on many of the variables, short int can be substituted for int in most locations and their are probably some situations when char will be safe to use. Just use the small variables in the object and cast everything within the get/set/change functions to isolate them from the rest of the program. Their are some examples of this in the CvPlot class as Firaxis did do a bit of optimization their (plots being the most numerous objects in the game). Avoid an signed/unsigned convertions as these are known to be unreliable on different processors. I've been thinking of doing a memory usage profile on Civ4 which could be used to track how much our mods are actualy incressing the size of the game memory footprint.
 
Back
Top Bottom