Thalassicus / cep-bnw

Civ V Communitas Expansion Pack
32 stars 22 forks source link

YieldLibrary Activation #179

Open stackpoint opened 10 years ago

stackpoint commented 10 years ago

I'm going to start slowly reactivating YieldLibrary functions in hopes of restoring functionality to some CEP features.

There are also a lot of yield bugs that need to be confirmed fixed. Any outstanding issues should be brought up here so they can be troubleshooted and collected here.

GrantSP commented 10 years ago

Fantastic. If it is not too much to ask, can you keep me apprised of your progress as I would really like to learn from this process.

Please! :smiley:

stackpoint commented 10 years ago

This commit should activate city specific yields handled by the mod. This also fixes the golden age modifiers to all the yields (faith/culture/surplus food).

Syncing the CityView.lua yields (tooltip vs window) will be next on the list to address.

GrantSP commented 10 years ago

So we don't need to add YIELD_FAITH into the City_ChangeYieldStored function?

stackpoint commented 10 years ago

It seems to have worked with GA yield modifier (set to 2000% for testing) so I assume that the player:ChangeYieldStored works for it. And I don't think that faith has any secondary effects like culture does.

However, I suspect that faith modifications may need to be added to other parts of the YieldLibrary. But that's something I'll look at as problems crop up.

GrantSP commented 10 years ago

I'll leave you to it and just read up afterward. You don't need me looking over your shoulder every step.

Glad you have re-instated this.

skodkim commented 10 years ago

Thumbs up Stackpoint - can hardly wait to try this out!

\Skodkim

stackpoint commented 10 years ago

This commit should sync the CityView.lua yields up with the city yields from the YieldLibrary.

skodkim commented 10 years ago

Was thinking about looking at the bug below, but before doing so i'd like to hear if you think it will be solved by th yield library changes (in which case i'll wait for your changes):

http://forums.civfanatics.com/showthread.php?t=518620

\Skodkim

stackpoint commented 10 years ago

This is almost definitely a YieldLibrary problem. There is a section of the YieldLibrary that handles local and national happiness that has not been activated yet. However, I do not plan on trying to activate that section of code until I'm sure that all the other yields have been worked out.

However, you are free to look at the YieldLibrary and try to troubleshoot any problems bugs that come up.

skodkim commented 10 years ago

Just tested with New Features build:

I think I saw city yields being off but I dodn't go that deep into this part.

\Skodkim

stackpoint commented 10 years ago

Sistine Chapel should be fixed here: https://github.com/Thalassicus/cep-bnw/commit/d5e5dafe828c002eba8ec91af6fecd92e4c55a6d

stackpoint commented 10 years ago

It's also expected that the top panel and production panels yields will be incorrect until they are updated.

I also identified a problem with the yields from terrain with the YieldLibrary. It seems like the cache doesn't update whenever the worker changes. So if I reassign my workers or get an increase of population, the City View won't update until the turn ends. I'm think about adding an update cache trigger whenever terrain yields change but it'll require more thought.

GrantSP commented 10 years ago

Always thought there was a time difference with some of these components. If it looks like a lot of work don't worry about it. If it only happens every now and then it shouldn't worry too many people.

stackpoint commented 10 years ago

Currently, the following are the triggers that update the yield cache:

LuaEvents.NewPolicy                     .Add(ResetYieldCacheAll)
LuaEvents.NewTech                       .Add(ResetYieldCacheAll)
LuaEvents.PlotChanged                   .Add(ResetYieldCacheAll)
LuaEvents.BuildingConstructed           .Add(ResetYieldCacheAll)
LuaEvents.ActivePlayerTurnEnd_Player    .Add(ResetYieldCacheAll)
GrantSP commented 10 years ago

That's all? Not a lot.

stackpoint commented 10 years ago

This commit should address most of the CityView display problems. I also added an (excessive?) amount of event hooks to reset yields in order to try to solve the caching problem (no 1 turn lag now). I'll try deactivating some of the hooks later to improve performance.

Also the (display) Wat Phra Kaew should be fixed in this release. However, since gold is a global yield, it's won't be corrected until global yields are (fully?) activated.

skodkim commented 10 years ago

Fantastic work Stack - can't wait to try the next release!

\Skodkim

On 9. feb. 2014 15.53.37 CET, stackpointer notifications@github.com wrote:

This commit should address most of the CityView display problems. I also added an (excessive?) amount of event hooks to reset yields in order to try to solve the caching problem (no 1 turn lag now). I'll try deactivating some of the hooks later to improve performance.

Also the (display) Wat Phra Kaew should be fixed in this release. However, since gold is a global yield, it's won't be corrected until global yields are (fully?) activated.


Reply to this email directly or view it on GitHub: https://github.com/Thalassicus/cep-bnw/issues/179#issuecomment-34575839

Sendt fra min Android telefon med K-9 Mail. Undskyld hvis jeg er lidt kortfattet.

stackpoint commented 10 years ago

Hagia Sophia (faith from specialist yields) should be fixed here.

GrantSP commented 10 years ago

I think you should put in for a pay raise. :laughing:

EricB1 commented 10 years ago

Double his pay!

skodkim commented 10 years ago

Well, here's a couple of virtul :beers: since I can't give an actual pay rise

:thumbsup:

\Skodkim

Apuity commented 10 years ago

I was eager to play with a fixed Hagia Sophia, I followed stackpoint's changes in several YieldLibrary files. I believe I followed the changes closely. I am reporting this because I wish to have this bug fixed, but it is totally possible that I misused stackpoint's changes.

