Thalassicus / cep-bnw

Civ V Communitas Expansion Pack
32 stars 22 forks source link

Building Modifiers #226

Open ilteroi opened 10 years ago

ilteroi commented 10 years ago

formerly: "incorrect -100% food modifier"

although my empire is happy, a -100% modifier is applied to the surplus food per city. this is with this is with release 3.15.1, never noticed it before.

image

I don't understand the calculation anyway, something seems to be broken here - shouldn't the result be either 0 or 10? can provide savefile on request.

stackpoint commented 10 years ago

Can you try using the fix in this thread and report back: http://forums.civfanatics.com/showthread.php?t=522927

ilteroi commented 10 years ago

thank you for the quick answer ... indeed it's better now, the -100% is gone.

however, there still seem to be some invisible modifiers, it now says 10 surplus, 15 total, with nothing in between.

stackpoint commented 10 years ago

Can you post a screenshot?

stackpoint commented 10 years ago

Also, could you identify the policy/building that is providing the bonus?

ilteroi commented 10 years ago

sorry, i small typo, it's 12.5 total.

image

the 25% bonus is due to the landed elite policy.

stackpoint commented 10 years ago

Okay, thanks for pointing this out. I'm working on fixing the percentage modifiers tooltips. If you notice any other discrepancy please let us know.

GrantSP commented 10 years ago

stackpointer, notice how in our code, as shown in the screenshot, the values are not displayed with decimal places! I'm pretty sure this is this case right across the board, all our values in that panel are ALWAYS whole numbers. Vanilla on the other hand shows the decimal places all the time. Not sure why we need to drop the decimal places and then deal with rounding issues.

stackpoint commented 10 years ago

Are yields stored using doubles/floating points?

GrantSP commented 10 years ago

I guess that depends on which yields and stored where. By that I mean if we store temporary values of the vanilla yields and then perform calculations on them perhaps OUR yields may be wrong. But I believe lua ONLY uses floating points. Programming in lua Chapter 2.3 says as much. I would've thought ALL the lua code, vanilla & modded, would handle the numbers the same.

Is there some other place where these values are stored other than in memory or the database? I don't think so.

stackpoint commented 10 years ago

I was talking about the vanilla yields since you were referencing the vanilla decimal places. Since those values would have to be parsed through the DLL.

GrantSP commented 10 years ago

Why would that matter? If they display correctly in the vanilla code shouldn't the modded code do the same?

stackpoint commented 10 years ago

It matters because if the actual yield stored in vanilla is an integer then we should do the same with our yieldlibrary.

GrantSP commented 10 years ago

I did try and see how they are defined in the DLL code but couldn't see the answer. But, if the vanilla lua code shows them as floating point I can't see how the modded code would show them differently. Where do we store the yield values that could change them. In memory? In a database table?

GrantSP commented 10 years ago

Don't know if this a reason or not but the code that is in YL_Data.xml defines a lot of Yield related stuff in a table called Mission_Yield that has the values as type, variant. However this table appears to be empty in the db. Is it used as a temporary storage?

stackpoint commented 10 years ago

The per turn values are displayed as a floating point but are the total yields (stored) as a floating point too? I don't remember any tooltips indicating it was which is my distinction.

ilteroi commented 10 years ago

i just want to add that in another game, i'm seeing floating point values all right:

image

and for production / science etc the modifiers are shown correctly:

image

GrantSP commented 10 years ago

@ilteroi Thanks for the feedback but not quite the correct information. Where you are seeing values with decimal points is the tooltip panel, I think this is defined in InfoTooltipInclude.lua. The actual panel I was referring to is to the left, the one that lists the yields. I believe this is in CityView.lua and it isn't showing the values as floating point. Using your examples the tooltip shows 14.3 Food and 60.8 Production. In a vanilla game those figures would be displayed as just that in the panel displaying the yields, 14.3 & 60.8.

Thalassicus commented 10 years ago

I suspect the main problem is we don't have all of Civup's improvements activated in our copy of the CityView screen yet. It's missing net happiness for one thing.

It's best to show integers in the left panel because the decimal points clutter the screen with unimportant details. Those details are shown on the hover tip for people who want to know it.

GrantSP commented 10 years ago

I disagree, users are becoming more and more acutely aware of the micro-management details of the game, especially on harder levels. If we only give them integers then they must be rounded and that does create problems with the tally. To use the example above that city has Production at 60.8. If the left panel incorrectly shows 60, and that is done in every city, the totals will be markedly off by a figure approaching the number of cities owned. Just leave the values as they are, the decimal places add a degree of precision that makes the experience somehow more fulfilling. No I am not making this up, being given precise figures gives the user an air of being fully in charge. The less we change the values displayed, the more likelihood of an error free UI.

skodkim commented 10 years ago

I tend to agree with GrantSP here. Using decimals make it easier to manage cities.

It is however not crucial IMHO. What is critical about the whole number display right now is that they seem to be highly unreliable du to the yield library issue https://github.com/Thalassicus/cep-bnw/issues/179

A lot of very nice features are being added these days but I can't help feeling that it's all no good if the underlying mechanics for the game is broken (and the yield library seems to be one of the most important foundations).

I don't mean to rant but I've found CEP unplayable for a long time (seems we're losing people on the forums too, which may of course be related to CiV getting "old news")

\Skodkim