1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

Hammer decay bug

Discussion in 'Civ4 - Bug Reports' started by jesusin, Apr 27, 2010.

  1. jesusin

    jesusin Ant GOTM Staff

    Joined:
    Aug 26, 2005
    Messages:
    4,112
    Location:
    Madrid
    Hi, I think I have found a bug, but I don't know it is from the game or from BUFFY.


    BTS version 3.19, BUFFY mod 3.19.003.

    Please open the save and look into city "05".

    There is a WB on the queue with some hammers on it that will start losing hammers soon if it is not the first thing in the queue. Now, there is a second WB on the queue with 0 hammers on it which is threatening to lose hammers soon too.

    If I start losing hammers on the first WB and then complete it and then put some hammers on the second WB and then put something else on the top of the queue, then the second WB starts losing hammers immediately, instead of starting losing hammers after a period of time (10 turns in normal speed) as it should.


    EDIT: I haven't attached the save here since it belongs to a competition that is not over yet, I will attach it on the 16th. In the meanwhile, I can send the save by email to any admin that is not playing that competition.
     
  2. jesusin

    jesusin Ant GOTM Staff

    Joined:
    Aug 26, 2005
    Messages:
    4,112
    Location:
    Madrid
    Save attached, sorry for the delay.


    05 city is on the E tip of the continent. Open the save and just try putting a new WB into the production queue.

    Thanks for your interest.
     

    Attached Files:

  3. PieceOfMind

    PieceOfMind Drill IV Defender Retired Moderator

    Joined:
    Jan 15, 2006
    Messages:
    9,319
    Location:
    Australia
    That's quite a specific bug and very believable. It would be pretty rare to end up in that situation.

    I think you should mention this in the Unofficial Patch thread, if you haven't already. I'd imagine the fix is not too difficult.

    http://forums.civfanatics.com/showthread.php?t=324024
     
  4. EmperorFool

    EmperorFool Deity

    Joined:
    Mar 2, 2007
    Messages:
    9,633
    Location:
    Mountain View, California
    Every turn that a type of item is in the queue, has at least 1:hammers: accumulated toward it, and isn't in the first position of the queue, it's decay timer is incremented by one. Each type of item has a single counter. If you have five Workboats in the queue there is still only one counter for them all, and it is incremented according to the above rules. When a type of item is completed, its counter is set to zero.

    Similarly you only accumulate :hammers: toward types of items. If you swap two Workboats around in the queue you are not moving :hammers:. You can even remove all the Workboats from the queue; the single pool of :hammers: accumulated toward Workboats will remain in the city and be subject to decay when the counter reaches the max based on game speed.

    These rules are simple yet complicated because the counters and :hammers: are attached to item types rather than the items themselves which is totally counter-intuitive to the real world. If you have more than one Workboat in the queue, the counter will not be incremented as long as the first item in the queue is a Workboat. Adding a second or third or any number of Workboats to the queue does change how the counter behaves, neither does removing all Workboats from the queue.

    Having said that, the feature in BUG and BULL that shows hammer decay is also aware only of item types. If you hover over an item in the queue, BUG looks up the counter for the item's type. If you hover over the second Workboat in the queue, it shows you the turns until Workboats in general decay.

    Now, if you are saying that the counter is not being reset to zero when you build an item, that is indeed a bug that needs to be fixed. Can you test your save and verify that this is happening. If it is I'll gladly take a look.
     
  5. EmperorFool

    EmperorFool Deity

    Joined:
    Mar 2, 2007
    Messages:
    9,633
    Location:
    Mountain View, California
    I recant my post. After reading the code itself I believe you are correct. I've posted the fix in the UP thread.
     
  6. jesusin

    jesusin Ant GOTM Staff

    Joined:
    Aug 26, 2005
    Messages:
    4,112
    Location:
    Madrid
    As you say it's not only a hovering-info problem, but also a real game-mechanics problem.
     

Share This Page