1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

Single Player bugs and crashes v37 plus (SVN) - After the 24th of December 2016

Discussion in 'Bugs and Crashes' started by Dancing Hoskuld, Dec 26, 2016.

  1. JosEPh_II

    JosEPh_II TBS WarLord

    Joined:
    Jun 20, 2007
    Messages:
    16,209
    Gender:
    Male
    Location:
    Western IL. cornfields
    Guess Steam is worse than I expected then. Sorry for your loss of easy functionality.

    And it does hinder the team in trying to diagnose your problems, as most of us, but maybe Toffer , don't use Steam for the Civ games. We all still have our original boxed sets with real CD's in them. But such is the world of Steam nowadays.
     
  2. Shoobs

    Shoobs Prince

    Joined:
    Mar 31, 2010
    Messages:
    498
    When it comes to screenshots, I perfectly understand. Otherwise I've felt no serious differences between Steam and the boxed CDs
     
  3. Thunderbrd

    Thunderbrd C2C War Dog

    Joined:
    Jan 2, 2010
    Messages:
    27,811
    Gender:
    Male
    Location:
    Las Vegas
    @Dancing Hoskuld You spoke about this before. There are some connections to the exe on these functions but that's about it... I cannot see anything that explains how this is supposed to even derive a cost of anything but 0 if not defined as it isn't for these units anywhere in the code or python so I'm really confused. But you said that settler units can't be assigned a cost, right?

    EDIT: Unit costs for settler units are figured a little differently and icost should be set to 0 for them. Looks like there's some interesting factors I was unaware of in that part of the code formula.

    It factors in free buildings when the city is founded by that unit (assigned by a minimum era for the building to be given for free).

    Then an adjustment for advanced starts which I'm not sure how this would pan out exactly:
    iValue += (GC.getDefineINT("ADVANCED_START_CITY_COST") * GC.getGameSpeedInfo(GC.getGameINLINE().getGameSpeedType()).getGrowthPercent()) / 100;

    The truest base cost seems to be next, which is
    Code:
        int iPopulation = GC.getDefineINT("INITIAL_CITY_POPULATION") + GC.getEraInfo(GC.getGameINLINE().getStartEra()).getFreePopulation();
       for (int i = 1; i <= iPopulation; ++i)
       {
           iValue += (getGrowthThreshold(i) * GC.getDefineINT("ADVANCED_START_POPULATION_COST")) / 100;
       }
    Very interesting this... it appears it only goes off start era but I'm thinking it should go off of current era so that units naturally improve based on the era. OR, better yet, perhaps it should be based off of a new tag on the unit rather than anything to do with era. This would really return the purpose of the upgrading units themselves.

    Maybe next cycle...

    As for the costs as they are now? Looks like I have to research the variables here further.
     
    Last edited: Feb 11, 2018
  4. Raledon

    Raledon Warlord

    Joined:
    Aug 15, 2008
    Messages:
    236
    @Shoobs
    Personally, I printscreen and ctrl+v on forums. It works quite well in civfantatics' forum, though you might need to wait a bit to let picture get uploaded to the forum.
     
    raxo2222 likes this.
  5. alberts2

    alberts2 Emperor

    Joined:
    Aug 16, 2012
    Messages:
    1,947
    Gender:
    Male
    Location:
    Germany
    Those units use the bFood tag, so they are produced using food.
     
  6. raxo2222

    raxo2222 Time Traveller

    Joined:
    Jun 10, 2011
    Messages:
    7,634
    Location:
    Poland
    Yeah, they react much more strongly to game speed, than they are supposed to as listed by Joseph.
     
    Last edited: Feb 11, 2018
  7. Septimius

    Septimius Warlord

    Joined:
    Jun 11, 2008
    Messages:
    221
    Location:
    Copenhagen, Denmark
    Steam and such is mostly useless. The best way to screenshot is actually to use the print screen button on your keyboard (or variables on PRNT SCRN). Depending on what system you use, it saves your screenshots locally. Then use an image editing program to cut the unimportant stuff away.

    I basically just googled "take screenshot with win 10" and got the explanation there. Also I had to press the win button and print screen at the same time to take pictures, weird, but there you go.
     
  8. Toffer90

    Toffer90 C2C Modder

    Joined:
    Oct 16, 2011
    Messages:
    7,019
    Location:
    Norway
    If I use the windows screenshot (Prt Sc keyboard key) I only get a picture of the desktop behind a steam game.
    Steam successfully take screenshots in C2C for me, though I don't play the game windowed.
    I've never had any issued alt+tab'ing out of C2C fullscreen.
     
  9. Thunderbrd

    Thunderbrd C2C War Dog

    Joined:
    Jan 2, 2010
    Messages:
    27,811
    Gender:
    Male
    Location:
    Las Vegas
    Well, this proves to be quite complex and tied to other factors in the game intrinsically.
    Code:
      int iPopulation = GC.getDefineINT("INITIAL_CITY_POPULATION") + GC.getEraInfo(GC.getGameINLINE().getStartEra()).getFreePopulation();
       for (int i = 1; i <= iPopulation; ++i)
       {
           iValue += (getGrowthThreshold(i) * GC.getDefineINT("ADVANCED_START_POPULATION_COST")) / 100;
       }
    Looking at the global INITIAL_CITY_POPULATION, it comes up as '1', which I figured it would. Usually the game would start at Prehistoric so with anything before Renaissance being set to a default of 0, then this formula only loops once.

    ADVANCED_START_POPULATION_COST is 100, as suspected, so this equation really only is then determined by getGrowthThreshold(1).

    The following is edited for simplicity of delivery:
    Code:
    int iThreshold;
       iThreshold = (GC.getDefineINT("BASE_CITY_GROWTH_THRESHOLD") + (iPopulation * GC.getDefineINT("CITY_GROWTH_MULTIPLIER")));
    
       iThreshold *= GC.getGameSpeedInfo(GC.getGameINLINE().getGameSpeedType()).getGrowthPercent();
       iThreshold /= 100;
    
       iThreshold *= GC.getEraInfo(getCurrentEra()).getGrowthPercent();
       iThreshold /= 100;
    
       if (!isHuman() && !isNPC())
       {
           iThreshold *= GC.getHandicapInfo(GC.getGameINLINE().getHandicapType()).getAIGrowthPercent();
           iThreshold /= 100;
    
           iThreshold *= std::max(0, ((GC.getHandicapInfo(GC.getGameINLINE().getHandicapType()).getAIPerEraModifier() * getCurrentEra()) + 100));
           iThreshold /= 100;
       }
    
       if (isGoldenAge())
       {
           iThreshold *= (100 + GC.getDefineINT("GOlDEN_AGE_PERCENT_LESS_FOOD_FOR_GROWTH"));
           iThreshold /= 100;
       }
    
       return std::max(1, iThreshold);
    This all ties into not only the settler cost but also the actual growth of cities, so that very interestingly, growth of tall vs wide national expansion development is interconnected and tied to the same balance factors. I never realized that being in a golden age doesn't only make it much faster to grow population in a city if you can reach the next pop during the golden age, but also that it makes it much faster to train the next settler unit. Hmm... that's a strategy note for sure right there.

    I guess all this means, yes, the cost of settlers is intentionally much higher than that of other units around them and is calculated from the same factors that control the growth of a new population. I don't see any clean way to adjust this without messing up population growth rates as well. Maybe its best they ARE so expensive. Certainly helps to make the race to expand a bit tougher and enhances the value of those traits that slash the cost of settler units.

    Another interesting observation in all this. Rax said they react stronger to gamespeed... that's because gamespeed affects BOTH the production cost modifier for training AND the growth rate modifier for determining the base value of the initial population they give as it factors into the automatic determination of base cost for the unit.

    Note that if a settler unit HAS an iCost, it just adds that amount to the base cost in the production cost formula so just means 'extra base cost' in such a case. A unit that can settle is defined by the tag bFound.

    The bFood just means that regardless of the civics the player is on (some of which make ALL units count as if bFood is 1), food is made extra production when this unit is trained, but is rerouted in that city away from growth while the unit is being trained.
     
    Last edited: Feb 11, 2018
    raxo2222 likes this.
  10. Septimius

    Septimius Warlord

    Joined:
    Jun 11, 2008
    Messages:
    221
    Location:
    Copenhagen, Denmark
    Two bug or intended question:

    In my eternity game... So I've at long last got some real metal in my game, iron! And I was looking forward to getting some points out of cutting all that pesky grass and what have you hanging around.

    First question - You don't get any production from cutting "Very tall grass" Bug or intended?

    All these numbers are without mathematics researched.

    You get 26 production from cutting cactus & savannah. Removing jungle/bamboo is 107, forest gets you 160 and ancient forest 294 on plains / 321 in rocky terrain - which apparently means cutting yield is influenced by where it grows...?

    Second question - Are these numbers right for an eternity game? I've had a look at the numbers and considering that you get wasted food easily on nightmare difficulty, I've basically kept all my forests and such, because they're worth so much more in the long run, than cutting them gets me. Even if you spend the bit o' extra food you get (which honestly with waste isn't that much) on engineers or the like.
     
  11. Thunderbrd

    Thunderbrd C2C War Dog

    Joined:
    Jan 2, 2010
    Messages:
    27,811
    Gender:
    Male
    Location:
    Las Vegas
    It's how it's currently setup. It's basically intended. I'm not sure if it's scaling quite right to all factors. I can look at that. It's arguable that before a certain technology, grass probably should give some production, but after a point, do we use tall grass in modern use for any building material?
     
  12. Septimius

    Septimius Warlord

    Joined:
    Jun 11, 2008
    Messages:
    221
    Location:
    Copenhagen, Denmark
    Could you put all that in layman's terms? Am I understanding you correctly that the cost of settlers go up as you expand your empire? So the bigger I get, the more expensive settlers become? And civics influence it.

    I was asking because I'm seeing a massive spike in settler production price since last I built one, before the current updates.

    Just have it upgrade into something useful for biofuel & bio electricity... Doesn't really matter what kind of plant matter it is. These days a lot of the plants growing alongside the German freeways, are "energy fields", i.e. for bio stuff. There's a lot of money in it these days.

    But basically it's more useful to keep the grasses around, than cut them - unless you really want a farm there. Because the thatch cutter gives you production.


    Also IMO "very tall grass" should receive the same remove vegetation bonus as savannah & cactus.

    And the vegetation cutting numbers I mention have always been like that on eternity (at least as long as I've played it).
     
    Last edited: Feb 11, 2018
  13. Thunderbrd

    Thunderbrd C2C War Dog

    Joined:
    Jan 2, 2010
    Messages:
    27,811
    Gender:
    Male
    Location:
    Las Vegas
    Ok, it does scale with gamespeed (iFeatureProductionPercent) but not with difficulty or era. There's a global that fits into the picture there as well, BASE_FEATURE_PRODUCTION_PERCENT(currently set to 67), which is added to the population of the benefiting city * FEATURE_PRODUCTION_PERCENT_MULTIPLIER (currently set to 0 since apparently folks felt that city size should not be a scaling factor even if the code allows it - which I think is a good choice.) There's also another scaling factor if another team's workers did the deed of removing the feature, which adjusts the result by DIFFERENT_TEAM_FEATURE_PRODUCTION_PERCENT (currently 67%). There are also other factors, such as the distance away from the city (closer is better for results) which calculates:
    iProduction -= std::max(0, plotDistance(getX_INLINE(), getY_INLINE(), (*ppCity)->getX_INLINE(), (*ppCity)->getY_INLINE()) - 2) * 5;
    And a player level modifier that adds a modifier from techs but could easily be adapted to also accept a modifier from traits or civics. hmm... ;)

    If we feel the overall results are coming up a little shy for game balance, which I tend to agree, then I'd suggest we raise BASE_FEATURE_PRODUCTION_PERCENT up to 100.

    As for grass... I can see giving it a base of 5. By comparison, right now the lowest is the Savannah which has a base of 10. I don't like how it's all on the build definitions so that it's very easy to have discord between what you get for building a farm over a tile vs, say, just an outright removal. Though I know that the build missions must differ from slash and burn tech (which gives a mission that removes for no benefit) vs what you get later.
     
  14. Noriad2

    Noriad2 Emperor

    Joined:
    Oct 23, 2014
    Messages:
    1,153
    Gender:
    Male
    If you have a regular HD that has been used a lot, you may benefit from defragmenting it.
    https://www.lifewire.com/how-to-defrag-your-computer-3506876
     
  15. raxo2222

    raxo2222 Time Traveller

    Joined:
    Jun 10, 2011
    Messages:
    7,634
    Location:
    Poland
    It appears there is factor of more than 110 between Settler/Duel/Normal and Nightmare/Gigantic/Eternity settings for Settler unit when starting in prehistoric era.
    Productivity factor alone between these pace settings is 1.83*8.25 = 15.1 (max difference between handicaps*sizes).
    Total factor is between most extreme costs for settler is 111.4. So factor related to food is 114.1/15.1 = 7.37.
    Spoiler :



    Interesting how Eternity/Nightmare players have to invest 111x more into settlers than Normal/Settler ones :p

    On settler/normal gigantic map would be covered with cities by end of ancient era (ignoring gold issues here) :lol:
    Nightmare/Eternity still would see empty places by Industrial era just like real world :p
     
    Last edited: Feb 11, 2018
  16. Thunderbrd

    Thunderbrd C2C War Dog

    Joined:
    Jan 2, 2010
    Messages:
    27,811
    Gender:
    Male
    Location:
    Las Vegas
    No, what it's saying is that settler costs are determined automatically by a formula in the code that is based on the cost of what it takes to get a population to grow. The scaling factors for training a unit then also apply, and you may have seen some adjustment to the end results based on that. Growth scaling factors is something I haven't looked at recently so unless something accidental took place there, I am not personally aware of adjustments to growth scale factors that form the underlying basis of the cost of a settler unit.
    Yeah, you know that does give us argumentive basis to give tall grass a production benefit for clearing it. At least some.

    Does anyone disagree that it should at least get a base 5 production when cleared (half a savannah) or even 10?
     
  17. JosEPh_II

    JosEPh_II TBS WarLord

    Joined:
    Jun 20, 2007
    Messages:
    16,209
    Gender:
    Male
    Location:
    Western IL. cornfields
    Defrag and chkdsk, both run every week. Been scheduled for doing that for ages now. Learned that a long time ago when I bought my 1st computer an i486, sx425Mhz, 120MB HD, and 2 Mb of memory. Adding another 2 Mb of ram memory back then in 1996 cost me $200 at Wal-mart. Nearly half of what I paid for the computer. :p
     
    Last edited: Feb 11, 2018
  18. Thunderbrd

    Thunderbrd C2C War Dog

    Joined:
    Jan 2, 2010
    Messages:
    27,811
    Gender:
    Male
    Location:
    Las Vegas
    Even more interesting is how the pedia isn't factoring in iProductionNeeded += getUnitExtraCost(eUnitClass); Which is where the extra automatically calculated cost for a settling unit is begun based on the bFound tag.

    Thus, it looks like the cost displayed on those pedia entries only looks at the unit iCost instead of running it through the actual final cost formula.
     
    raxo2222 likes this.
  19. Septimius

    Septimius Warlord

    Joined:
    Jun 11, 2008
    Messages:
    221
    Location:
    Copenhagen, Denmark

    As for the matter of the settlers, I believe I'm seeing a price spike around double to triple of what it cost around a month ago. Back then an average city could build a settler in 6-8 turns, now my absolutely best city can build them in 12. The rest of them builds them in 14-20 turns.

    All this is obviously not a problem at my current development stage, but back when you first start building settlers, I believe it'll be quite the price hike. It'll probably take you around 40-50 turns to build a settler.

    So I'm pretty sure something has been changed?
     
    Last edited: Feb 11, 2018
  20. raxo2222

    raxo2222 Time Traveller

    Joined:
    Jun 10, 2011
    Messages:
    7,634
    Location:
    Poland
    So it is linear increment?
    Hmmm I'll see how that compares with values, that Joseph posted earlier.
    Edit: Septimus even reported, that for Eternity/nightmare settler costed around 5400.
    Looks like it was typo and you meant
    ProductionNeeded *= getUnitExtraCost(eUnitClass)
    Edit: Or not, something else changes prices of units according to their class
     
    Last edited: Feb 11, 2018

Share This Page