[154.2] Puppet cities give negative science output

Pep

King
Joined
May 28, 2002
Messages
688
Location
Spain
As you can see in the first image, the :c5science: science output of Yaroslavl' is -12. This quantity substracts from my cities science output total so owning this city is hurting my research. This happens because the Viceroy "building" hasn't been changed for v154.1 rules and stills gives -2 :c5science: per :c5citizen: (second image). I think it should be changed to give -1 :c5science: per :c5citizen:.

In the third image you can see I'm getting +545 :c5science: per turn. What's odd is that 545 <> 15 + 288.8 + 198 (= 501.8). Where does the extra 43,2 come from?

EDIT: Also, I've noticed puppet cities delay the building of Mentor's Hall. It may be related to the negative science problem or perhaps it's because it's a new building and AI doesn't know what to do with it.
 

Attachments

  • science_v154_1.jpg
    science_v154_1.jpg
    122.1 KB · Views: 70
  • science_v154_2.jpg
    science_v154_2.jpg
    120.6 KB · Views: 56
  • science_v154_3.jpg
    science_v154_3.jpg
    117.1 KB · Views: 85
Thanks for reporting the puppet bug; I've fixed it for v155.

I don't know where extra science might be coming from. It's probably a source missing from the tooltip, or perhaps I miscalculated the value displayed for the RA bonus (it actually adds a percentage, not a fixed amount). Do you have any policies which could be awarding science?

Puppets avoid building any science buildings.
 
Thanks for reporting the puppet bug; I've fixed it for v155.

I don't know where extra science might be coming from. It's probably a source missing from the tooltip, or perhaps I miscalculated the value displayed for the RA bonus (it actually adds a percentage, not a fixed amount). Do you have any policies which could be awarding science?

Puppets avoid building any science buildings.

Yes, I have the Scientific Revolution policy. I've analyzed it and the numbers match: 545 = 15 + 332,12 (288.8 x 1.15) + 198. So it seems that the Scientific Revolution modifier (+15%) is only being applied to the science from cities (Not to the free science or those from RA).
 
Are you sure that's not already included in the 288.8 from cities? I'm relatively certain it's a modifier applied directly to cities, and should be visible in the city view's science tooltip.
 
Are you sure that's not already included in the 288.8 from cities? I'm relatively certain it's a modifier applied directly to cities, and should be visible in the city view's science tooltip.

Yes, I'm completely sure. I've made the same math several turns later in the same game and the numbers match again (it's not a coincidence). Also I've checked it and the 15% modifier doesn't appear in the city view's science tooltip.
 
Thanks for clarifying that. It means that policy does not fit the pattern of other yield modifiers, which is useful information! I'll update the tooltip to show it.
 
Thanks for clarifying that. It means that policy does not fit the pattern of other yield modifiers, which is useful information! I'll update the tooltip to show it.

I've loaded my savegame with the new mod version (v155) and in the science tooltip now appears the science obtained from Policies (image 1). But, as you can see, the numbers don't match: 545 <> 15 + 288.8 + 198 + 82 (= 583.8). They would match if the 15% modifier from Scientific Revolution were being applied only to Science from cities (15% of 288.8 = 43,32 and 545 = 15 + 288.8 + 198 + 43,32). In vanilla (image 4) the science from Scientific Revolution is named in the tooltip "from excess Happiness" and, as you can see, is the 15% of Science from cities (1,219.04 X 0.15 = 182.856). So I think you can reuse Vanilla's code in this case.

After further testing I've seen that the sum of science of all cities in the Economic Overview (image 2) is 202 + 98 + 5 = 305 <> 288.8 (the science from cities in the tooltip)!. The science summary from Paris is on image 3 and it seems to be correct. The game calculates the science for the next turn using 288.8 instead of 305 (I've verified it) so I'm losing some science per turn. I've loaded the savegame again with v154.2 and 288.8 = 202 + 98 + (-12) which matches the Economic Overview (image 5). It seems the change to Viceroy in v155 (only -1:c5science: per :c5citizen:) is being applied only in games started with v155 (not in games from older savegames like v154.2).
 

Attachments

  • science_v155_1.jpg
    science_v155_1.jpg
    59.7 KB · Views: 33
  • science_v155_2.jpg
    science_v155_2.jpg
    80.4 KB · Views: 49
  • science_v155_3.jpg
    science_v155_3.jpg
    57.6 KB · Views: 64
  • vanilla_science.jpg
    vanilla_science.jpg
    25.9 KB · Views: 38
  • science_v154.jpg
    science_v154.jpg
    79.6 KB · Views: 43
I'm a little tired tonight and didn't quite follow your explanations there. Could you rephrase?
I think you can reuse Vanilla's code in this case.
The vanilla code is in the game core only Firaxis has access to. We basically must re-invent the wheel, by guessing and testing to figure out how they did it.
 
I'm a little tired tonight and didn't quite follow your explanations there. Could you rephrase?

The vanilla code is in the game core only Firaxis has access to. We must re-invent the wheel by guessing and testing to figure out how they did it.

Yes, of course!. To summary my post:
  • In v155 the concept "science from Policies" in the tooltip is being calculated as 15% of ("science from cities" + "free science" + "science from RA"). It should be calculated as 15% of "science from cities" only.
  • Games started with v154.2 and loaded with v155 don't apply correctly the change to Viceroy in v155 (-1 :c5science: per :c5citizen: instead of -2 :c5science: per :c5citizen:). New games started with v155 work OK.

About vanilla code, I didn't explained myself very well. I was meaning Lua files of vanilla 's code, not C/C++ files of vanilla's core code. I suppose Lua's code isn't used only as an interface to modding. I think some of the vanilla's game functionality is coded directly in lua, isn't it?.
 
I could make the bonus work as 15% of total science, instead of science from cities. In other words, match the effect to the tooltip, instead of the tooltip to the effect.

The vanilla lua is the visual interface and interface mods. It was designed purely for display purposes, not gameplay. My work uses code intended for the interface, to change gameplay functionality. It's basically hacking. For example, that's why we can't use strategic view or the vanilla "quick combat" option. I use the combat-animation display functions to detect combat, and animations are not active in those circumstances.

I think Firaxis intended to provide gameplay-modding support with core access a few months after vanilla release, but it was delayed until the expansion for unknown reasons.
 
I could make the bonus work as 15% of total science, instead of science from cities. In other words, match the effect to the tooltip, instead of the tooltip to the effect.

The vanilla lua is the visual interface and interface mods. It was designed purely for display purposes, not gameplay. My work uses code intended for the interface to change gameplay functionality. It's basically hacking. That's the reason we can't use strategic view or the vanilla "quick combat" option... the display functions I use to detect combat are not active in those circumstances.

I think Firaxis intended to provide gameplay-modding support with core access a few months after vanilla release, but it was delayed until the expansion for unknown reasons.

About Firaxis releasing the source code I have a theory. As Civ 5 was rushed IMO maybe they are "cleaning" the source code to show it in a "decent shape".
 
Back
Top Bottom