More Resources

Ekmek

on steam: ekmek_e
Joined
Aug 7, 2002
Messages
6,115
Location
San Diego, California
First off, Koma you said it was possible to add more resources to the game without doing anything to the SDK. I tried once but it crashed. Do you know the steps to do it?


I've begun merging AoD2 with Mare Nostrum. I have a decent working copy but need to update some stuff. However I think it an opportunity to try this idea - adding more resources.

I definetely want to redo slaves as I mentioned before. But I'm thinking of making food more complex.

I think each tile should have a basic 1 food yield but for moreyields you need to grow wheat that turns to food (bread) at a bakery. Grapes could be used to make wine or food(fruit). fish, sheep, and cows would be converted to food at the butcher (maybe not fish). This approach would make food more complex and i want to have alternate consumptions choices instead of sheep to wool cloth and grapes only to wine. I think having your resources convertible to different stuff could add a new dimension.

this is doable only if I can get more resources added to the game.
 
First off, Koma you said it was possible to add more resources to the game without doing anything to the SDK. I tried once but it crashed. Do you know the steps to do it?

No, see this tutorial: http://forums.civfanatics.com/showthread.php?t=319070. Yields are hard coded in CvEnums.h. :( That certainly is a hangover from civ4 where we had only 3 fixed yields.
If you tell me what yield types you want to add, I can try compiling a new dll.
 
ok, thanks Koma. I think I'll work on the integration piece. then from there we can look at resources. Is there a way to fix the code from being hard coded and instead just read the number of entries in the yield.xml. I've done some C++ in the past so I know its kind of doable, but I guess its a matter of finding all the specified yields in the code (and hopefully not in the exe)
 
I believe yields are only listed in CvEnums.h. I know they aren't in the .exe, mods like Plantation Economy alter them.
 
I believe yields are only listed in CvEnums.h. I know they aren't in the .exe, mods like Plantation Economy alter them.

true, but if we modify the code to count the numbrer of yields in yield.xml instead of how its done in CvEnums.h then I'm not sure if that will mess up something thats hardcoded. But you may know better than me since I have messed with the SDK at all (I'm too lazy).
 
Since Fortuente's tutorial on Adding a new yield/resource to COL isn't about adding new tradable yields, I've posted this short "tutorial" sometime ago. It's not precise but if you look at the files from my mod Plantation Economy, you can figure out pretty much how it works:


  1. XML:
    Depending on the order you want the Yields to appear in the City and Europe screen, split your CIV4YieldInfos.xml between the Assets/XML/Terrain folder and your Module Folder.
  2. Gamefonts:
    You need to add your new Gamefonts in the same order as your Yields in XML & Module...
  3. SDK:
    Look for my "MORE_YIELD_TYPES" comment in those files, you need to add the YieldTypes enum and AI to the list:
    - CvEnums.h
    - CyEnumsInterface.cpp
    - CvCityAI.cpp
    - CvPlayerAI.cpp
  4. Python:
    You need to adjust the Interface so that the new number of yield shows up correctly in the City and Europe screen as well as in the Domestic Advisor menu.
    - CvEuropeScreen.py - Divide the "self.XResolution" in "YieldAreaWidth" by the total number of yields
    - CvMainInterface.py - Adjust the "RESOURCE_TABLE_COLUMN_WIDTH"
    - CvDomesticAdvisor.py - Look in my file, lot's of changes...

I think the yields are hardcoded so that the AI in the CvCityAI.cpp and CvPlayerAI.cpp knows what to do with each one. Like, which one are tradable, which one it should buy from Europe, which one is a final product or can be transformed by citizen, etc...

Hope this helps!

Aymerick
 
Back
Top Bottom