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

Multiple Production Mod

Discussion in 'Civ4 - Mod Components' started by denev, Jul 3, 2009.

  1. denev

    denev Chieftain

    Joined:
    Jul 5, 2008
    Messages:
    208
    Location:
    Japan
    For BtS 3.19

    This mod changes game rule about city production.
    When a city production is enough to finish next queue item, more than one item is finished in the same turn. (If next item doesn't exist, it will go in the same way as original rule.)
    When production overflow floods from overflow capacity, it is used to next queue item immediately, not to be converted into gold.

    for example,
    • If you order missiles (small cost) indefinitely in mega production city, multiple missiles are finished in the same turn.
    • In mega production city with limit overflow, if you order a Theatre (small cost) first and a Recycle Center (big cost) second as a next queue item, all production which is to be converted into gold is used to Recycle center immediately. (And limit overflow is carried over.)
    about details:
    • To eliminate pre build-exploit, this changed rule is not applied to all wonders and all projects.
      To eliminate building food-produced units (Settlers and Workers) without blocking city growth, the rule is not applied to food-produced units too.
      But exceptionally when first item is food-produced unit, following food-produced items are available in this rule.
    • In 3.19, there is the issues with converting calculation about production overflow to gold.
      This mod use calculation method with 3.17 unofficial patch (Thanks to unofficial patch developers!).
    • When converting production to gold occurs, it shows a message. (But I'm not a native speaker, it may include wrong text.)

    Change Log:
    ver 0.03
    1. Fixed stating mega converting issue with multiple production disabled.
    ver 0.02
    1. Made the game option conditions.
    2. When first item is food-produced unit, following food-produced items are available in multiple production rule during the turn.
     

    Attached Files:

  2. xienwolf

    xienwolf Chieftain

    Joined:
    Oct 4, 2007
    Messages:
    10,589
    Location:
    Location! Location!
    Coolness :) I had thought of doing something along these lines myself once, but I was just going to have it work for units and make duplicates of what you just created if you had enough overflow to make a second one immediately. This approach is a bit better I would imagine, and easier to code as well.

    :thumbsup:
     
  3. The_J

    The_J Say No 2 Net Validations Retired Moderator Supporter

    Joined:
    Oct 22, 2008
    Messages:
    31,018
    Location:
    Germany / Netherlands
    Great idea.

    This is sure a component, which many people wanted to have.
     
  4. denev

    denev Chieftain

    Joined:
    Jul 5, 2008
    Messages:
    208
    Location:
    Japan
    Thanks xienwolf and The_J.
    I hope that this mod is useful for many modders.
     
  5. GeoModder

    GeoModder Chieftain

    Joined:
    Nov 29, 2005
    Messages:
    7,512
    That's sure something for avoiding micro-producing in cities.
    Is it SDK based, or purely XML/python based?
     
  6. denev

    denev Chieftain

    Joined:
    Jul 5, 2008
    Messages:
    208
    Location:
    Japan
    Almost all is based SDK.
    Nothing is python.
    Only text message is XML.
     
  7. Arian

    Arian No more ghostbusting!!

    Joined:
    May 10, 2008
    Messages:
    2,088
    Location:
    The Netherlands
    Can AI-players also take advantage of multiple productions per turn? That would be cool and probably something to add to BetterBTS_AI!
     
  8. Cybah

    Cybah Chieftain

    Joined:
    Jun 22, 2007
    Messages:
    1,480
    why not? by the way: this feature as a game option would be perfect.
     
  9. P&nny

    P&nny Chieftain

    Joined:
    Sep 1, 2007
    Messages:
    80
    Being an admin of the multiplayer Civ4league, I'm really interested in the feature, I think it could be super interesting in terms of gameplay.
    Especially for game starts in later era (which are common for us) those will reward productive cities that actually produce +1 unit a turn. I can see a lot of new micromanagement being possible.

    That said, I wonder why you didn't allow the multiple production for food-produced units, what exploit did you had in mind.
    I can see it being super useful getting 3-4 wrokers a turn for the few first turns of a Future or Renaissance event !

    I agree !
    Ideally, you could choose between 3 option : Normal / Multiple Production / Multiple (& Food) production !



    Thx for this in any case !
     
  10. xienwolf

    xienwolf Chieftain

    Joined:
    Oct 4, 2007
    Messages:
    10,589
    Location:
    Location! Location!
    He set it up to apply the overflow to the next item on the list, not to another copy of the exact same item. So if you carefully select your tiles to barely miss popping out a worker this turn, then swap back to all your lush Super-Food tiles for the next turn and have a wonder lined up to follow the worker, you just applied a ton of food to your wonder.

    It MIGHT be possible to re-write it to allow the overflow on food produced units, but to rebate the overflow as food first, then anything beyond what food you would be capable of producing normally overflows as hammers.
     
  11. Cybah

    Cybah Chieftain

    Joined:
    Jun 22, 2007
    Messages:
    1,480
    Anyone able to make the game option conditions?
     
  12. denev

    denev Chieftain

    Joined:
    Jul 5, 2008
    Messages:
    208
    Location:
    Japan
    for everyone:

    Thanks for each interesting ideas.
    I'm working on next version.


    for P&nny:
    Because I'm afraid that you can produce food-produced units without blocking city population growth.
    When the city has enough production to build both of Warrior (non food-produced unit) and Worker (food-produced unit), if you order a Warrior as first item, and order a Worker as next item, then it is possible.

    But it certainly isn't smart way to restrict multiple workers production.
    Now I'm reviewing the following idea:

    In principle, multiple production rule isn't applied to food-produced unit.
    Exceptionally, when first queue item is food-produced unit, the rule is applied to following food-produced items.
     
  13. xienwolf

    xienwolf Chieftain

    Joined:
    Oct 4, 2007
    Messages:
    10,589
    Location:
    Location! Location!
    Oh I see. I had thought that it wasn't applied when the Current unit was Food produced, not when the NEXT unit was.

    I would say if you are pumping out enough production that you can build a worker AND a warrior in a single turn, you are probably not worried about gaining population in that city. So it should be fine to allow the overflow in all cases. Completely IMO though.
     
  14. P&nny

    P&nny Chieftain

    Joined:
    Sep 1, 2007
    Messages:
    80
    Awesome Denev !
     
  15. PieceOfMind

    PieceOfMind Drill IV Defender Retired Moderator

    Joined:
    Jan 15, 2006
    Messages:
    9,312
    Location:
    Australia
    Looks excellent, denev! :goodjob:

    I'm gonna keep a close eye on this one.

    Especially for MP games where Quick speed is the norm, it would be nice to not have to worry about hitting the "roof" on production in cities like a HE+IronWorks.

    I'm just wondering how rush-buy will work, and to a lesser extent, the whip.
     
  16. denev

    denev Chieftain

    Joined:
    Jul 5, 2008
    Messages:
    208
    Location:
    Japan
    I have reflected what to do about this point.
    This problem is so petty for practical games, but I believe it is good to keep original rules as far as possible.
    I understand it is not smart way to add exceptional rules, but this problem is so difficult for me.
     
  17. Xenomorph

    Xenomorph Chieftain

    Joined:
    Oct 7, 2007
    Messages:
    972
    I'm still running the 3.17 patch, and I get game crashes whenever I try to combine this mod into the original source code. I'm only copying over the lines of code that are marked as "//Multiple Production" but I'm guessing you are referencing stuff that was changed in the 3.19 mod, even though I don't get any errors while compiling. What would need to be changed to make it compatible with 3.17?
     
  18. denev

    denev Chieftain

    Joined:
    Jul 5, 2008
    Messages:
    208
    Location:
    Japan
    for Xenomorph:

    Please reference following file.:)
     

    Attached Files:

  19. Xenomorph

    Xenomorph Chieftain

    Joined:
    Oct 7, 2007
    Messages:
    972
  20. BobTheBull

    BobTheBull Chieftain

    Joined:
    Dec 29, 2007
    Messages:
    189
    Location:
    New Orleans
    denev, could you post the SDK for this?
     

Share This Page