Making the gold display refresh from dll is as easy as using this one liner "gDLL->getInterfaceIFace()->setDirty(GameData_DIRTY_BIT, true);"About income updating immediately… yes, in vanilla, it does. I also agree that it would be great if C2C did the same. But since updating other things mid turn that affect game play (build queue options like national units) is both difficult and low priority, I assumed that updates only affecting displayed values but not impacting gameplay would still be difficult and even lower priority. I have no problem with accurate information being displayed to the player, and encourage anyone that wants to tackle more frequent updates that don’t impact the application’s speed/memory/responsiveness to please go forward with that. But, I will reiterate that, when it comes to unit upkeep costs not changing, it is just a display problem. I tested this months ago, that losing a unit (to mission/battle/delete) does not impact the displayed gold per turn in the upper left of the main screen, but the actual gold per turn lost or gained between turns does accurately reflect the unit changes.
It's used a lot, and only makes a small portion of the main interface refresh, so it wouldn't hurt performance to use it whenever unit upkeep changes, which happens relatively rarely, like the refresh per second would be much less than 1 per sec on average from this.
That's cool, your wall of text radiate enthusiasm, I welcome people to get invested in C2C.My goal here is to help, and I think I have information, background, skill, and experience that allows me to try.
Yes, in C2C we want a unit to have much higher upkeep than what vanilla was set up for, and therefore we need information transparency for the player, the player must be able to mouse over one of his/her units and see exactly how much gold that one unit cost in upkeep in the tooltip, e.g. Unit Upkeep: 2403.48To back up a little, the current state of the function doesn’t really matter, except in relation to how difficult it has to be to address our needs. Let’s examine the problems that need to be fixed, or at least the ways in which unit upkeep needs to be handled differently than vanilla civ4. Thus far, I see three separate ones mentioned in this conversation. They are subdued animals, promotions, and unit group size (when the Size Matters game option is activated). Are there any other ways that C2C needs to handle unit upkeep differently than BtS?

List of things we want:
• Information transparency mentioned above.
• Easy to setup units to have 0 in upkeep cost in the unit xml file.
• Easy to setup units to have any kind of base upkeep cost for that matter.
• Ways for promotions and unitcombats to modify the base upkeep.
• A final modifier specifically for SM so that merging three units always cost 1.5 more in upkeep than each individual did before.
I could hardcode this, but I prefer having an xml tag in case we want a different multiplier than 1.5 at some point. (1.5 is the multiplier used for most stuff in SM merge)
Currently, this cost modifier is just added to the same modifier value as other promotions/unitcombats contribute to, when it should multiply with it.
• Easy to understand coding, more straight forward than what we currently got.Currently, this cost modifier is just added to the same modifier value as other promotions/unitcombats contribute to, when it should multiply with it.
e.g. Three divine quality units merged into one let's say they cost 100 gold each, will cost 105 gold after merging when it should cost 150
And three incapable units (same unit type as above) may cost 10 gold each and will cost 15 gold after merging.
These numbers are arbitrary, but they illustrate how the current modifiers typically work at this time, which leaves something to be desired.I see two good options.I already offered one way that subdued animals could be handled. Another option would be to subtract them from the total amount of units before any math is done, so they aren’t even displayed as “free” units, let alone taken into account in the equation. A third would be something similar to what we have now, adding them to the number of free units after the free unit calculations have been done but before handicap costs are tallied. And so forth. (Another, possibly easier and more accurate method becomes obvious further down in the post.) Whatever we choose, it will have an impact on how supply for the subdued animals will need to be handled. Either way, I think there are a lot of options here, and I don’t see any that are invasive to a final overall solution.
1. We switch from "free units" to "free unit upkeep gold", that way units with zero upkeep won't interfere in how free unit upkeep is handled.
2. We keep a count in the player object of how many units have upkeep greater than zero so that we can easily get the average gold cost of units without free units affecting the average value.
upkeep = totalUpkeep minus "free units" multiplied with totalUpkeep divided by iNumUnitWithUpkeep
if (upkeep < 0) upkeep = 0
if (upkeep < 0) upkeep = 0
I like approach number one, because it won't favour players with an army with high average unit upkeep like approach 2 does.
Approach two can be described as: The more expensive your units, the more free the army becomes. This description also fits the current system in use for free units.
The only way to balance unit upkeep is imo with the SM option off. SM is per definition a shift in unit balance so it doesn't matter if upkeep feel different under it. It may have some unit that cost less and some units that cost more than without the option, in the same way it has units that have less or more strength than they do without the option. SM will be designed so that unit cost is scaled by unit strength in an indirect way, so it is self balancing if its modifiers are set to reasonable values. Most C2C balance work should in general always happen with as few options enabled as possible, the options should be tweaked to work inside a balanced C2C, any shifts in balance if not tweak-able through option specific content should be accepted as part of what the option is designed to do.There are multiple creative ways I can think of for tallying those costs, but I think there is an important restriction in any efforts. Namely, that SM is still an option, not an integral and necessary part of C2C If that is the case, any final solution must be able to handle the option being both on and off.
I like the suggestion, haven't though too hard on what promotions should utilizxe this yet, but might seems like a perfect candidate. Other possibilities would be equipment promotions that in nature are more expensive to maintain than the default unit equipment is. Fanatic promotion may make the unit cheaper by a percentage, they don't fight for gold but through belief/loyalty. Etc.Let me give a few examples of one way promotions might work in this paradigm. Say we want to balance the Might promotions (not saying we need to, just an example). Each level of Might could multiply the modified ‘unit upkeep number’ by +25%.
Feel free to chat about the topic on discord, I can keep you in the loop of the development process there if you'd like that.Anyway, this makes sense to me. In code, as a player, and in context of the future conversations I have been hearing about. I know I have only been lurking and listening for less than a year, and I hope that me having an opinion on the direction of a part of the mod isn’t offensive, but this seems to meet the goals of transparency, ability to be built upon, and easier to understand and maintain by multiple coders.