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

[FIXED] Turns to Complete for Production bonus from railroads is not calc'd correctly

Discussion in 'Civ5 - Bug Reports' started by The_J, Sep 26, 2010.

  1. The_J

    The_J Say No 2 Net Validations Retired Moderator Supporter

    Joined:
    Oct 22, 2008
    Messages:
    32,938
    Location:
    DE/NL/FR
    Originally posted here:



    Short translation of the image:
    Watermill will be built in 29 rounds
    Current advance: 23,9/360
    10 hammers basis
    17 hammers total
    Modifikator for railroad bonus: 50%
    Modifikator for buildings: 20%

    You will say now, yes, that's right, 70% more from 10 hammers is 17.
    But: There are 336 hammers needed to finish the watermill.
    336/29 Rounds = 11.58 ~12, which would be if the railroads did not work.

    Can anyone confirm this?
    I'll try to get a savegame from this.

    Edit: Another user is saying that the 29 rounds for finishing the production is shown wrong and that the hammers are applied correctly.
     
  2. ainwood

    ainwood Consultant. Administrator

    Joined:
    Oct 5, 2001
    Messages:
    30,083
    I would have thought that if the turn calculation wasn't working for this, it wouldn't be working at all!
     
  3. SatanasOz

    SatanasOz Chieftain

    Joined:
    Oct 27, 2009
    Messages:
    59
    Location:
    Frankfurt, Germany
    confirmed - but luckily it is just the forecast - the progress seams to be calculated correct ;)

    ah, forgot, the calculation: 1090 hammers left / 54 per turn = 20,1 = 21, not 27.
    The thing that is really calculated is 1090 / 40, witch is exactly the 27 + 50% from buildings but without railroad



    and just for the record: the save to reproduce, but it seams to be a general problem
     

    Attached Files:

  4. ainwood

    ainwood Consultant. Administrator

    Joined:
    Oct 5, 2001
    Messages:
    30,083
  5. Sumendar

    Sumendar Chieftain

    Joined:
    Sep 20, 2010
    Messages:
    26
    Possibly related issue, the production bonus isn't included on "economy overview" screen either.
     
  6. chrin67

    chrin67 Empereur

    Joined:
    Nov 7, 2010
    Messages:
    145
    Location:
    France
    Bonjour,
    I confirm this bug in the french version.
    that's very misleading, in particular at the end of the game!
    the calculation is wrong (or I did not unterstand how it's computed)
    and the display of the production in the overview is wrong, too.

    example (see screenshot joined)

    base production: 42
    bonus (railroad): 50%
    total prod. : **63**

    stealth bomber cost =800
    800/63 = 13 turns, not 18 !

     
  7. player1 fanatic

    player1 fanatic Fanatic

    Joined:
    Mar 19, 2002
    Messages:
    2,639
    Gender:
    Male
    Location:
    Belgrade, Serbia
    It is possible to workaround this bug.

    For example in CityView.lua:
    (from assets\UI\InGame\CityView folder)

    There is line with this:
    local productionTurnsLeft = pCity:GetProductionTurnsLeft();

    How many turns are left is then pulled from GetProductionTurnsLeft() and used to display that value in the UI. But since GetProductionTurnsLeft() is bugged it will not take into account bonus from railroads.

    So, let's use workaround instead.

    If you put beneath that line this:
    productionTurnsLeft = math.ceil((iProductionNeeded - iStoredProduction) / iProductionPerTurn)

    It will manually recalculate remaining turns and get correct value, without using buggy function. Of course, this would fix remaining turns only for that single screen (city view) and not for others (city build screen, F2 screen, turns remaining on the map, etc...).
     
  8. player1 fanatic

    player1 fanatic Fanatic

    Joined:
    Mar 19, 2002
    Messages:
    2,639
    Gender:
    Male
    Location:
    Belgrade, Serbia
    Proper version of workaround. Previous one was not taking into account production overflow.

    Code:
    local iProductionNextTurn = pCity:GetCurrentProductionDifferenceTimes100(false, true) / 100;
    if ((iStoredProduction + iProductionNextTurn) >= iProductionNeeded) then
    	productionTurnsLeft = 1;
    else
    	productionTurnsLeft = 1 + math.ceil((iProductionNeeded - iStoredProduction - iProductionNextTurn) / iProductionPerTurn);
    end
     
  9. player1 fanatic

    player1 fanatic Fanatic

    Joined:
    Mar 19, 2002
    Messages:
    2,639
    Gender:
    Male
    Location:
    Belgrade, Serbia
    This is still bugged in 1.0.1.217.
     
  10. player1 fanatic

    player1 fanatic Fanatic

    Joined:
    Mar 19, 2002
    Messages:
    2,639
    Gender:
    Male
    Location:
    Belgrade, Serbia
    Fixed in 1.0.1.275. :goodjob:
     

Share This Page