What I observed was that each specialist is given +2 faith in the specialist slot tooltip in the city screen. (why +2, I don't know...) This +2 faith is not added to the "total faith produced in the city" within the city screen. When you mouseover the "Total faith in city", you can see +2 Faith from specialists in the breakdown tooltip. But this +2 is not added to the total number. Taking away specialists from the city removes the +2 Faith from the breakdown tooltip, but it does not alter the number shown in "Total faith in city".

Faith from specialists in "Total faith in empire" does not include faith from specialists.

stackpoint commented 10 years ago

Thanks for reporting this. Did you build the project from the new-features branch?

skodkim commented 10 years ago

Just tested Hagia Sofia and Sistine Chapel with a build from New Features. My conclusion is that the Sistine Chapel works while the Hagia Sofia doesn't.

Hagia Sofia

Sistine Chapel

\Skodkim

stackpoint commented 10 years ago

Are you sure you weren't getting the Faith yields? I just tested a new build of new features and it seems to work. What specialist slot were you using?

skodkim commented 10 years ago

I'm confident I didn't get faith from specialists. Tested with Engineers and Scientists, both of which are stated in Building_SpecialistYieldChanges for Hagia Sophia.

\Skodkim

stackpoint commented 10 years ago

Could we get a confirmation for either side? I just checked again for both specialists and I got the faith.

skodkim commented 10 years ago

@GrantSP or @EricB1 Maybe either of you could test?

\Skodkim

GrantSP commented 10 years ago

Starting a test now.

GrantSP commented 10 years ago

I just realized I don't think I have the latest build. Have to wait for me to test this.

stackpoint commented 10 years ago

Latest new-features build.

GrantSP commented 10 years ago

How does the Building_YieldsChangesPerPop table go with the Faith yield? @EricB1 said he noticed no yield from the stele building. Is this too likely a yieldlibrary issue.

stackpoint commented 10 years ago

It is an YieldLibrary issue. I'll test with the new-features build.

GrantSP commented 10 years ago

Excellent. Hopefully the new-features will become stable soon. Good work.

stackpoint commented 10 years ago

It works, at least it does for me.

GrantSP commented 10 years ago

Ok. I haven't yet been running the new-features. I probably should build a version and try it out myself. Still stuck on that damn translation issue. Can't seem to figure out a spreadsheet formula that can handle it. Arrgh.

stackpoint commented 10 years ago

This should be the last of the city yield issues. I'll probably start on the toppanel.lua file next unless other bugs pop up (likely).

skodkim commented 10 years ago

Just tested the Hagia Sophia with a new Features build from today and I'm getting faith from specialists :smile:

What may have confused me during the last test is that:

\Skodkim

stackpoint commented 10 years ago

Yields in the vanilla game are done at the start of the player turn. However, the player start hook that we would use to grant yields is bugged. It does not trigger for all players on turn 1 and does not trigger for AI players on turn 2. This is why we use the player end hook instead.

stackpoint commented 10 years ago

Reactivated the old TopPanel files with the BNW code: https://github.com/Thalassicus/cep-bnw/commit/052ea6962a82e300a58418f596c8bd745e4a2201

However, it is currently buggy and is likely(?) to break compatibility with CSD.

skodkim commented 10 years ago

How do you expect it to break compatibility with CSD?

\Skodkim

stackpoint commented 10 years ago

I believe that CSD adds a resource to the top panel?

skodkim commented 10 years ago

I haven't tried it but you're probably right - paper.

I use a modmod that adds timber. This has worked with the top panel so far. I guess it's not crucial If it doesn't work.

\Skodkkm

On 18. feb. 2014 20.36.08 CET, stackpointer notifications@github.com wrote:

I believe that CSD adds a resource to the top panel?


Reply to this email directly or view it on GitHub: https://github.com/Thalassicus/cep-bnw/issues/179#issuecomment-35423865

Sendt fra min Android telefon med K-9 Mail. Undskyld hvis jeg er lidt kortfattet.

stackpoint commented 10 years ago

Have you been using the activated toppanel.lua file? Have you noticed any bugs other than the double gold?

stackpoint commented 10 years ago

With this commit the top panel should(?) be ready to go live. Please report any errors you may find in this issue. I also believe there may be rounding errors but that will be more difficult to track down.

skodkim commented 10 years ago

Sorry, I should have been more clear in previous post. That was with the released version.

stackpoint commented 10 years ago

So I think I managed to hash out most of the technical issues but the tooltips for the % modifiers still have problems as seen here: http://forums.civfanatics.com/showthread.php?p=13122422#post13122422

Let me know if there are any more display or yield problems.

GrantSP commented 10 years ago

Actually that Railroad display problem isn't in Tooltip code, it is in the YieldLibrary function _CityGetBaseYieldRateModifier.

stackpoint commented 10 years ago

I'm pretty sure it's a tooltip problem since the percentages add up correctly but display additional percentages.

GrantSP commented 10 years ago

Well yes and no. The is actually an assocciated function in YieldLibrary: _CityGetBaseYieldModifierTooltip that lumps all different modifiers into the one TXT_KEY: TXT_KEY_CULTURE_CITY_MOD

If we could somehow break the _CityGetBaseYieldRateModifier or the _CityGetBaseYieldRateModifierTooltip code into showing different modifiers then we could have different TXT_KEYs for them and separate the yield mods.