View Full Version : Hammer-decay, how does it work?
fjordan Apr 20, 2009, 06:03 AM When you switch to another build, after a certain time the hammers you invested will start to decay. I have not determined the exact mechanism, maybe it is very simple. I believe it starts after 15 turns on epic, so I guess 10 at normal speed. My quetsions are:
- If I restart the previous build, will the decay-timer be reset to 0 or continue when I switch again? So is it usefull to spent 1 turn once in a while to prevent decay?
- If it resets, does it matter if the decay already started?
- Is there a diffence in the building type, like units, buildings, wonders?
- What is the rate of decay, is it a fixed number or a percentage and will it accelarate?
Anyone seen a guide on this or knows it from experience?
nbcman Apr 20, 2009, 12:19 PM There is a discussion of hammer decay in this thread (http://forums.civfanatics.com/showthread.php?p=8005158). Hammers invested in buildings dont decay for 50 turns regardless of game speed. After 50 turns the rate of decay is 1%. Hammers invested in wonders do not decay. I am not sure of the rate of decay for units, but you could try searching on hammer decay for more info.
PieceOfMind Apr 20, 2009, 01:08 PM Decay rate for units is 2% of invested hammers per turn (rounded up) for units, 1% for buildings. eg. if you have 20:hammers: invested in a unit and it's about to decay, you will lose 1:hammers: per turn. If you have 51:hammers: invested, .02 of 51 is a bit over 1 so you will lose 2:hammers: to get to 49:hammers: and from then on you will lose 1:hammers: per turn.
Counter does not reset. So switching periodically to the unit does not help. Every turn you spend not building the thing is counted.
Also, as far as I know, it is 10 turns before decay for units, on all speeds. 50 turns for buildings.
Bleys Apr 20, 2009, 02:34 PM We seem to have conflicting reports for the rate of Wonder hammers to decay. Do they start at 50 turns like other buildings or not? Sounds like we need to check the code, or do some experiments.
PieceOfMind Apr 20, 2009, 03:28 PM GlobalDefines.XML
<Define>
<DefineName>BUILDING_PRODUCTION_DECAY_TIME</DefineName>
<iDefineIntVal>50</iDefineIntVal>
</Define>
<Define>
<DefineName>BUILDING_PRODUCTION_DECAY_PERCENT</DefineName>
<iDefineIntVal>99</iDefineIntVal>
</Define>
<Define>
<DefineName>UNIT_PRODUCTION_DECAY_TIME</DefineName>
<iDefineIntVal>10</iDefineIntVal>
</Define>
<Define>
<DefineName>UNIT_PRODUCTION_DECAY_PERCENT</DefineName>
<iDefineIntVal>98</iDefineIntVal>
</Define>
I did some tests a while ago about how the decay works. I can't remember how it worked for wonders though because that's not what I was trying to find out. I just assumed they were like any other building. I remember finding some unusual stuff - it seemed for units decay started after about 12 or 13 turns rather than 10. But I didn't look into it much more than that.
Crusher1 Apr 20, 2009, 03:55 PM I don't believe there is any decay for World Wonders - and I'm unsure about National Wonders but I would guess they don't either?
DanF5771 Apr 21, 2009, 02:35 AM PoM is right, World Wonders and National Wonders are buildings by definition so the hammers invested in them DO decay. See also this thread (http://forums.civfanatics.com/showthread.php?t=292996&page=1#4) and an example here (http://forums.civfanatics.com/showthread.php?t=280372&page=1#18).
btw, the AI does not suffer from hammer decay! :mad: :gripe: ;)
Roland Johansen Apr 21, 2009, 04:07 AM PoM is right, World Wonders and National Wonders are buildings by definition so the hammers invested in them DO decay. See also this thread (http://forums.civfanatics.com/showthread.php?t=292996&page=1#4) and an example here (http://forums.civfanatics.com/showthread.php?t=280372&page=1#18).
btw, the AI does not suffer from hammer decay! :mad: :gripe: ;)
;)
Does the AI even switch between building options? (Switching between building options and the possible exploits related to that are of course purely a human player issue.)
DanF5771 Apr 21, 2009, 04:50 AM Yup, the AI does switch from civil stuff to units when war breaks out (can be witnessed in debug mode or with enough :espionage:).
PieceOfMind Apr 21, 2009, 04:56 AM Ah, a minor point:
I think turns of anarchy probably do not increase the counter. That may explain why I observed 12 or 13 turns in the tests.
DanF5771 Apr 21, 2009, 05:31 AM No, anarchy doesn't keep the counter from incrementing.
But doProduction() precedes doDecay() in the processing of CvCity::doTurn(). This entails that if another item finishes production and the decaying item moves up to the top of the building queue no further decay will happen during that turn.
For example you have a Settler with 50:hammers: invested and decay has already started. If you repeatedly put Warriors in front of the Settler (Ctrl+click) and the city has enough hammers to complete the Warriors in just a single turn each, the Settler won't lose any hammers. Maybe something like that happened during your tests. :dunno:
PieceOfMind Apr 21, 2009, 06:21 AM No, anarchy doesn't keep the counter from incrementing.
But doProduction() precedes doDecay() in the processing of CvCity::doTurn(). This entails that if another item finishes production and the decaying item moves up to the top of the building queue no further decay will happen during that turn.
For example you have a Settler with 50:hammers: invested and decay has already started. If you repeatedly put Warriors in front of the Settler (Ctrl+click) and the city has enough hammers to complete the Warriors in just a single turn each, the Settler won't lose any hammers. Maybe something like that happened during your tests. :dunno:
Yes that is probably precisely what happened. I was most likely spamming warriors. I would never have guessed the logic was such that finishing another unit would keep the counter from incrementing!
Thanks for the info - I'll do my best to remember that now, as I think it's all solved.
One thing though... It sounds like there's micromanagement creeping in here. If the counter doesn't tick over only when it's at the top of the build queue, then keeping the thing closest to decaying at the 2nd position in the queue is best.
fjordan Apr 21, 2009, 06:35 AM Thanks all for the answers. I didn't know the difference between buildings and units was that big. I always thought that my cycling through the cities when building a resource-enhanced wonder in multiple cities prevented the decay, but that is clearly not the case. Saves me some MM in the future.
EmperorFool Apr 21, 2009, 06:46 AM Looks like everything was covered. I spent some time in the (admittedly simple) doDecay() code today adding a new BUG feature (http://forums.civfanatics.com/showpost.php?p=8008968&postcount=100), so I'll chime in with one clarification.
You get 10/50 turns of not producing an item for free. Each turn not producing the item experiences decay (barring the 2nd-place-in-queue trick DanF pointed out). This means that a unit will decay on the 11th turn of non-production.
Also, whenever the :hammers: invested in an item reaches zero, the counter is reset. This is what happens either when you complete an item or it decays down to 0:hammers:.
obsolete Apr 21, 2009, 02:51 PM btw, the AI does not suffer from hammer decay!
I'm used to them building everything in a single turn, so it really makes no difference... :P
MosheLevi Apr 21, 2009, 05:05 PM I have been playing Civ 4: BtS for 6 months almost every day and this is the first time I hear about the “Hammer Decay”, lol.
It seems that I learn new things every day.
Can someone please explain me this “feature”?
EmperorFool Apr 21, 2009, 05:39 PM When building a unit or building, you put :hammers: into the item each turn until you reach or exceed its full cost. This is what you're used to.
You can move items around in the build queue to interrupt one build for another. For example, say you are building a Market when Monty attacks you with six Horse Archers. You quickly build a Spearman to defend your city, putting the Market on hold. The :hammers: you invested in the Market will still be there once the Spearman completes. However, he has six Horse Archers, so you build five more Spearman. Let's say that each one takes exactly 10 turns to build.
Here's where decay comes in. Each turn that an item is in the build queue with at least 1 :hammer: in it, if you don't put :hammers: into it that turn (it's not 1st in the queue), its decay timer is incremented by one. Once the timer exceeds the limit (10 for units, 50 for buildings), its :hammers: decay to 98% for units, 99% for buildings if you don't put :hammers: into it that turn.
In other words, units/buildings can be neglected in the queue for 10/50 turns without losing any :hammers:. After that, they lose 2%/1% each turn they sit idle on the queue.
I'm sure I didn't explain very clearly, but this thread should have the answers to all the questions this post has raised. :)
MosheLevi Apr 21, 2009, 06:30 PM Thank you Emperor for the explanation. :)
I was never aware of this, and your explanation by the way was very clear.
EmperorFool Apr 21, 2009, 06:39 PM I think the key takeaway for me is that the decay is typically going to he 1-2:hammers:/turn. This really isn't much to stress over as long as you're delaying the build for a good reason.
Also, projects do not decay, but I found nothing in the code that treated wonders of any type differently from buildings. In other words, wonders decay after 50 turns.
Bleys Apr 21, 2009, 07:19 PM Its actually important to those who like to micromanage their civic swaps to coincide with a mass of unit production. You want to queue up as many 1-turn Unit builds in a row that you can, so you build, say, an Axe to within a turn, stick a Sword in front, build it to within a turn, then a Spear, then you switch to Theocracy and Vassalage and you get 3 units in a row with some nice starting XP. I have seen SGs where guys have 5 units piled up in 10 cities, do a 5 turn civic swap and have 50 highly promoted units in a flash.
I do it in a smaller way when I am SPI, but its a LOT of work to pull off right.
PieceOfMind Apr 21, 2009, 10:54 PM Its actually important to those who like to micromanage their civic swaps to coincide with a mass of unit production. You want to queue up as many 1-turn Unit builds in a row that you can, so you build, say, an Axe to within a turn, stick a Sword in front, build it to within a turn, then a Spear, then you switch to Theocracy and Vassalage and you get 3 units in a row with some nice starting XP. I have seen SGs where guys have 5 units piled up in 10 cities, do a 5 turn civic swap and have 50 highly promoted units in a flash.
I do it in a smaller way when I am SPI, but its a LOT of work to pull off right.
And with the BUG dll on the way this will be much less painful. :)
CLST Apr 21, 2009, 11:20 PM I typically throw up the following civic cycles during the midgame `have access to most of the civics' stage. Starting from my base build (where I queue up my first good unit at low production [food/specialists and cottages worked over production])
Representation
Bureaucracy (if few cities, or Free Speech if many cities, maybe Vassalage)
Caste System
Mercantilism/FM
Pacifism/OR/FR
queue up a unit, switch to high production for 5-8 turns queue up more units
Police State (if available, otherwise stay at Representation)
Bureaucracy
Caste System
State Property
Pacifism/OR/FR/whichever is best suited
and then switch to unit getting phase for 5 turns
Police State (Or US if you are gold rich)
Vassalage
Slavery
State Property
Theocracy
Then pop back to the base civics.
I find this to be the superior. You don't have to pull a full 5 units. But you can usually queue up 2 or 3 units, and then whip/buy another 1 or 2 (as long as they have hammers so you don't suffer insta-whip/buy penalty) if you want. So 3 is usually doable in most of the cities.
It works well, and is why Spiritual is the best warmonger trait IMO
|
|