[SDK QUESTION] Specialist Yield problem I'm having...

Grave

1 Goat = 400 Horses
Joined
May 5, 2002
Messages
1,530
Location
Louisiana
What determines the the amount of :food: :hammers: :science: a specialist produces?

I'm having problems with my mod, where Merchants and Engineers only will have some obscene modifier, like +140987 to food, hammers and science. The other specialists are OK.

It's not my own code, it's a third party product, but I'm trying to pinpoint the issue down because the I plan on using this code in my mod.


So where would I start looking?
 
What determines the the amount of :food: :hammers: :science: a specialist produces?

I'm having problems with my mod, where Merchants and Engineers only will have some obscene modifier, like +140987 to food, hammers and science. The other specialists are OK.

It's not my own code, it's a third party product, but I'm trying to pinpoint the issue down because the I plan on using this code in my mod.


So where would I start looking?

Note: This is based on vanilla Civ4, some might have changed in WL

What "third-party product" are you using? I'm assuming it's an SDK mod?

The first step is to check out the Yields in the Specialist XML. That is loaded into the SDK in the CvSpecialistInfo::read(CvXMLLoadUtility* pXML) function.

During the game, whenever you add/remove a specialist, the "CvCity:: processSpecialist" function is called. After updating the number of specialists, it calls CvCity::updateExtraSpecialistYield. This function will go through all the specialists, find their yield changes, and multiply that by how many specialists of that type are now being used. Then, it calls CvCity::changeBaseYieldRate for that yield type to update the number.

Hopefully that can give you some hints on what's going on.
 
Note: This is based on vanilla Civ4, some might have changed in WL

What "third-party product" are you using? I'm assuming it's an SDK mod?

I'm using Aussie Lurker's Civic Balance Mod, which is found here:
http://forums.civfanatics.com/showthread.php?t=190462

It's an SDK mod. I ran into this problem last year, and we were able to iron out the problem in the above thread... but somehow a whole month's worth of posts in that thread dissappeared, along with it the fix for the bug I'm experiencing.

So now I need to try and figure this out on my own.

The first step is to check out the Yields in the Specialist XML. That is loaded into the SDK in the CvSpecialistInfo::read(CvXMLLoadUtility* pXML) function.

During the game, whenever you add/remove a specialist, the "CvCity:: processSpecialist" function is called. After updating the number of specialists, it calls CvCity::updateExtraSpecialistYield. This function will go through all the specialists, find their yield changes, and multiply that by how many specialists of that type are now being used. Then, it calls CvCity::changeBaseYieldRate for that yield type to update the number.

Hopefully that can give you some hints on what's going on.

OK, I'll take a look at this and see if something jumps out at me.
 
Well, I went through what you said... didn't see anything different between my mod's SDK files and the original untouched SDK files.

Here are two screenshots...
 
Well, I went through what you said... didn't see anything different between my mod's SDK files and the original untouched SDK files.

Here are two screenshots...

I see. Does the differences actually affect the game? So, when you go a turn, do you get that huge number yield? When the "help text" boxes are being displayed, they're using some of the other functions. Look at the CvGameTextMgr::parseSpecialistHelp function in CvGameTextMgr.cpp
 
I see. Does the differences actually affect the game? So, when you go a turn, do you get that huge number yield? When the "help text" boxes are being displayed, they're using some of the other functions. Look at the CvGameTextMgr::parseSpecialistHelp function in CvGameTextMgr.cpp


Yeah, everything takes one turn. One turn to discover techs, one turn to build units/buildings, and the city grows at a rate of 1 per turn.

I did some digging on here, because I know Aussie and I discussed this issue back in October, and I found this...

http://forums.civfanatics.com/showthread.php?t=178134&page=3

I'm gonna try this and see what happens...
 
Top Bottom