Problem in detecting source of happiness towards golden ages

Zimdictive

Chieftain
Joined
Mar 18, 2013
Messages
47
Location
Cambridge, UK
I'm seeing this bizarre bug when using Whoward's DLL and CivUP/GEM - engineering specialists (the others seem fine) contribute - on unpredictable occasion - ridiculous quantities of either happiness (+268435456 - linked to a screenshot I took below) or unhappiness (haven't taken a record of the figure). More bizarrely still, it happens even when all the options in Whoward's DLL are disabled. The conflict is occurring between CivUP/GEM and the DLL - it happens when no other mods but these are enabled, and only when the DLL is enabled with CivUP/GEM.

I've reported it in Whoward's DLL thread, but as he doesn't use CivUP/GEM, I can't expect him to treat it as any kind of priority. So, I set out to try to come up with a workaround myself, and have so far put many hours into the quest. Yet, I remain quite confused about what to do, as there is no sign of such problems in the logs over a great number of games, and when using firetuner to query the happiness APIs for all available figures, all that are reported are normal. It's as if some other variable is factoring into the golden age calculations between those going into the happiness figure showing up for the UI, and the happiness addition to that which is currently stored towards the next golden age.

And if I can't find where this number is stored (all the things I can call upon from the APIs report normal figures, so I can't tell, from a code perspective, with my limited knowledge, when the problem is and is not happening) I can't either modify it directly, or make a modification to another variable to allow for it in the golden age calculations.

I'm wondering if anyone here can kindly provide any advice on what to do next. The documentation available isn't very helpful, and as happiness isn't a yield I'm baffled in how a specialist could provide it.

Many thanks.

http://steamcommunity.com/sharedfiles/filedetails/?id=137813378
 
and as happiness isn't a yield

It is in GEM, check out the YL_General files - it adds a number of yields, including YIELD_HAPPINESS_CITY and YIELD_HAPPINESS_NATIONAL
 
It is in GEM, check out the YL_General files - it adds a number of yields, including YIELD_HAPPINESS_CITY and YIELD_HAPPINESS_NATIONAL

Now I feel immensely foolish. I didn't think to check whether CivUP - and not the GEM files alone - changed yields. They did. :lol: And I realise I wasted several hours trying to find a reason why specialists could possibly cause happiness when I probably never would have. I found my number a few minutes after your assistance.
 
You found the code that displays the number, or you found the problem with the code that displays the number?
 
You found the code that displays the number, or you found the problem with the code that displays the number?

Neither, apparently. I'm back where I started: the happiness yield is not coming via the CivUP additions; i.e. YIELD_HAPPINESS_NATIONAL. I can set it in the XML to 0 for specialists, and query the database in firetuner via GetSpecialistYield(GameInfo.Specialists.SPECIALIST_ENGINEER, YieldTypes.YIELD_HAPPINESS_NATIONAL) and it returns 0, even while Civ's UI is telling me "268,435,456 :) from specialists".

The false hope I found yesterday was from GetBaseYieldRateFromSpecialists(YieldTypes.YIELD_HAPPINESS_NATIONAL) which just returns some nonsense figure (e.g. -2147483648) that seems to have no bearing on anything - it shows such things from players that aren't even experiencing the specialist happy bug, or even those that have no specialists or buildings to house them.

Now I'm more than a little stuck.
 
Still not seeing it.

Only three mods installed are DLL, CivUp and GEM (last two from the zip you linked to). CivUP .modinfo file hand edited to make sure the DLL loads first

Start a game, use FireTuner to give Cathy Archery and Training techs and also 300 in cash.
Buy a Krepost. All tooltips, top panel items etc display correctly for the next 30 or so turns (by which time I'm bored with the jerky animations)

Are you still using IGE to give the Krepost, or have you changed to FireTuner? Do you have the required techs before gifting the Krepost?

There are definately bugs in CivUP/Gem as I'm getting lots of ConvertTextKey errors in lua.log where it's trying to access nil variable(s)
 
Still not seeing it.

Only three mods installed are DLL, CivUp and GEM (last two from the zip you linked to). CivUP .modinfo file hand edited to make sure the DLL loads first

Start a game, use FireTuner to give Cathy Archery and Training techs and also 300 in cash.
Buy a Krepost. All tooltips, top panel items etc display correctly for the next 30 or so turns (by which time I'm bored with the jerky animations)

Are you still using IGE to give the Krepost, or have you changed to FireTuner? Do you have the required techs before gifting the Krepost?

There are definately bugs in CivUP/Gem as I'm getting lots of ConvertTextKey errors in lua.log where it's trying to access nil variable(s)

It's there. I'm playing on a fresh Windows install (due to unrelated reasons), new partition, Civ install, etc. It doesn't show up consistently especially early in the game, and it does not necessarily affect all players. It can also not show up at all until the game is saved and reloaded. I'm using firetuner, and autorunning games to 300-400 turns and then simply checking on the cities in game by using firetuner to switch Civs, or using the CivUP lua log debug output button (below is an extract of such a log) in the top right of the UI. I've attached a save where it's massively prevalent.

I'm also using modified modinfo files to ensure the DLL is loaded first. And those errors in the lua log are the same as without the DLL... I've been staring at them quite a lot. Fixed a couple of problems with typos in GEM along the way.

-73 60 18 0 1073741797 Elizabeth AI_HAPPINESS
-40 190 206 20 805306360 Alexander AI_HAPPINESS
-26 58 94 35 805306346 Augustus Caesar AI_HAPPINESS
-23 73 88 0 268435425 Oda Nobunaga AI_HAPPINESS
-62 44 2 0 1073741802 Hiawatha AI_HAPPINESS
49 160 155 4 1073741807 Maria Theresa AI_HAPPINESS
-19 49 65 12 268435432 Harald Bluetooth AI_HAPPINESS
 

Attachments

Back
Top Bottom