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

[BTS][MODCOMP]Construction Mod

Discussion in 'Civ4 - Mod Components' started by Fanatic Demon, Sep 30, 2007.

  1. Fanatic Demon

    Fanatic Demon Student in Wizardry

    Joined:
    Aug 6, 2004
    Messages:
    403
    Location:
    The Netherlands
    The Goal of this Mod is to allow modders to balance construction with quantative bonus resources.

    Main Features:
    - 3 Quantative resources: Stone, Iron and Oil which will each generate there own stockpiles
    - XML tags for initial resource/gold/food or culture cost for Units and Buildings
    - 4 XML tags for each resource that control production bonus, maximum resource bonus cost, maximum source limit and maximum stocpile limit
    - 2 XML tags for controlling stockpile production and stockpile Ceiling for Bonus resources

    the resource stockpiles are visible next to the gold reserve in top of mainscreen:



    current production bonus is visible in city bars and popup:



    the Current version 0.5 (made for bts 3.13) can be downloaded from: http://forums.civfanatics.com/uploads/49944/Construction_Mod_0.5.rar

    Change Log:
    Spoiler :

    0.5
    - Converted to 3.13
    - Added City Bar support
    - fixed rounding error
    0.4
    - Added Culture investment cost
    - added maximum source limit usage
    - added maximum stockpile limit usage
    - added default values
    - fixes rounding bug
    0.3
    - added production bonus for all resource, gold and food
    - added maximum resource bonus cost for all resource, gold and food


    Technical details:
    Spoiler :
    This mod will add the following optianly XML tags for CIV4UnitInfo.xml and CIV4BuildingsInfo.xml

    iGoldCost - Gold investment cost
    iGoldBonusMod - Gold production bonus modification
    iGoldBonusMax - Gold production bonus requirement
    iGoldBonusSourceLimit - Gold production source %limit default 50
    iGoldBonusBufferLimit - Gold production stockpile % limit default 0
    iCultureCost - Culture investment cost
    iFoodCost - start Food cost
    iFoodBonusMod - Food production bonus modification
    iFoodBonusMax - Food production bonus modification
    iFoodBonusSourceLimit - Food production city source % limit default 50
    iFoodBonusBufferLimit - Food production city stockpile % limit default 0
    iStoneCost - Stone investment cost
    iStoneBonusMod - Stone production bonus modification
    iStoneBonusMax - Stone production bonus modification
    iStoneBonusSourceLimit - Stone production source % limit default 100
    iStoneBonusBufferLimit - Stone production stockpile % limit default 100
    iIronCost - Iron investment cost
    iIronBonusMod - Iron production bonus modification
    iIronBonusMax - Iron production bonus modification
    iIronBonusSourceLimit - Iron production source % limit default 100
    iIronBonusBufferLimit - Iron production stockpile % limit default 100
    iOilCost - Oil investment cost
    iOilBonusMod - Oil production bonus modification
    iOilBonusMax - Oil production bonus modification
    iOilBonusSourceLimit - Oil production source % limit default 100
    iOilBonusBufferLimit - Oil production stockpile % limit default 100

    Civ4BonusInfo.xml:

    iResourceProduction - Maximum resource that is added to the stockpile each turn (default 1)
    iResourceCeiling - Maximum bonus resource stockpile ceiling (defalut 10)
     
  2. Gaius Octavius

    Gaius Octavius Chieftain

    Joined:
    Jul 28, 2006
    Messages:
    4,016
    Very nice! Might you consider expanding this later on to allow user-defined quantified resources? That is, is it possible to arrange it so that in XML one could automatically set which resources are counted and which aren't?

    How exactly does the AI handle trade under this new system? Does it recognize it needs stockpiles?
     
  3. Fanatic Demon

    Fanatic Demon Student in Wizardry

    Joined:
    Aug 6, 2004
    Messages:
    403
    Location:
    The Netherlands
    Yes, I'm working on that, but it is kinda tricky. However, I will try to make it as easy as possible

    Not much. Trade is general the same as normal. If you are in possesion of a resources and haven't traded it, it will generate resource every turn which you can use for construction. The same goes for the AI, if he gains a trade resource by trade from you, it will autoamicly generate resources for him, as if he owned it. Resources bonuses, are like white holes in the sense who ever uses them, gains the benefits. The advantage of this that it won't require much modification of the AI except that he will want to have a buy resource bonuses more if he is low on stokepile, and will want to trade it, if he has it in abundance.

    About trade, I could use some help, if anyone could tell me how to modify the trade screen to trade resource stockpiles, I would be very thankful
     
  4. Gaius Octavius

    Gaius Octavius Chieftain

    Joined:
    Jul 28, 2006
    Messages:
    4,016
    Can't you use the gold lump sum option as a base? I'm not too familiar with modding the trade screen.

    These are all up-front costs, I presume, not per turn costs? The reason I ask is that I was thinking of combining this with the building resource converter mod, so you could take in 1 iron per turn and make it into 1 steel. Trouble is, what happens when your stockpile reaches zero?
     
  5. Fanatic Demon

    Fanatic Demon Student in Wizardry

    Joined:
    Aug 6, 2004
    Messages:
    403
    Location:
    The Netherlands
    No the Mods, currently support 2 methods of using resource Bonuses:
    A: Initial cost, which have to be met, in order to start construction
    B: Gradual resource cost based on the avialability on bonus resource stockpile

    Let me clarify with an Example.

    Let's say you want to build a Swordsmen, which has a Start cost of 10 iron (iIronCost = 10) and 100% production bonus (iIronBonusMod = 100) at a cost of 10 iron (iIronBonusMax = 10)
    Then total Iron cost after you completed the unit and Iron supply was suficient, will be 10 Initial cost + 10 productivity bonus cost = 20 Iron cost.

    For option A, I could introduce a gold conversion change rate for Buildings (like the marketplace) which will allow you to pay the iron investment price with gold. That way, you can also start production without iron resource but at a considerable higher overal cost. Note that without iron you will neither benefit from the the iron resource bonus, making production also much slower. For example, that Swordsmen, which would take 5 turns to with sufficient access to iron (paying 2 iron each turn), will take 10 turns without iron and with a (1:2) market exchange rate for iron, it will cost you another 10 x 2 = 20 gold. :eek:
     
  6. bergrar

    bergrar Chieftain

    Joined:
    Apr 19, 2004
    Messages:
    194
    Gender:
    Male
    Location:
    italy
    I thought long time ago, to ask for a mod about strategic resources, is very important in modern ages, and i thought at some strategic deposit for them, when i play in modern ages i feel that resources are undervalued a lot, your mod will solve it for sure.
    but if you can add some buildings where resources could be stored, with a percentage of storing, more you store more building you will need,that will give a programmed time for a war.
    If i know that i have iron or oil for 100 turns i have to make my battle plans according to them, till i don't get the resource that i am fighting for.
    Thank anyway for your developing mods that help to make civ4 more great.
     
  7. Fanatic Demon

    Fanatic Demon Student in Wizardry

    Joined:
    Aug 6, 2004
    Messages:
    403
    Location:
    The Netherlands
    I had already planned to introduce some XML resource tags for buildings, which allows it to increase the Resource stockpile ceiling. However, to implement it properly I would need some 3D models of buildings specificly for this goal, like Oil Silos and Warehouses.

    What I also Like to introduce are More Mining Improvements which can generate improved output. For example, An Oil Drilling improvement with 2 or more pumps. This would players to increase Oil production.

    Unfortunatly I can't do any 3D :( So I would realy appreciate if any gifted 3D artist would help me. :mischief:
     
  8. bergrar

    bergrar Chieftain

    Joined:
    Apr 19, 2004
    Messages:
    194
    Gender:
    Male
    Location:
    italy
    hi
    i can do 3d but i don't know if i know the way for make them usable in civ4.
    can you show me a thread with a example of it, so i can see if i have the right tools for them, i can make easy animation for wonders and movies but i never tried to do a building
    anyway what building do you need and which kind of format you need them.
     
  9. Fanatic Demon

    Fanatic Demon Student in Wizardry

    Joined:
    Aug 6, 2004
    Messages:
    403
    Location:
    The Netherlands
    Great to hear people are willing to help! :goodjob:

    I'm not exactly sure what I need. Probably something similar to other existing Building mods (which by the way are in much lower number then units)
    Meabee this link will help: http://forums.civfanatics.com/showthread.php?t=167335
     
  10. bergrar

    bergrar Chieftain

    Joined:
    Apr 19, 2004
    Messages:
    194
    Gender:
    Male
    Location:
    italy
    i need to know if any1 knows a converter from obj 2 nif
     
  11. Gaius Octavius

    Gaius Octavius Chieftain

    Joined:
    Jul 28, 2006
    Messages:
    4,016
    Why do you need new building art? There are already great 3D models in the database of Oil Refineries and whatnot that would be perfect! ;)
     
  12. Dom Pedro II

    Dom Pedro II Modder For Life

    Joined:
    Apr 3, 2002
    Messages:
    6,811
    Location:
    Exit 16, New Jersey
    This looks promising. I'll be very interested to see where this goes.
     
  13. Fanatic Demon

    Fanatic Demon Student in Wizardry

    Joined:
    Aug 6, 2004
    Messages:
    403
    Location:
    The Netherlands
    Storing Oil near refineries? That's actualy a very good Idea. It's so simple I forgot all about it. similary I can use steel mills to store iron. and a construction yard to store stone.

    However, I still could use a whole lot of extra models for improvment.

    For exapmle I could use a modern day version of the water mill to generate electic power. But why stop there, shouldn't all power plant be build outside the city, like nuclear power plants. However, as your city increases, you need more power, and therefore larger power plants. It would therefore be helpfull to have multple levels of powerplants of the same type. For example, a level 1 coal plan would produce 10 MW, while a level 2 would producede 20MW and a level 3 coal plant 40MW. TO reprecent this effectivly we would need seperate models for each Power plant level, so it becomes visualy recognisable
     
  14. Viniloss

    Viniloss Chieftain

    Joined:
    Sep 11, 2007
    Messages:
    49
    What an amazing idea! =) Stockpiles! I hope you can make this works very well!!! I ll check it now.

    Do you know if there is a possibility to make the resource one day finish?! Like, i have one source of iron, and this source has like 1000 units of iron. I can explore this and just that. Like in the real world... This probably woud create interesting wars... :)

    Anyway, for the moment, Gratz! Very good work you done till now! :)
     
  15. Fanatic Demon

    Fanatic Demon Student in Wizardry

    Joined:
    Aug 6, 2004
    Messages:
    403
    Location:
    The Netherlands
    I uploaded 0.4. This will be the last version with 3.03 support. version 0.5 will be 3.13 compatible
     
  16. Dom Pedro II

    Dom Pedro II Modder For Life

    Joined:
    Apr 3, 2002
    Messages:
    6,811
    Location:
    Exit 16, New Jersey
    What exactly is the difference between 0.3 and 0.4?
     
  17. Fanatic Demon

    Fanatic Demon Student in Wizardry

    Joined:
    Aug 6, 2004
    Messages:
    403
    Location:
    The Netherlands
    To create a one turn finish unit simply set the unit production iCost> to 1 and add the desired resource xml tag like <iIroncost>
     
  18. snipperrabbit!!

    snipperrabbit!! Chieftain

    Joined:
    Nov 23, 2006
    Messages:
    3,396
    Viniloss is talking about resource depletion while you are replying about building a unit in one turn. Not sure if there's any correlation here.
     
  19. Fanatic Demon

    Fanatic Demon Student in Wizardry

    Joined:
    Aug 6, 2004
    Messages:
    403
    Location:
    The Netherlands
    A, you mean realy deplete a resource. Well, the current version doesn't support that but it certainly could be implemented. The problem however, is that it will be kind of hard to balance. Because how to know how much a resource should deliver to prevent the world runs out of oil too soon? Then there is the problem that you do not want all oil resources being equal. A map maker, would therefore have to be able to set every oil resource maximum quantity. This could be done with python, if nessisary, at run time.
     
  20. snipperrabbit!!

    snipperrabbit!! Chieftain

    Joined:
    Nov 23, 2006
    Messages:
    3,396
    I thought last month that an event can help to balance this kind of thing i.e. when a resource is depleted there is a reasonable chance it respawns in the same tile provided you managed to get a technology like geology or steam power (if no new tech). The respawning can be delayed and nothing will happen after the delay expires.
    What do you think ?
     

Share This Page