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

Caveman 2 Cosmos (ideas/discussions thread)

Discussion in 'Civ4 - Caveman 2 Cosmos' started by strategyonly, Sep 3, 2010.

  1. AIAndy

    AIAndy Chieftain

    Joined:
    Jun 8, 2011
    Messages:
    3,408
    Do you still get the memory leak with that?
     
  2. raxo2222

    raxo2222 Time Traveller

    Joined:
    Jun 10, 2011
    Messages:
    6,166
    Location:
    Poland
    Yes.

    I'll disable all memory saving measures and check if I still get leak.
    Four things are in vanilla INI, one in BUG settings and one in New Dawn global defines.

    That 14 MB save MAFS instantly when all memory saving measures are disabled.
    Mem saver alone isn't sufficient here too, I'll turn on this Graphic Paging (that one in BUG options) alone.

    Maybe Graphic Paging has memory leak somewhere as if it doesn't unload stuff (or unloads too slowly), that is off focus.

    Looks like other memory saving stuff works, as now save loads and uses 2952 MB RAM (I think its Resource Manager button in Task Manager - Memory tab and Working Memory (actually used by application)).
    Declared RAM usage is 2671 MB RAM used.

    Looks like Graphic Paging has leak somewhere - got regular MAF here at 2835/3138 MB RAM (Declared <displayed in task manager>/Working <displayed in resource manager>).

    Spoiler :

    Civ4BeyondSword 2019-05-05 13-46-04-54.jpg

    I have only 1 GB of Video RAM.

    Now I wonder if I had graphic card with more RAM, then I would probably have bit more wiggle room, as other stuff uses VRAM too.

    I reenabled ENABLE_DYNAMIC_UNIT_ENTITIES in A New Dawn globals.
    Memory usage is down to 2168 MB (declared) and 2343 MB (working).
    It seems like this thing almost obsoletes memory saving INI settings - those still provide small reduction of memory usage.

    Memory leak still is here.

    So Graphic Paging together with Dynamic Unit Entities is extremely effective memory saver, but it is bit leaky.
    INI settings seems to mostly cover same areas but still are useful.

    There is one more option, that can save RAM - SHOW_BUILDINGS_LEVEL
    When set on 2 only defense buildings (walls) will be displayed.
    So with all those mem savers this save takes 2389/2295 MB (declared/working).

    I had graphic settings set on High. Lets see if we can get lower.

    On lowest graphics settings (but kept animations enabled) now game uses 1910/2045 MB of RAM (Declared/Working).

    I'm not sure what values trust more - one listed as declared or as working.
    Task Manager displays Declared RAM usage.

    So there is over GB difference in memory saving between most and least aggressive RAM saving settings in that big save.

    Visually there is not much difference between those two extremes (unless you start using viewports too).
    Although I like cities with SHOW_BUILDINGS_LEVEL of 2 setting, as there is no clutter in cities.

    Even then I got MAF after clicking on minimap for a while.
    Also someone was bit lazy when making flags, because with "Low Resolution Textures" NPCs get player flags.
    By the way enabling "Animations Frozen" messes up unit graphics, that is those options MUST be off.

    With that Pits scenario save takes 1952/2087 (declared/working) MB RAM on load.
     
    Last edited: May 5, 2019
    MattCA likes this.
  3. JosEPh_II

    JosEPh_II TBS WarLord

    Joined:
    Jun 20, 2007
    Messages:
    15,675
    Gender:
    Male
    Location:
    Western IL. cornfields
    Perhaps it was that you needed to adjust the calendar time intervals to match research production instead. You may have done it backwards with your approach. Think about it.
     
  4. JosEPh_II

    JosEPh_II TBS WarLord

    Joined:
    Jun 20, 2007
    Messages:
    15,675
    Gender:
    Male
    Location:
    Western IL. cornfields
    Too bad we did not know or at least adhere to this game design When Sparth added his massive Cultural unit modmod. And then he left us.

    His Modmod should be cleaned up but who can do such a massive job? As it was never truly finished when he took off. And we have now been living with this graphical overload for several years.

    Yes we all Love the diverse Cultural units. And I would bet everyone has their favorite Cultures to acquire. I know I do. But still it was and still is a Massive Graphical load for the Mod. It did and does add greatly to the Save game size and the memory usage while the game runs.

    I Suggest that it needs to be "trimmed" somewhat.
     
    MattCA, KaTiON_PT and raxo2222 like this.
  5. MattCA

    MattCA Chieftain

    Joined:
    Jan 25, 2019
    Messages:
    144
    Gender:
    Male
    Code:
    #define WRAPPER_READ_AS_INT(wrapper,className,name) { static int _idHint; static int _saveSeq = -1; int val; (wrapper).Read(className "::" #name, _idHint, _saveSeq,&val); *name = val; }
    awesome. I figured theres a better way and that's perfect.
     
    Last edited: May 5, 2019
  6. raxo2222

    raxo2222 Time Traveller

    Joined:
    Jun 10, 2011
    Messages:
    6,166
    Location:
    Poland
    Nope, calendar date intervals are good, I calculated them by analyzing tech tree - looked at how many techs are per era and how many you can skip before going to next era.
    I didn't take under account free techs and goody huts (partly mitigated by your changes in civics), TD/WFL/Tech Trading/Brokering, but then again tech leader has least use of this stuff.

    If tech leader researches slightly more than lets say tech per turn on Blitz, then he will research all techs by 1000th turn.
    That is 25% of game - tech leader just should have reached Medieval era.
    50% of game - tech leader should be somewhere in middle of Atomic era.
    75% of game - tech leader should be not too far in Transhuman era.
    This is how average game should look.

    Here is time table that is result of analyzing tech tree.

    For blitz speed just multiply by 10 and round it to nearest integer.
    Era date ranges are in this thread.

    Also that research modifier reduction in buildings fixed overflows in late game (now player must try even harder to cause such overflow in cities).

    If anything Era Infos research cost scaling must be increased - this setting affects everyone.
     
    Last edited: May 5, 2019
  7. raxo2222

    raxo2222 Time Traveller

    Joined:
    Jun 10, 2011
    Messages:
    6,166
    Location:
    Poland
    There are unit/city artstyles too, those use some memory too.

    Some civs are in module but it would be easy change - for example you could replace all their unit/civ artstyles with English ones.
     
    Last edited: May 5, 2019
  8. Thunderbrd

    Thunderbrd C2C War Dog

    Joined:
    Jan 2, 2010
    Messages:
    26,123
    Gender:
    Male
    Location:
    Las Vegas
    Wow... ok. I believe ya, was just putting a theory out there. I guess all art files that can be found in the mod are loaded without any concern for the MLF. Ack.
    You picked up a very inaccurate set of beliefs about this somewhere along the way. When you look at Vanilla, Banks, Forges, Libraries, Universities, any buildings that were meant to magnify whatever the city was producing in yield/commerce terms were all set up with % modifiers. (The term 'modifier' MEANS % in modding lingo, just to clarify). In fact, their modifiers were much stronger than ours in general. Many wonders would give +50% or +100% to a yield or commerce.

    We have more material and it adds up more and thus most individual sources are knocked down some from the original root. We just have a lot coming in, both in bases and modifiers as a whole and some rebalancing to that is needed but to say modifiers have no place is an oversimplification that fails to enable any 'scaling to the city economy' effect. The greater 'abuse' is that with these in place, we've allowed a ton of base +/- adjustment values without much concern for how many sources of them there actually are.

    Yes, there are SOME buildings that are completely ridiculous like the artist's colony (a normal building giving +50% modifier to culture... I know culture isn't the most valuable substance in terms of commerces but that's just waaaaay too much.

    To everything there is a purpose and a proper measurement of it and we're a bit out of whack. That said, there's no design world where it even begins to matter whether buildings can accumulate more than civics or traits. Of course they are going to. Vanilla wasn't at all in any kind of balance proportion there either and they had a ton less buildings than we do.

    Completely agree, except that this is for scaling a base value. It's also something only to tinker with after the next release if it's going to be applied a lot.
    But should still fall into similar progressions as research or gold (speaking of at least the first two.) since commerces should be almost equal in value if everything is setup properly.
     
    KaTiON_PT, raxo2222 and Osk21 like this.
  9. Osk21

    Osk21 Barbarian Killer and Beast Trainer & Solar System!

    Joined:
    May 11, 2006
    Messages:
    159
    Gender:
    Male
    Location:
    Rockford, IL
    This mod just keeps getting better and I still can't figure out how to make a build que and apply it to each city and I would like to put some buildings on a never build list so that they will never come up in the recommended build. Is that possible?
     
  10. Thunderbrd

    Thunderbrd C2C War Dog

    Joined:
    Jan 2, 2010
    Messages:
    26,123
    Gender:
    Male
    Location:
    Las Vegas
    The first is available through the Hammer icon at the top left. Some improvements there may be needed but it does work to make a building list macro and apply it in your build queue.

    The second issue is one I'd like to find some time to work on somewhat soon. You aren't the only one who wants this.
     
  11. JosEPh_II

    JosEPh_II TBS WarLord

    Joined:
    Jun 20, 2007
    Messages:
    15,675
    Gender:
    Male
    Location:
    Western IL. cornfields
    In context of buildings built by Hydro no I do not. You were not here or active during his prolific building phase. So your view over this is distorted at best. You were Not here. You were not a lead modder either during the end time of his prolific modding period. I was there, I was the one that asked why.
     
  12. Thunderbrd

    Thunderbrd C2C War Dog

    Joined:
    Jan 2, 2010
    Messages:
    26,123
    Gender:
    Male
    Location:
    Las Vegas
    I've been here since v10 with a small break of about 6 months soon after. I was not referring as much to what was done here so much as what you were saying about the original game. It HAD strong uses of % modifiers on buildings. Looking at every building that exists in this mod, sure, some may benefit from being reduced some but a lot of buildings that had % mods don't even have them at all now. Like the library, for example. It's not been a magic bullet to try to eliminate them.

    I suppose I'm not looking as much at some of the later game stuff either so maybe that's part of the context.

    I don't mean to be offensive in what I stated. I'm just saying that you are overstating how much this mod uses in % mods vs how much the original game did.
     
  13. Dancing Hoskuld

    Dancing Hoskuld Warlord

    Joined:
    Jul 5, 2004
    Messages:
    23,290
    Gender:
    Male
    Location:
    Canberra, Australia
    Sparth did a huge cleanup of the art before adding his stuff. If I remember correctly he removed about 1Gb of excess art. He then applied those standards to his new stuff also. The excess stuff included art not used and duplicates.

    The duplicates came about because whenever a new unit was made from an old one the animation and shadow stuff was copied but not changed whereas you can just point to the original in the XML and not need it copied in the unit art folder. Unit makers usually only provide the graphics files and no XML at all.
    I have to agree with Joe here. At first Hydro was adding just +yield but with all the buildings he was adding it (gold) was getting out of hand so he unilaterally changed most of his buildings to %yield. There was a huge discussion but no time to discuss every building individually.
     
    raxo2222, JosEPh_II and KaTiON_PT like this.
  14. JosEPh_II

    JosEPh_II TBS WarLord

    Joined:
    Jun 20, 2007
    Messages:
    15,675
    Gender:
    Male
    Location:
    Western IL. cornfields
    Yes he did and it was sorely needed at that time as well. But his Culture Modmod was/is also huge in terms of graphics. And if graphics is the memory hog we are foghting then perhaps we need to rethink the usage of so many Units and unit versions. This is just my opinion.

    And thank you for also remembering how it really was. I appreciate that very much.
     
    KaTiON_PT and MattCA like this.
  15. alberts2

    alberts2 Chieftain

    Joined:
    Aug 16, 2012
    Messages:
    1,940
    Gender:
    Male
    Location:
    Germany
    That is a big memory usage reduction just from changing a few options. Thank's for testing this!
     
    KaTiON_PT, MattCA and raxo2222 like this.
  16. Anq

    Anq Chieftain

    Joined:
    Apr 14, 2019
    Messages:
    351
    Gender:
    Male
    Location:
    Anser (geese) HQ
    I find that in CIV4BonusInfos.xml walrus and sea lion have iPlacementOrder set to -1, and setting an arbitrary value does make C2C_World mapscript place them. What's the recommended value for them? I search for other livestocks and they are mostly 4 or 5, however mammoth is set to 1 and kangaroo 2.

    By the way, Toffer's mapscript does filter out bonuses base on iPlacementOrder value.
    Edit: I see it's based on PM3 and PW2, which already have code dealing with placement order, but these ancestor scripts do place walrus and sea lion.

    Also, how come the kangaroos have minimal latitude of -70 ? Also maximum latitude of 10 makes them really scarce and oftentimes a combo of kangaroo and desert in city vicinity is impossible (for building Aboriginal culture). Max. latitude = 30 would be more reasonable.
    I find the same issue with Kava, which has min. latitude of -30, but otherwise reasonable with max. latitude of 10.

    It doesn't look like negatives are for southern hemisphere.
     
    Last edited: May 6, 2019
  17. raxo2222

    raxo2222 Time Traveller

    Joined:
    Jun 10, 2011
    Messages:
    6,166
    Location:
    Poland
    Even with so aggressive settings you can easily get MAF on @Pit2015 scenario in medieval era when moving on minimap due to memory leak in graphic paging option (that one in BUG settings).
    His map is simply "incompatible" with mod past Medieval era.
    Saving every turn would help to last maybe to Industrial or Atomic era but not much farther.
    Spoiler :




    I was getting one of two flavors as I was testing memory saving stuff.
    You need this setting in vanilla INI to actually see, that you got VRAM MAF and not just CTD.
    Code:
    ; Don't show a warning when a video memory allocation fails
    HideOutOfVRamWarning = 0
    This is why I don't touch his scenario :lol:

    Current biggest scenarios in SVN aren't so MAF prone.
    Biggest space maps essentially have memory load of Large scenario all way to Nanotech era, and shouldn't be more taxing than Gigantic (13000 tiles) maps (Kation's/Snofrus large space maps have 24000 tiles or so).
    That is there is no reason for military units in space, just mostly workers, settlers and explorers flying here and there.
    Space cities also have less buildings than Earth.

    By the way game on startup takes 548 MB of RAM (but task manager says that it uses 454 MB of RAM).
     

    Attached Files:

    Last edited: May 6, 2019
  18. Dancing Hoskuld

    Dancing Hoskuld Warlord

    Joined:
    Jul 5, 2004
    Messages:
    23,290
    Gender:
    Male
    Location:
    Canberra, Australia
    Seals and Walrus are placed in a post map script process because there is no "must be on coast" tag. The code is in CvMapGeneratorUtil.py if I remember correctly. A C2C special post processing section.

    Negative values are the southern hemisphere. There are two types of min/max latitude settings based on another tag. The default BtS use of min/max select the same region both north and south of the equator and uses absolute values. The other lets the region span a segment of the globe. This is so you can have kangaroos from just north of the equator to near(ish) the south pole. The bonus is not limited to desert or any terrain since they occur across all terrains in reality.
     
    Anq likes this.
  19. Anq

    Anq Chieftain

    Joined:
    Apr 14, 2019
    Messages:
    351
    Gender:
    Male
    Location:
    Anser (geese) HQ
    Thank you for pointing me to the post processing script. Quite interesting, and thanks for your coding work there! I use the python console to call CvMapGeneratorUtil.placeC2CBonuses(), and it indeed works. Sea lions appear, some on a one-tile island, and kangaroos are now placed in Australia, even 55 degrees South.

    I can see why @Toffer90 's World script doesn't work now. The post processing call is commented out. It is easy to fix by substituting this to its place:
    Code:
    def afterGeneration():
        CvMapGeneratorUtil.placeC2CBonuses()
    and also check in the beginning lines to replace `import NaturalWonders` with `import CvMapGeneratorUtil`, and it's all done.

    Sorry that I suspected the XML, there's nothing wrong in there.

    PS. It's funny to see in my old game, that many livestock in my lands are replaced with kangaroos! Kangaroos everywhere! :lol: Where are my horses now? :nuke:

    PS.2. Accidentally finds this: Guinea pigs -> Rabbit because not in S. America. But then it does not change again to Kangaroo, like that one in the left. Rabbit -> Kangaroo (Remove rabbits from Oceania)
    @Dancing Hoskuld , should this rabbit survive? :D Need some more python magic.
     

    Attached Files:

    Last edited: May 6, 2019
  20. JosEPh_II

    JosEPh_II TBS WarLord

    Joined:
    Jun 20, 2007
    Messages:
    15,675
    Gender:
    Male
    Location:
    Western IL. cornfields
    Can any Team member point to where the Barb unit production variable is? With Barb World active in a Long Game Speed, Standard size C2C_World map, Immortal Difficulty, the barb cities are producing by turn 41 Multiple Brutes or Stone Throwers per turn. The rate of unit production for the Barbs is way too high. This rate of unit production needs to be reduced by 50 - 75%. No more than 1 unit per turn. Actually no more than 1 unit per every other turn.
     

    Attached Files:

Share This Page