1. Firaxis celebrates the "Asian American and Pacific Islander Heritage Month", and offers a give-away of a Civ6 anthology copy (5 in total)! For all the details, please check the thread here. .
    Dismiss Notice
  2. Old World has finally been released on GOG and Steam, besides also being available in the Epic store . Come to our Old World forum and discuss with us!
    Dismiss Notice

Production Popup

Discussion in 'Civ4 - Caveman 2 Cosmos' started by billw2015, Aug 9, 2019.

  1. billw2015

    billw2015 King

    Joined:
    Jun 22, 2015
    Messages:
    837
    i.e. The one that appears once the build queue is empty in a city. It might be hidden for some people via the option in BUG.

    This was a bad cause of performance issues even when disabled. This manifested either as a long pause as each production popup was shown at the start of a round, or a pause when entering the city screen when the production popup was disabled.
    It was always generating the list of potential buildings and the top recommendation of the advisors. I'm reasonably sure that the majority of people will never have scrolled down on that view to try and find a building in the massive list it populates it with, especially given how good @Toffer90 made the build menus in the city. Generating this list was a waste of time (and it did take time to make all those tooltips etc.), so I am in the process of replacing the contents of the production popup with something more useful.

    @Toffer90 suggested just the top adviser recommendation, the top 5 units by strength, the best worker and settler units, and the cheapest buildings. I think it's good but I want to modify it slightly to be the top 5 adviser recommendations, top 5 units (these could be recommendations as well, I didn't try that yet), worker and settler. Of course this could be further rarified to make sure that it includes air and sea units for instance.

    So instead of one recommendation and 100 buildings and units in a giant list it will be a focused set that you might actually want to build. This could even lead to that popup being useful a lot of the time!

    Thoughts?

    /edit This is what my WIP version looks like so far.
     
    raxo2222 likes this.
  2. Dancing Hoskuld

    Dancing Hoskuld Deity

    Joined:
    Jul 5, 2004
    Messages:
    23,556
    Gender:
    Male
    Location:
    Canberra, Australia
    The only problem I see with this is that we really need advisors about crime, disease and the other properties as they might be the most urgent to build.
     
  3. TaylorItaly

    TaylorItaly Warlord

    Joined:
    Oct 24, 2016
    Messages:
    288
    Gender:
    Male
    Location:
    Germany
    Is it possible to show crime , disease and teaching in this Popup and then when the correspodent value is in a alarming state , give suitable suggestion?
     
  4. raxo2222

    raxo2222 Time Traveller

    Joined:
    Jun 10, 2011
    Messages:
    9,237
    Location:
    Poland
    It should recommend resource producers, if you don't produce that resource yet, or if you don't have most up to date resource producer.

    So if you don't produce shoes, soap or soda, but those producers are available, then most upgraded version would be shown in this popup.

    Cultural or all world wonder resources can be excluded from that.
     
    Last edited: Aug 9, 2019
  5. billw2015

    billw2015 King

    Joined:
    Jun 22, 2015
    Messages:
    837
    Yeah it would be awesome, however it requires a bit more thought of how to integrate it. My main purpose here is to improve the performance of this popup, and thus I don't want to add more expensive calculation. Currently I believe the AI building scoring optionally has a flag to rank by effects on the (crime/disease etc) properties, but it requires you to say which one you are interested in up front IIRC.

    The building ranking I *think* will take this into account already and value buildings that will provide new resources higher? If not I will see what adding that would look like.
     
    TaylorItaly and raxo2222 like this.
  6. TaylorItaly

    TaylorItaly Warlord

    Joined:
    Oct 24, 2016
    Messages:
    288
    Gender:
    Male
    Location:
    Germany
    I thought the value for crime ,disease , teaching was "written" somewhere in the memory ,so you could just read it ?
    Or is it new calculated everytime you need those values ?
     
  7. billw2015

    billw2015 King

    Joined:
    Jun 22, 2015
    Messages:
    837
    Getting the value isn't the problem, it is evaluating what it means, and how well each building addresses it. Currently it would be very costly to run another evaluation step for each property on all the buildings to rank them JUST by that property. However their effect on properties with respect to the city involved is part of their basic scoring value, it just isn't called out explicitly.
     
    TaylorItaly likes this.
  8. TaylorItaly

    TaylorItaly Warlord

    Joined:
    Oct 24, 2016
    Messages:
    288
    Gender:
    Male
    Location:
    Germany
    Understand.
    Just an idea, nevermind....
     
  9. billw2015

    billw2015 King

    Joined:
    Jun 22, 2015
    Messages:
    837
    No I definitely like the idea, in fact it would have saved me a few times if the popup had called out properties, and it would help remind new players about them. The question is how they should be integrated, not if they should I think. Perhaps I can separately check for properties that are trending in a bad way and call them out. Just need to work out what the equation of "importance" is for them. It has to integrate both the current value of the property, and the change per turn, and be scaled correctly for which ever property class it is.
     
    TaylorItaly likes this.
  10. AIAndy

    AIAndy Deity

    Joined:
    Jun 8, 2011
    Messages:
    3,433
    The AI contains a calculation for the property equilibrium while considering all current constant property sources of the city (I assume though that that code looks at all buildings of the city to do that but it might be cached).
     
    Thunderbrd and billw2015 like this.
  11. Yudishtira

    Yudishtira Spiritual/Creative

    Joined:
    Nov 2, 2012
    Messages:
    2,842
    Location:
    Brisbane
    All property values (and heaps of other things too) are shown in the popup when you mouseover the phrase "Examine City". I realize this only half answers you, but at least this much is already there.
     
    billw2015 likes this.
  12. billw2015

    billw2015 King

    Joined:
    Jun 22, 2015
    Messages:
    837
    Okay I'm going to put my first version of this in this weekend sometime when I merge my branch to trunk
    It shows:
    - the recommended unit by AI (adviser)
    - the top 5 recommended buildings by AI, with the highly recommended ones marked by adviser.
    - the best worker and settler units
    - the top 5 strength units
    - the top 5 project components by turns to build
     
    TaylorItaly, raxo2222 and KaTiON_PT like this.
  13. raxo2222

    raxo2222 Time Traveller

    Joined:
    Jun 10, 2011
    Messages:
    9,237
    Location:
    Poland
    I'm not sure if that one would be ever useful.
    There is less than 30 projects, closer to 20 if you play without space victory.

    They are effectively slightly more expensive wonders.

    There was some code/features written ages ago, that you guys removed, as it never was used.

    Do resource producers get solid boost to value, if resource isn't present in your empire yet?
    Similarly building, that is replacement should get solid boost of value too.
     
  14. billw2015

    billw2015 King

    Joined:
    Jun 22, 2015
    Messages:
    837
    Yeah previously it was showing ALL available projects, I'm just capping it to 5 for future proofing the performance basically. It will never hit that I think, except maybe spaceship parts?
     
    raxo2222 likes this.
  15. raxo2222

    raxo2222 Time Traveller

    Joined:
    Jun 10, 2011
    Messages:
    9,237
    Location:
    Poland
    Space ship parts are far between each other - first one is in Information era and last one is in Transhuman era.
     
  16. Yudishtira

    Yudishtira Spiritual/Creative

    Joined:
    Nov 2, 2012
    Messages:
    2,842
    Location:
    Brisbane
    Will it ever recommend building wealth or research or culture?
     
  17. billw2015

    billw2015 King

    Joined:
    Jun 22, 2015
    Messages:
    837
    Not sure what you are asking wrt to the code/features that were removed?
    The scoring the production popup uses is the same the AI uses, it attempts to factor in everything you can think of. At some point I want to draw up a grid of building considerations vs weights and maybe refactor the code so we can more easily tweak them. At the moment it is a bunch of hard coded additions and multipliers.

    In that case you will not see any difference to the project list from how it was before, the cap is just a safe guard in case in the future someone DOES add 50 projects that can all show up at once. If that happens this cap will stop the performance from suddenly collapsing for production popups.

    If it would have done it before it will still do it now. However these options are always listed at the bottom of the list anyway, as they were before.
    I did *not* change the recommendation logic, I just made is so more recommendations are given than just one for buildings.
     
    TaylorItaly and raxo2222 like this.
  18. raxo2222

    raxo2222 Time Traveller

    Joined:
    Jun 10, 2011
    Messages:
    9,237
    Location:
    Poland
    Someone was doing code cleanup and removed unused features and tags.
     
  19. billw2015

    billw2015 King

    Joined:
    Jun 22, 2015
    Messages:
    837
    I didn't understand in what way this comment related to the rest of the reply. First you said there is only a few projects, next you said some code or features were removed, then you asked a question about what the AI scoring considers. I can't tell what you are trying to say about removed code and features in relation to either of the surrounding points.
     
  20. raxo2222

    raxo2222 Time Traveller

    Joined:
    Jun 10, 2011
    Messages:
    9,237
    Location:
    Poland
    AI scoring considerations was completely separate question.

    As for removed code/features it was because projects won't be performancewise heavy part in production popup display in foreseeable future.
    But already you said, that displaying only max 5 projects in popup is futureproofing just in case anyone added 100 projects to mod.

    That futureproofing reminded me, that someone removed long time unused code, and that's all.
     

Share This Page