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

Mod load time

Discussion in 'Bugs and Crashes' started by Koshling, Jun 27, 2012.

  1. Thunderbrd

    Thunderbrd C2C War Dog

    Joined:
    Jan 2, 2010
    Messages:
    24,892
    Gender:
    Male
    Location:
    Las Vegas
    Its the _Civ4Config file. In your bts file, you'll see a shortcut to it... double click on that and it'll open it in notepad. Scroll down to where it says:


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

    and change the 0 to a 1. It will improve performance but slow loading a bit. AIAndy is apparently changing some things in regards to this, most of which I'm not understanding fully. My only problem with caching MORE, especially if the mod makes this compulsory, is that from my limited understanding, isn't that going to make it harder for computers with less ram to play at all? I understand I could be completely wrong, but doesn't caching generally mean that we're loading more fixed assumptions into the ram that needs to be held there, limiting ram for other application?
     
  2. ls612

    ls612 Deity Moderator

    Joined:
    Mar 10, 2008
    Messages:
    8,062
    Location:
    America
    The RAM increase should not be an issue, as the Viewports will reduce memory usage by 30-60%.
     
  3. AIAndy

    AIAndy Chieftain

    Joined:
    Jun 8, 2011
    Messages:
    3,392
    No, the information that ends up in the process is the same as what would be read from the XML. It only caches the resulting data in a binary format on disk for faster loading when nothing in the XML has changed.
    That is something that BtS does itself but for some reason it ends up deactivated regardless of the setting of that switch.
     
  4. Thunderbrd

    Thunderbrd C2C War Dog

    Joined:
    Jan 2, 2010
    Messages:
    24,892
    Gender:
    Male
    Location:
    Las Vegas
    So that sounds really good. But I'm wondering then why caching currently causes so many MAFs on weaker computers. Could you offer me some insight on that matter?
     
  5. AIAndy

    AIAndy Chieftain

    Joined:
    Jun 8, 2011
    Messages:
    3,392
    We don't know what exactly Civ is caching in those cases. It can only be some kind of file caching as caching the XML has never been working for C2C.
     
  6. Thunderbrd

    Thunderbrd C2C War Dog

    Joined:
    Jan 2, 2010
    Messages:
    24,892
    Gender:
    Male
    Location:
    Las Vegas
    In other words, the problem is in the core and we don't know but we can resolve it for C2C without worrying about adding further problems then?
     
  7. AIAndy

    AIAndy Chieftain

    Joined:
    Jun 8, 2011
    Messages:
    3,392
    I just write and read my own cache so I have full control over that part. The Civ exe will still do the file caching it does (which probably involves some FPK caching) but it is no more involved in the attempts at XML caching.
     
  8. Thunderbrd

    Thunderbrd C2C War Dog

    Joined:
    Jan 2, 2010
    Messages:
    24,892
    Gender:
    Male
    Location:
    Las Vegas
    Ok. Is there anything I need to keep in mind when creating tags then? I wonder if I'm going to do a merge here soon and get really confused by how you've changed something in regards to this caching stuff.
     
  9. AIAndy

    AIAndy Chieftain

    Joined:
    Jun 8, 2011
    Messages:
    3,392
    Well, the important thing is to add the tags to the serializations in the info classes that have them (the read and write methods that take a stream).
     
  10. Koshling

    Koshling Vorlon

    Joined:
    Apr 11, 2011
    Messages:
    9,254
    Not all are currently I'm pretty sure.
     
  11. AIAndy

    AIAndy Chieftain

    Joined:
    Jun 8, 2011
    Messages:
    3,392
    Probably, but hopefully those will surface fast as bugs when a cached load is done.
     
  12. Koshling

    Koshling Vorlon

    Joined:
    Apr 11, 2011
    Messages:
    9,254
    Very fast in many cases, because I don't think that when I changed the storage of many of the arrays (modifiers etc) to just be a NULL pointer if all elements are default, that I changed the C2C-unused cache serialisation routines, so they will likely just fault. Since that was one of the first things I did on C2C (and therefore Civ) it was well before I understood the serialization, so I just wouldn't have noticed those routines needed changing at the time I suspect.
     
  13. AIAndy

    AIAndy Chieftain

    Joined:
    Jun 8, 2011
    Messages:
    3,392
    Yes, that was one of the major changes I had to make to the serialization routines (halfway through I realized I should have made a macro given just how many occurances of that there are).
     
  14. AIAndy

    AIAndy Chieftain

    Joined:
    Jun 8, 2011
    Messages:
    3,392
    A short update: I am currently testing the caching code and discovered some really weird behaviors in old code like bools that were declared as ints but were used as bools and somehow did not call the int version of the serialization functions but the overloaded bool version. On deserialization on the other hand ...
    Anyway, while it is nearly finished, I won't get to pushing it to the SVN until Sunday or Tuesday evening. And I also want to write some more read and write methods for the info classes that are split to many small module files but do not have them yet.
     
  15. Vokarya

    Vokarya Chieftain

    Joined:
    Mar 25, 2011
    Messages:
    6,062
    Would it help if I merged all of my Wonder files together? I've got three dozen Wonders plus a few units and miscellaneous buildings and I could easily merge them into one set of files. Right now, they are all individual modules.
     
  16. Koshling

    Koshling Vorlon

    Joined:
    Apr 11, 2011
    Messages:
    9,254
    Once aiandy has done the caching it won't matter, so don't worry about the module structure.
     
  17. Dancing Hoskuld

    Dancing Hoskuld Chieftain

    Joined:
    Jul 5, 2004
    Messages:
    22,919
    Gender:
    Male
    Location:
    Canberra, Australia
    With wonders I would leave them in modules for now as people may want to remove some of them when they play. However any which have been around for five versions or so without complaint can be merged into one file. ;)

    I am going to get around to merging all those in my files into core one of these days. They have only been around for 10 versions or more.:D
     
  18. ls612

    ls612 Deity Moderator

    Joined:
    Mar 10, 2008
    Messages:
    8,062
    Location:
    America
    You should have told me this before I merged my 40-some Culture Units into one set of files.:rolleyes:
     
  19. Dancing Hoskuld

    Dancing Hoskuld Chieftain

    Joined:
    Jul 5, 2004
    Messages:
    22,919
    Gender:
    Male
    Location:
    Canberra, Australia
    So what about the stuff which is not cached? And what is it?
     
  20. Koshling

    Koshling Vorlon

    Joined:
    Apr 11, 2011
    Messages:
    9,254
    The only stuff that won't be cached will be the audio and graphics files. It may still be beneficial to consolidate those.
     

Share This Page