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

[MODCOMP] gordonthewhale's Agriculture Mod

Discussion in 'Civ4 - Mod Components' started by gordonthewhale, Nov 9, 2006.

  1. alms66

    alms66 Warlord

    Joined:
    Jan 3, 2005
    Messages:
    273
    Location:
    Louisiana
    A nice concept to incorporate into this mod if it can be done is that all these resources that are provided by all these tile improvements are actually used for something - how about feeding your population? Genius, I know.:mischief:

    Remove all food production from all tiles and derive it from the food resources (corn, wheat, etc.) instead. Have buildings which convert the food resources into food to feed the population. City tiles themselves will probably need to produce food the "vanilla" way so that they don't starve right away. That takes care of all of the resources except horses, they were used more for production than food, so maybe each horse resource you have can provide hammer bonuses?
     
  2. subanark

    subanark Warlord

    Joined:
    Jan 19, 2005
    Messages:
    131
    Location:
    WA
    The idea would be that a balanced diet leads to a healther society.

    Having 1 cow, 1 rice, 1 corn is better than 3 rice.

    My idea is that farms add the same amount of food they always have, but in order to get the health bonuses you have to have a variaty of farms.

    As far as making resources a requirement for a technonlogy, couldn't you just create place holder technonlogy (say "Access to rice"), have that be a requirement to reasearch "Rice Farms". Then you would grant the technonlogy when a player gets rice, and take-away the technonlogy when the player loses the resource (if they were researching it you could just set the currently researching tech to none, but still keep the progress in that tech).

    If you wanted to go the production route, you could require building project pieces (similar to how spaceship works) so that multiple cities can help at the same time. Then grant the tech when the projects are built (so you can trade it to another player).

    P.S. Yea I know I should look into moding myself, so I at least know how the event system works.
     
  3. gordonthewhale

    gordonthewhale Chieftain

    Joined:
    Jan 8, 2006
    Messages:
    33
    Location:
    Oklahoma, USA
    [Edit: I misread your idea the first time]
    That is very interesting! If I understand correctly, you are proposing a building like "Flour Mill: +2 food, -1 wheat". That would allow cities with massive food production to support other cities. It is extremely micro-managey, which I would like to avoid if possible. Also, there's a question of how to make a city use more than one of each resource. Perhaps tie the effect of the mill to the population? But then what to do once there's more people than wheat? Which city gets the grain? If it is done automatically, there would surely be suboptimal results. If not, more micromanagement.

    I'm not trying to shoot down your idea, because there are some things I definitely like about it. We just need to develop it a little more.
    That does make sense. The question is whether this is more appropriately applied at the civilization level (as it already is) or at the city level, or both. In Iowa, they just have two crops (corn and soy, and the soy is losing share) but I don't think that people in Iowa eat a less diverse diet than people in America in general. That's because of our modern distribution system, but if you look back before that system was technologically feasible, people were growing more types of food on each farm. Since, as I said, I'm leaning towards a more polyculture model anyway, I don't feel like this is worth adding.
    Honestly, I much prefer to mod the SDK than do things through python event handlers. A custom DLL is less easily mergeable, but scripting seems like a sort of work-around to me. Why mess around trying to use the existing rules to get what I want done, when I can just change the rules? As it happens, I'm much more comfortable with C++ than Python, anyway, and I'm sure that's coloring my preference.
     
  4. gordonthewhale

    gordonthewhale Chieftain

    Joined:
    Jan 8, 2006
    Messages:
    33
    Location:
    Oklahoma, USA
    Aha! I'm afraid the problem is that I have been a stupid American and not provided the translation strings from English. I'm embarassed. Playing in English should fix your problem. Also, I'll make a new version of the text file that contains all the translation tags, but still in English. That way, the game will work properly, but the new text which I've added will always appear in English. (I don't trust an online translator to make it actually sound right.) Look for it later today. If you'd like to do a real French translation, let me know!
     
  5. snipperrabbit!!

    snipperrabbit!! Deity

    Joined:
    Nov 23, 2006
    Messages:
    3,396
    Ok ! there are probably stupid americans, as everywhere in the world but, IMO, no one who are making mods for civilization's.
    I'm actually busy on the graphics, I plan to use later. If you want some of my buttons, go there. I think that the one representing crop rotation will be interesting for you ( it's from a picture taken in Taiwan ).
    If possible, I will try to translate the main sentences of your mod, and PM you when done with the french text.

    Thanks, snipperrabbit!!
     
  6. gordonthewhale

    gordonthewhale Chieftain

    Joined:
    Jan 8, 2006
    Messages:
    33
    Location:
    Oklahoma, USA
    The new version is up. The text in need of translation is in gordonthewhaleAgriculture\Assets\XML\Text\gordonthewhaleAgricultureTextInfos.xml.
     
  7. snipperrabbit!!

    snipperrabbit!! Deity

    Joined:
    Nov 23, 2006
    Messages:
    3,396
    Hey, I've already made the changes but it is not a word-to-word translation because in french it was crappy. I have just a problem with accents and tremas so it shouldn't work actually. I know how to fix it but it need some research. Has anyone got some beakers left that I can borrow ?
    Here is what I've done so far. Be carefull, I have added Fr in the filename :

    EDIT: translation completed.
     
  8. alms66

    alms66 Warlord

    Joined:
    Jan 3, 2005
    Messages:
    273
    Location:
    Louisiana
    To help clarify, let's set up an example of an empire with 4 cities, each of size 4, and 32 wheat resources coming from it's 32 wheat farms. Each city consumes 8 units (4 citizens eat 2 food units each = 8 units) of food, which totals 32 units of food that the empire needs to sustain itself. Turns out, that's exactly how much it has (I'm simplifying by ignoring the fact that city tiles will probably need to still produce food the old fashioned way - from tiles), which means that this empire needs to find a new source of food in order to grow any more. Now, let's say workers finish building 2 more wheat farms, giving 2 more wheat resources - that's one more citizen the empire can support and thus one city can grow by one population point.

    So, technically, a building isn't even needed for the concept (though the coding might require one).

    As to your questions:
    1. Also, there's a question of how to make a city use more than one of each resource. Perhaps tie the effect of the mill to the population?

    You could have a national pool of food units, and distribute those to the food boxes of the cities in the order that they build the requisite building.

    2. But then what to do once there's more people than wheat? Which city gets the grain?

    Same as #1.
     
  9. snipperrabbit!!

    snipperrabbit!! Deity

    Joined:
    Nov 23, 2006
    Messages:
    3,396
    I would prefer that the generic farm for Civ4 can be build the same way as vanilla which would represent well polyculture, not only on resource. Each farm on a resource should provide the ability to build a few amount of specific improvement.

    [ ex : I have a resource of rice crop I've just finished to hook with a farm so now I could see 1 Rice in my capitol ; This single resource allows me to build up to 4 paddy rice in any avilable tile of my empire.
    May be 150 turns after the construction of the first paddy rice, I obtain a second resource of rice and start building more paddy rice to reach 9.
    The formula I'm thinking of is : ( 1 + Nres )² = K
    Nres is the number of res resource availble ( 2whe means 2 resource of wheat )
    K is the resulting number of specific improvement availble
    ( 1 + 2whe )² = 9 wheat fields I can construct in suitable tiles
    This way, if I don't have horse ( 1 + 0hor )² = 1 , I'm still able to build one paddock, although I must have horse in my LoS ;
    yes exploration]


    In addition, making the generic farm growing à la cottage/hamlet/ ... assures a new level of thought choosing between specific static improvements and generic dynamic improvements

    Ooh, I don't want to be confuse because of my english. I have to sleep a little.
     
  10. MoonBase

    MoonBase Warlord

    Joined:
    Jan 13, 2006
    Messages:
    105
    Is it possible to make each instance of a resource provide another benefit?

    Right now, one wheat is all you really need, every other one is superfluous except for trade.

    If it could be coded such that having two wheats gets you twice the benefit, then having wheatfields producing wheat resource would be excellent.

    I've got two ideas for how to use this excellent mod, the first assuming that it's possible to make multiple resource instances provide mulitple benefits.


    IOW, if you've got that one "natural" wheat resource, and that allows you to build wheatfields (say, only on irrigated plains or something). Each wheatfield provides another wheat resource. Each wheat resource gives +1 food for all connected cities. This makes connecting small cities to the trade network that much more important. The food production of the entire empire imposes the limit on city growth, not strictly the food production potential of each individual city.

    It makes nabbing additional resources that much more important for growth, and it shouldn't take much addition at all to get the AI on board with the concept.

    If this sceme is possible, then in addition to the agricultural changes, a change to strategic resources would be possible: something along the lines of each iron/coal/oil/copper/whatever providing +1 hammers to every city in the trade network. An empire with two sources of iron has a production advantage over the empires with one, not just an available unit advantage.

    That might require pumping up the number of instances of the strategic resources for balance. But rather than it simply being a question of having/not having iron, it would be more about who has the most. Controlling three oil sources would confer a distinct industrial advantage over controlling one.



    Otherwise, if there's no easy way of making 2 wheat twice as good as one wheat, then I think the idea of the National Wonder providing and requiring a resource to be the best bet.

    IOW, you have no natural wheat sources. You trade with a neighbor, who gives you his extra wheat. Now that you've got access to wheat, you can build wheatfields, but aside from the food production they provide no resources themselves.

    Also available is a National Wonder, let's call it "Wheat Market" or somesuch. It provides one wheat resource, thus representing the fact that you've got a domestic supply now.

    That seems to satisfy the idea of food sources spreading, while avoiding the 200 wheat resources floating around.


    Now, if only I knew enough about the code to test my first option out...:sad:
     
  11. gordonthewhale

    gordonthewhale Chieftain

    Joined:
    Jan 8, 2006
    Messages:
    33
    Location:
    Oklahoma, USA
    The idea of multiple resources providing a stacked bonus leads to world scale questions. If I'm playing a tiny map, and I only have three cities, then the number of rice paddies I could possibly make is limited, maybe 20. So, +20 food per city? That's huge, but could work, especially if "conventional" food production were significantly reduced. But if I'm playing a huge map, and I have 30 cities, then I'm getting +200 food per city, and it just seems unreasonable. I feel that either:
    • resources effect every city, but doubling(tripling) on resources adds no furthur bonus
      -or-
    • each resource effects only one city, but multiple instances of a resource adds multiple bonuses.

      There have been several suggestions for the second style, and I might like to work towards it in the future, but for now, I think I'm going to stick with the first one, and try to deal with getting the crop-dependent farms working and reasonably well-balanced.

      In other news, I went to the UN's FAO page and downloaded some agricultural data. Specifically, I was looking for which are the most important world crops, by hectares planted. Civ4 team got the top 3 right (maybe they looked it up themselves).

      The thing is, including or omitting crops strictly based upon their worldwide acreage doesn't seem exactly reasonable, because different crops are important for different reasons. They seem to roughly fit these categories:
      Spoiler :
      Staple crops These provide lots of calories per hectare and can be easily stored; generally grains, beans, nuts, and tubers. +food.
      Oil & sugar crops They are very high in calories, but typical yield per hectare is smaller, and they don't really contribute much to a society's health. These might provide a balanced amount of +food and +commerce.
      Industrial & Fiber crops Some of these are improtant enough to be strategic resources, but they should all provide either +hammers or +commerce.
      Fruits Some of these, especially in the tropics, provide enough calories per acre to be staples, but they are harder to store. They do tend to take longer to get established though. +health, +food, and +commerce.
      Vegetables These are not usually significant calorie producers, but they are good +health.
      Spices Insignificant producers of food and health, but lots of +commerce.
      Drugs These are a tough call. Surely, they are worth a lot of +commerce, and maybe +happiness (Maybe more in the sense of stupefying the masses than making them happy, but honestly, that's what all the luxuries are.) Some of them should also be giving a +yuck, specifically poppies and, after Chemistry, coca.
      Large Livestock Some are strategic resources, some just provide food, some add hammers, some produce fiber and therefore commerce. These are suitable for pasturing on land that cannot be farmed due to lack of water or hilliness, but do not produce as much food.
      Small Livestock Also various. These can't be pastured, they just add to the production of farm squares.
      So, given that a player has gotten at least one crop in each area, how do they control which are most important to grow? Monocropping is unrealistic until modern times, but there can certainly be different focuses. So:
      Farm: the focus is on food and health. This will include bonuses from staples, oil & sugar, some fruits, vegetables, large & small livestock.
      Orchard: like a cottage, this takes a while to reack maturity. It gets bonuses from tree fruits and nuts.
      Commercial Plantation: The focus is on commerce. This will include bonuses from oil & sugar, spices, drugs, and the soft fibers: cotton, silk, wool.
      Industrial Plantation: The focus is on production. This will include bonuses from rubber and the industrial fibers.
      Pasture: Focus on food & commerce, but can be built in areas where farms would be impossible. It includes bonuses from large livestock only.

      So, here are the most planted real-world crops in each category:
      Spoiler :
      Staples:wheat, rice, maize, soybean, barley, sorghum, millet, beans, groundnuts (=peanuts), potato, cassava, oats, chick peas, coconut, cow peas, sweet potato, rye, peas, plantain, pigeon pea, yam, lentil, (triticale-this is wheat x rye), cashew, broad beans, buckwheat, taro, almond, Lupins, walnut, hazelnut, pistachio, fonio, chestnut, quinoa, yautia, brazil nut.
      Oil & Sugar:rapeseed(=canola), copra(coconut), sunflower, sugar cane, oil palm, olive, sesame, sugar beet, linseed (flax)
      Fiber & industrial: Cotton, Rubber, Jute, Hemp, Flax, Sisal, Manila
      Fruits: Grapes, Apples, Bananas, Tropical(guava, mango, mangosteen), Oranges(actually Tangerine x Pomelo), Watermelon, Plums, Tangerines, Pears, Peaches, Melons, Dates, Pineapples, Lemons (actually Lime x Citron) & Limes, Persimmons, Cashewapples, Figs, Apricots, Papayas, Avocados, Cherries, Grapefruit, Strawberries, Raspberries & Blackberries, Currants, Cranberries & Blueberries, Kiwi Fruit, Quinces, Gooseberries
      Vegetables:Tomato, Cabbages, Onions, Cucumbers, Eggplants, Green Peppers, Squashes, Asparagus, Garlic, Green Peas, Carrots & Turnips, Lettuce & Chicory, String Beans, Brocolli & Cauliflower (same species as Cabbage), Spinach, Okra, Artichokes, Leeks, Mushrooms
      Spices: Chile, Mustard, Anise/Badian/Fennel/Coriander, Pepper, Cloves, Nutmeg & Cardamom, Carob, Vanilla
      Drugs:Coffee, Cocoa, Tobacco, Tea, Betel Nut, Kola Nut, Maté, Hops. Unlisted, but I know they're out there in big quantities: Hemp, Coca, Poppy. Grapes (wine) and apples (cider) could also go in this category, but beer should be made at a Brewery building, using any available grain.
      Large Livestock:Cattle, Sheep, Pigs, Goats, Buffalo, Horses, Donkeys, Camels (I'd also add Llamas, because they were historically very important in South America, even though they apparently are no longer important enough for the UN to keep track of).
      small livestock:Chickens, Ducks, Rabbits, Geese, Turkeys, Beehives
      I'm not saying that Civ4 needs every single thing listed there. Definitely, each map doesn't need every single thing listed there. However, each crop would only allow/benefit improvements on plots suitable for that specific crop, and some variety from game-to-game would also be interesting.

      Now the next step is to determine where each crop could be grown, what exact bonuses it should provide, and which ones can be conflated.
     
  12. snipperrabbit!!

    snipperrabbit!! Deity

    Joined:
    Nov 23, 2006
    Messages:
    3,396
    Here are some pretty buttons for Wheatfield, Cornfield, and Paddy rice I submit to approval.
    In the attachment below, I put 3 size of each from 32x32 to 128x128. It's png format !

    there's the preview :

     
  13. snipperrabbit!!

    snipperrabbit!! Deity

    Joined:
    Nov 23, 2006
    Messages:
    3,396
    Icons for new crops :




    These are respectivly for soy, sorghum and barley.

    Sorry, no attachment until complete list !
     
  14. snipperrabbit!!

    snipperrabbit!! Deity

    Joined:
    Nov 23, 2006
    Messages:
    3,396
    Icons for new crops :




    These are respectivly for cotton, flax and rubber (hevea).

    Sorry, no attachment until complete list !
     
  15. gordonthewhale

    gordonthewhale Chieftain

    Joined:
    Jan 8, 2006
    Messages:
    33
    Location:
    Oklahoma, USA
    Nice work. I am a little concerned that the smallest sized icons (which will show up in the action bar, I think) will lack detail. Maybe do more of a close-up for those?
     
  16. snipperrabbit!!

    snipperrabbit!! Deity

    Joined:
    Nov 23, 2006
    Messages:
    3,396
    Have you tested them by creating a dds with alpha mask ?
    I'm currently working at the gathering of all the resources you've mentioned in post #31. For sure, it needs to be worked further but I need a more restrictive list first
    I have to send you PM for an issue regarding the request about cornfields in a couple of hours.
     
  17. velosepappe

    velosepappe Warlord

    Joined:
    Mar 2, 2005
    Messages:
    141
    I didnt really read the whole topic but i dont think this was mentioned. Like it was mentioned before, you could in fact trade horse for something else, so the other player is able to build horse pastures (with or without a bonus). If it's implementable, design an action for units in a way that they are able to not only destroy the improvements (pastures), but also the resources (horses). In this way, a pilager could make sure that not only the enemy loses its access to the trading good, but also loses the trading good alltogether, so they have to buy the recourse all over again. This should make the value of the biological goods (getting rid of an iron recourse should be impossible), much higher.
    It should also be possible with higher technology like microbiology or artificial insemination, or buildings like fertility hospitals, to only lose the recourse, but not the ability to rebuild.

    If anyone wanted to, he could be able to wipe out an entire species before anyone has researched the technology i just talked about, altough it would be a very hard task.
     

Share This Page