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

    Jun 8, 2011
    Yes, but at least it is a low hanging fruit. And yes, the variables in the keyed infos will help more.
    Maybe it would be useful to add code that calculates the total memory usage for units, cities and the like and displays it somewhere in the UI.
    To reduce the graphics usage for units there is the dynamic unit entities feature Koshling implemented. But I am not sure if you have that active or if it ever was fully debugged. It tries to replace the graphics entity of all units that are not actually visible by the same dummy entity.
  2. Thunderbrd

    Thunderbrd C2C War Dog

    Jan 2, 2010
    Las Vegas
    Ok, so Koshling setup the Keyed infos and I can't say I fully grasp them yet. Are these an example of a map? Is this where one could use the : operator in the declaration process and reduce things or are you tring to point towards another problem that might exist in this setup?
  3. raxo2222

    raxo2222 Time Traveller

    Jun 10, 2011
    That thing was never enabled.
  4. AIAndy

    AIAndy Chieftain

    Jun 8, 2011
    The keyed info structs are instantiated for every feature (unit combat type, ...) that a unit has to store info about. You can apply anything you can apply to the main unit class to those structs as well. Depending on how often that kind of info is on the unit types or promotions, that can reduce the amount of memory more than on the main unit class.

    Then you should probably try if it works as the amount of memory that might save in large games is huge (we don't know how much as that is part of the graphics engine).
    MattCA and raxo2222 like this.
  5. raxo2222

    raxo2222 Time Traveller

    Jun 10, 2011
    I had some 14 MB save, so I opened it.
    It is Pits map in Medieval era.
    With my BTS INI (there are three options that reduce memory usage) and graphics settings this save takes 2324 MB of RAM.

    With this memory saving option save takes 2300 MB of RAM.
    Option claims, that memory usage climbs slower with it too.

    So it seems like could work, as it acts on visible units.

    My BTS INI, where I bolded memory saving options.
    Spoiler :


    ; Don't show a warning when a video memory allocation fails
    HideOutOfVRamWarning = 0

    ; Allow Mouse Scrolling in Windowed mode
    MouseScrolling = 0

    ; Enable Trilinear Filtering for the Minimap
    MinimapTrilinearFilter = 1

    ; Enable Tree Region Cutting
    CutTrees = 1

    ; A non-zero value overrides the FIELD_OF_VIEW parameter from GlobalDefines.xml

    ; Allow Camera Flying
    AllowFlying = 0

    ; Dont show the game background during movies - may speed up movie playing
    HideMovieBackground = 0

    ; Don't skip frames if falling behind
    BinkNoSkip = 1

    ; Copy entire image each frame, not just dirty pixels
    BinkCopyAll = 1

    ; Show movies using hi-color, not true-color (may be faster)
    Bink16Bit = 0

    ; Copy ever other scanline during movie playback (faster)
    BinkInterlace = 0

    ; Specify whether to play in fullscreen mode 0/1/ask - Full screen must be 0 if you want to tab out with mem saver. Even without mem saver you can minimize game much faster.
    FullScreen = 0

    ; Set max frame rate clamp (0 means none)
    SetMaxFrameRate = 60

    ; Set to 1 to put PitBoss to sleep when no players are connected
    PitBossSleep = 1

    ; Set to 1 to page units out when non-visible
    DynamicUnitPaging = 1

    ; Set to 1 to page unit anims out when the unit is non visible
    DynamicAnimPaging = 1

    ; Set to 1 for no on-screen event messages
    NoEventMessages = 0

    ; Set to 1 for no tech splash screens
    NoTechSplash = 0

    ; Set to 1 for no intro movie
    NoIntroMovie = 1

    ; Set to 1 for no python exception popups
    HidePythonExceptions = 0

    ; The maximum number of autosaves kept in the directory before being deleted.
    MaxAutoSaves = 20

    ; Specify the number of turns between autoSaves. 0 means no autosave.
    AutoSaveInterval = 1

    ; Enable Audio
    AudioEnable = 0

    ; English(0),French(1),German(2),Italian(3),Spanish(4) - Defaults to user-installed language
    Language = 0

    ; Determines which user profile is loaded on game start
    UserProfile = Default Profile

    ; Sync input to smooth interface (may run slower)
    SyncInput = 0

    ; Force numlock always on while playing
    ForceNumlock = 0

    ; Disable caching of file system (may slow initialization)
    DisableFileCaching = 1

    ; Disable caching of xml and file system (may slow initialization)
    DisableCaching = 1

    ; Specify a Mod folder (Mods\Mesopotamia), '0' for none
    Mod = Caveman2Cosmos

    ; Don't show minimum specification warnings
    HideMinSpecWarning = 1

    ; Random seed for map generation, or '0' for default
    MapRandSeed = 0

    ; Random seed for game sync, or '0' for default
    SyncRandSeed = 0

    ; Email address from which Pitboss reminder emails are sent
    PitbossEmail = 0

    ; SMTP server authentication login for Pitboss reminder emails
    PitbossSMTPLogin = 0

    ; SMTP server for Pitboss reminder emails
    PitbossSMTPHost = 0

    ; Number of seconds to accept live game list updates from GameSpy (-1 for initial snapshot only, 0 for no live updates
    GameUpdateTime = 0

    ; Bandwidth options are modem or broadband
    Bandwidth = broadband

    ; QuickStart - SinglePlayer games only!
    QuickStart = 0

    ; Enable/disable background music
    PlayMusic = 0

    ; Allows some memory savings *** ALT-TAB WILL NO LONGER FUNCTION ***
    MemSaver = 1

    ; Use managed interface textures (may be safer but shouldn't be needed, uses more memory)
    GUIManagedTextures = 0

    ; file format (TGA,JPG,BMP), Warning: TGA requires a lockable buffer which can lower performance
    ScreenShot Format = 0

    ; Enable voice over IP capture and playback
    EnableVoice = 0

    ; App Selects Specific IP to use for Multiplayer
    SelectIP = 0

    ; Disable PAK memory mapping (May affect performance), I wonder if that vanilla feature can save memory.
    DisablePAKMemoryMapping = 0


    ; Create a dump file if the application crashes
    GenerateCrashDumps = 1

    ; Enable the logging system
    LoggingEnabled = 1

    ; Enable synchronization logging
    SynchLog = 0

    ; Enable rand event logging
    RandLog = 1

    ; Enable message logging
    MessageLog = 0

    ; Break on memory allocation order #
    BreakOnAlloc = -1

    ; Number of turns to autorun before exit (0 for no limit)
    AutorunTurnLimit = 0

    ; Set App on Auto-Run
    Autorun = 0

    ; Enable D3D9 Queries
    D3D9Query = 0

    ; Custom Screen Height, minimum: 768 - Normal resolutions can be set in-game and will be used when set to 0
    ScreenHeight = 972

    ; Custom Screen Width, minimum: 1024 - Normal resolutions can be set in-game and will be used when set to 0
    ScreenWidth = 1280

    ; Establish connection to Python Debugger
    HAPDebugger = 0

    ; Overwrite old network and message logs
    OverwriteLogs = 1

    ; NetComm Port
    Port = 2056


    ; Modular XML Loading
    ModularLoading = 0

    ; Main Menu Mods
    MainMenuMods = 0

    ; Move along
    CheatCode = chipotle

    ; Map Script file name
    Map = C2C_World

    ; GameType options are singlePlayer/spLoad
    GameType = singlePlayer

    ; Pitboss Turn Time
    PitbossTurnTime = 0

    ; Max number of turns (0 for no turn limit)
    MaxTurns = 0

    ; Game Options
    GameOptions = 010110000000000001000010010011110110000100100100011111011010011000001100000010100001101100011011000101

    ; Victory Conditions
    VictoryConditions = 1100000000

    ; Handicap for quick play
    QuickHandicap = HANDICAP_NOBLE



    SeaLevel = SEALEVEL_LOW



    ; Game Name
    GameName = Civ Simulator

    ; Save Path - relative to working (Civ4) folder
    FileName = 0

    ; Account Username
    Nickname = 0

    ; Email Address
    Email = 0

    ; DirectIP Host Address
    DirectIP = 0

    ; In-game Alias
    Alias = 0

    By the way there is serious memory leak, when I click on random points of map on minimap.
    I'm not sure if this happens because I have chipotle on and have fully visible map with ctrl+z.
    Or leak still may be here but slower without that.
    I uploaded that save.

    As you can see Pit scenario is VERY prone to MAFS.
    This is resource manager screenshot showing memory usage.
    Crash happened at ~2800 MB used.
    Spoiler :

    VRAM MAF.jpg

    Pit is in denial, that his map is too big to play after Medieval era.

    Attached Files:

    Last edited: May 4, 2019
  6. Trantor

    Trantor Chieftain

    Mar 31, 2014
    played a vanilla BTS game today. the speed diffrence between C2C and vanilla BTS becomes ovious then
    vanilla game lost in space race in 6 hours 550 turn
    in BTS, 6 hours will be still in stone age, mainly because the turn takes time .... maybe it is time to think of reducing things and features to speed up the gameplay
  7. alberts2

    alberts2 Chieftain

    Aug 16, 2012
    This is how the memory usage with that save looks here
    With peppers space mod.JPG

    Simply disabling Peppers Space Mod reduces the memory usage by 110 MB!!!
    Without peppers space mod.JPG
    raxo2222 and KaTiON_PT like this.
  8. raxo2222

    raxo2222 Time Traveller

    Jun 10, 2011
    So all XML is actively loaded to RAM regardless of actual use.
    I guess its that because you can look at buildings and units in pedia or tech tree.

    Some buildings and units may have requirements in eras after it is unlocked.
    Achievements and group wonder universities are like this.
    That is modularizing stuff by era would be tricky.
    Or you could modularize religion and culture stuff.
    Or space content itself - all things that are meant to be in space - could be moved to Pepper's module, and Earth stuff could be moved from that module.
    Last edited: May 4, 2019
  9. Pasokon Deacon

    Pasokon Deacon Chieftain

    Apr 27, 2019
    Sea tunnels are fun.

    They're so fun that any threatening land units entering a tunnel plot awaken any naval units set to Sentry (Naval Units) (SVN10563). I experience this most often with land animals which my Industrial-/Atomic-era ships have no way to attack. Is this by design? I don't exactly mind it aside from having to manually reassign my sentries every turn or two.

    Two ways I've done this (using PPIO):
    • Build custom all-in-one production queues via the Build List menu. You open the hammer icon at top-left to get a catalog of potential units or buildings, then manually choose which you can currently or eventually build. This way, you can prepare queues for different contexts: whole eras, cities at different pop sizes (restricting what you can build), specializations, etc. I find this fun to play around with, but not for long since not even PPIO optimizes this menu and its related functions. This is a comprehensive but very slow method at the moment. (An LP on SomethingAwful explains this in greater detail, also mentioning a custom fix to improve Build List filtering for their convenience.(
    • With each tech upgrade or bonus resource gain within a city plot, you can set up a queue in one city, save it (Ctrl+0 up to 9), and then apply that preset queue in all other city screens. I use this as much as possible for two reasons: it's faster than Build List (until that's optimized), and there's no function AFAIK to disable audiovisual production-complete pop-up icons (right-hand side of window, consequent order vertically) at the start of turns which waste time.
    Last edited: May 4, 2019
  10. KaTiON_PT

    KaTiON_PT Warlord

    Jan 2, 2010
    We could also cut on the amount of units (like the cultural ones), but that goes against C2C philosophy of more is better. :mischief:
    MattCA and raxo2222 like this.
  11. Thunderbrd

    Thunderbrd C2C War Dog

    Jan 2, 2010
    Las Vegas
    Modularizing each culture would be a sane move that could help.

    Modularizing all things space map required would also be very good.
  12. Dancing Hoskuld

    Dancing Hoskuld Warlord

    Jul 5, 2004
    Canberra, Australia
    Remember all art is loaded by the exe before the XML is read to decide which modules are on or off. Therefore putting stuff in modules will not reduce the memory usage from that source. I know you are not talking about graphics here but it is something to remember. Mods with lots of unique graphics are very slow to load because of this. Sword_of_Giddon's mod has this problem and I have thought that in this sort of case a pre-processing step that asks which modules you want and then puts those folders in to the mod or deletes them may be an idea.
  13. MattCA

    MattCA Chieftain

    Jan 25, 2019
    during init I wonder if its possible to get the game to read a part of a saved game to get the current era and maybe some options, or whatever
    then load (or maybe unload) xml modules based on what's needed.

    I know anything I do to speed up/improve the game will not have a big enough effect to notice. that doesn't bother me, I have fun trying.
    Ill definetly take a good look at those keyedInfos. Seems strange to me that a unit would have more then 1. That's good to know.

    here's what I did for that first idea. No good for saved game compatability right?
    all I can think of to keep compatibility would be to use m_iBlitzCount as the temp name and make a new name for the variable. Which im not going to do.
        int iTempBlitzCount = m_iBlitzCount;
        WRAPPER_WRITE(wrapper, "CvUnit", iTempBlitzCount);
        int iTempBlitzCount = 0;
        WRAPPER_READ(wrapper, "CvUnit", &iTempBlitzCount);
        if (iTempBlitzCount > 0)
  14. pepper2000

    pepper2000 Chieftain

    Apr 14, 2013
    Thanks for running that test; it is an eye-opening result. I would guess that artwork is the biggest factor there, though I'm not sure how much the files on hard disk are expanded when loaded into RAM for the game. I haven't counted, but I would guess that my mod has ~20% of all the game's buildings if loaded.

    Does it make a difference if all images are separate files or if they are packed? We do the latter for stuff in the core. If it matters, then my thousands of separate image files would have a disproportionate impact.

    When I get a chance, I will do some experiments to see where the biggest costs are.
  15. Thunderbrd

    Thunderbrd C2C War Dog

    Jan 2, 2010
    Las Vegas
    You CAN put the art, outside the FPK, in the module, and have the art references call to the path that leads through the module itself. Thereby making the art modular as well. I believe that would work since the module isn't even loaded if it's not activated.
    Interesting concept but likely to cause problems wihere one player is in a given era and another is not. The exe is not likely to appreciate efforts in this direction either and could create some mysterious crashes for all your hard work in setting this up.

    I suspect packed would be a little less memory heavy and faster accessible. Enough to notice any difference? Possibly not.
  16. Dancing Hoskuld

    Dancing Hoskuld Warlord

    Jul 5, 2004
    Canberra, Australia
    From my testing it still loads all the art even from the modules that are turned off and that is before it reads the art defines XML. In fact it loads the art before the load screen is activated and before it says it is loading any XML.
  17. JosEPh_II

    JosEPh_II TBS WarLord

    Jun 20, 2007
    Western IL. cornfields
    This is because the original Modifiers on buildings were NOT % Modifiers but rather simple integer Modifiers. IE Yields ( +/-) vs YieldModifiers ( % ) for example in most cases (but not all). It was Insisted upon that that these simple integer modifiers must be %Modifiers. The reasoning being that later game the integer method would not be enough. All the while knowing that % Modifiers Can be and Will Be Abused. The Mod has reaped what it's Modders have sown.

    Now raxxo with these latest changes do I need to start all my testing over again? Every time the base values are changed that the results are off/invalid on ongoing games. Making the current games results worthless.

    Let me now when you're done so I can get back to rebalancing.

    And as for the late game "May fix or delay research overflows in cities in very late game.", how do you even know it will do this? As I stated before All of pepper's Civics are Unknowns in what they will do. I will wager that almost all of them are Extremely OP in their current state. And as such I have Not gotten to them ( and a lot of that is because I can't get past the Ancient Era before More Base Modifiers are changed.)

    So when you are Finally done with changing these base modifiers, Please let me know, and I will then Restart the Rebalancing of the Civics again from the start. Because I hate spitting into the wind. :p
  18. raxo2222

    raxo2222 Time Traveller

    Jun 10, 2011
    So those were rarely used in vanilla game.
    I think best thing would be move to per pop :food::hammers::commerce::gold::science::culture::espionage::gp: adjustments for most of buildings, but that would be huge project.
    Then civics, traits and property pseudobuildings would never lose their strength when it comes to those things - their impact is proportionally smaller on better developed cities now.

    Well cumulative :science: modifier reduction could be comparable to what civics provide pretty soon in game, so I guess you need to stat over.

    Because I had save with that issue - he was in Transhuman era and his capital has overflow error after he built one more building with :science: modifier.
    This issue disappeared after I halved all :science: modifiers in buildings.
    I loaded someone else save, who reached end of tech tree, and there were no city research overflows.
    In his game research rate dropped by ~30%
    By the way you can mouseover over later civic icons - some stuff may be cut off in civic screen display.
    You could choose Duel map for fast generation and Future era to just look at those civics.
    So those civics are well known in what they do, unless you meant unknown for you.

    I think I'm done with those, as only :gold::science: modifiers required attention.
    Thuderbrd took care of :food: by adjusting food mechanics, :hammers: modifiers are tricky - too little and you can't keep up with buildings, too much :hammers: and you speed up research/gold/culture/espionage production as you don't have buildings that you want to build anymore and there is no need to make units in some of cities.
    :commerce: modifiers look balanced in all games.

    :culture::espionage::gp: overproduction is least consequental.

    Just that :gold: overproduction devalued gold, and :science: speeded up game, so calendar was easily outpaced.
    Last edited: May 5, 2019
    KaTiON_PT likes this.
  19. AIAndy

    AIAndy Chieftain

    Jun 8, 2011
    It is quite possible that DynamicUnitPaging does not work properly with Koshling's implementation on the DLL side. At least they seem to try similar things which might conflict.

    I would recommend writing yourself a new variant of the WRAPPER_READ and WRITE macros that do this for you without causing the naming issue.
    Something like this (untested):
    #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; }
    raxo2222 likes this.
  20. raxo2222

    raxo2222 Time Traveller

    Jun 10, 2011
    Without that INI setting save takes 2324 MB RAM as if this INI setting was required for that feature to work.
    This is same save that I tested earlier.

Share This Page