[SDK] Adding a new yield/resource to COL

You're sailing into unchartered waters, Aymerick, in true Colonization style. :)

The whole thing smacks of hardcoding to me. Boo hiss. It's great that your trying to figure this out - it could add a lot of modding potential to the game.
 
The number of yield types is set by the number of yields in CvEnums.h
Increase or decrease this and the variable NUM_YIELD_TYPES will automatically change. This variable controls lots of stuff elsewhere too.
 
It seems like something that is unlikely to be in the exe, so I can only guess that it will be in code that we can find.

It may help that the yields part of the font finds its way into the code files at line 323 of CvUtil.py, the specific order of the yields comes from wherever getYieldInfo comes from (as called on line 330 of the same file).
 
I wish I knew what I was actually doing with all the c++ and python stuff, but oh well.

I'm thinking the place to start looking may be on line 78 of CyGlobalContextInterface1.cpp:

Code:
.def("getYieldInfo", &CyGlobalContext::getYieldInfo, python::return_value_policy<python::reference_existing_object>(), "(YieldID) - CvInfo for YieldID")

getYieldInfo is referenced plenty in the SDK files, so there is a bit too look through if you do a search for it.
 
SUCCESS! I've done it and it works great!! Yé!!! :D

I knew the solution was to use modules...

I still have to get the europe resource table show up right, edit some graphics (I just used the spice icons for Civ4 for coffee...) and get the PlotLSystem working right so I'll release everything when it's done...

Is anyone good with making units? I'd need a Coffee planter and Indigo planter...

here are some screenshots for you guys...



 

Attachments

  • Civ4ScreenShot0011.JPG
    Civ4ScreenShot0011.JPG
    170.1 KB · Views: 405
  • Civ4ScreenShot0012.JPG
    Civ4ScreenShot0012.JPG
    146.8 KB · Views: 430
  • Civ4ScreenShot0013.JPG
    Civ4ScreenShot0013.JPG
    109.8 KB · Views: 425
Excellent work mate! Really good stuff.
 
sweet. I cant wait for more resources to be added to the game. to me the production/trade side is quite boring with such limited resources. I want more resources, more buildings and more combinations (eg cloth & dye = fine clothes)!! :)
 
SUCCESS! I've done it and it works great!! Yé!!! :D

I knew the solution was to use modules...

I still have to get the europe resource table show up right, edit some graphics (I just used the spice icons for Civ4 for coffee...) and get the PlotLSystem working right so I'll release everything when it's done...

Awesome work! I can't wait to see how you did it, this is something I'll need to do myself if only for the practice.
 
I think it's worth coming up with an overall plan for new resources now that you've cracked the new yield issue.

1. We know we want more, but how many is too many? To list bonuses/yields I've seen implemented or mentioned somewhere around here we have:

Coffee Beans
Cocoa
Dye
Gold
Potatoes - (I like this for some reason - graphics exist - could use Bonus xml to make appear in only Southern Hemisphere)
Prime Timber - (from original Colonization - just produces more wood)

Beyond this I think other suggestions such as Amber or Rubber either aren't that interesting or weren't really exploited and traded before the War of Independence. Obviously, this area is open for discussion...

2. How can we make resources and production more interesting than just Raw Material -> Finished Product repeated several times?

I summarised some of the ideas from the Cochineal Insects thread here (we seem to have a few threads touching on similar ideas, but I decided to post this in this one)

And I also like the subsequent Settlers type idea from that thread where resources can be allocated to different uses or produce. Basically, it would be nice to come up with a big picture plan for changes to resources, yields, bonuses and production.

Also, Aymerick, are you working on a mod with all this code you are doing? If not, I'd be happy to incorporate into my mod to test this stuff out...
 
Also, Aymerick, are you working on a mod with all this code you are doing? If not, I'd be happy to incorporate into my mod to test this stuff out...

Yes, I'm working on a mod I call "Plantation Economy" and I plan to release a Beta version for testing today...

I'll also make a tutorial on how to add tradable yields. But actualy, it's really simple, there's only light SDK changes! Basicly, you need to use modules (well, more like "partial" modules because somethings won't work as modules like the PlotLSystem...). I used this tutorial as reference, check it out you'll see...
 
Top Bottom