Results 1 to 1 of 1

Thread: The games cache, is no longer a conundrum?

  1. #1
    xeryx's Avatar Follow the White Rabbit
    Join Date
    Nov 2006
    Location
    Wyoming, Usa
    Posts
    4,337

    Icon4 The games cache, is no longer a conundrum?

    Solving the conundrum of the Medieval 2 game cache; how it affects both modders and players alike.

    First and foremost credit for this procedure goes to MiiKLL. In his frustration he found a way to cure us, of major headaches!! Thank you MiiKLL

    Since he likes to remain behind the scenes and lurk he has been promoted to Sith Master Assassin, to decrease his visibility.

    Introduction:
    The game cache seems to be centralized to the medieval 2 .exe. Everytime you play, it can access it to load good files in place of missing or bad files. This is why all mods use the i/o files first command. This allows the game to first find the mod files and load them into memory, and the cache. Since XAI's inception over 2 years ago, the cache has been a troublesome burden on us and our modding. XML files seem to be particularly succeptable to interference by the cache, however I doubt any files are safe.

    It is our hopes that, the community will listen, and embrace the great ideas that abound from the XAI team and community. We have a lot to offer, and soon we will be releasing XAI 4.0. With many advancements in the code, which will put campaigns and battles where they should have been upon release of Medieval 2. It was all made possible, by defeating the cache.

    How the cache works:
    From what we have determined by repeated tests and detailed logging. We have been able to deduce that the cache is created, upon map.rwm generation. These files are stored, and used by the game as needed.

    Effect to you, the gamer:
    Most gamers have more than one mod installed, sharing the cache. All mods when installed, have you delete the map.rwm file to start fresh. Problem, what if you install new mods and a new cache is created? How will it affect your other mods installed? To be perfectly honest, we cannot forsee all possible problems that could be created, but we do have a recommended solution.

    Greater ramifications to the modder:
    Depending on how detailed the modder gets in the files, and what type of files modded might be very troublesome due to the cache, not to mention if modders have any other mods installed? Have you ever changed something in the game and not seen the results? We feel your pain!

    Essentially what we have found is that, the cache will prevent changes in XML, and other files from being used in the game, because the game is using the cache files instead. Many times the only way to tell is with radical values. When you still do not see an effect, this creates a frustration that leads many to believe their changes cannot affect the game. Many modders just give up.

    In the case of XAI, we are constantly experimenting, rebuilding, and adding in new code with the files. For over two years this cache has troubled us, and for a long time the only way we knew to avoid it's complications was to do re-installs. That sure is not the way we want to spend our time modding!! Just ask MiikLL!

    An event horizon:
    My TWC friends we are going to share with you, the best way to insure all of you have the best gaming experience ever. Each and every mods can be radically different, and we want no cross file usage. For our fellow modder friends, we want to help you, make unimpeded progress, like we have! Making this game "The way it should have been" is our goal! Since it is our last free domain to mod everything in I won't be satisfied until I am fully am immersed in a campaign. In my estimations, we have some limitations, but I feel we can accomplish a great deal more.

    Finally the solution!!
    First I want you to understand, we do not guarantee that this will work 100% of the time, but if you always follow these steps, and enable detailed logging. You will always be able to tell if your files are loaded properly into the cache. The logs do not lie, nor do we this is 100% proof.


    GAMER INSTRUCTIONS: by Achilla
    Step-by-step cache disabling procedure for Med2

    1) Go into the directories of all (read: NO EXCEPTIONS) installed modifications for M2TW (by default: ~\Program Files\SEGA\Medieval II Total War\mods\mod of your choice) and add these lines to the top part of the config (.cfg) files:

    [io]
    file_first = true
    disable_file_cache = true

    2) go into the ~/data/world/maps/base directory and delete the map.rwm file in every mod directory where you've installed XAI ; you'll have to delete this file each time you upgrade your existing XCAI (campaign AI) installation.

    3) Start the game, and start a new campaign or you can load a game. The map.rwm file will be created and load the newest files to memory. Recreating map.rwm takes time! especially when the first campaign is loading ; once the file is recreated no additional loading time will take place.

    4) You are ready to play! Dark Force be with you!

    If you have an older system, or experience too long of slow downs with game play (not initial load times, or map.rwm files) then you need to do these additional steps.

    5) exit out of the game.

    6) Delete the map.rwm file again.

    7) enable the cache in the .cfg file

    [io]
    file_first = true
    disable_file_cache = false

    8) start up the game and go play, your cache is now enabled and using the latest and greatest of the files.

    (If for some reason your caches does not clear, stop at step 4, and reboot your computer and delete the map.rwm file again.)

    It is our recommendation to you guys as players, if you notice changes in game play in a mod. to go though this procedure. You should do this when switching between mods you play, and definitely after installing a new one.
    The reason for this, is because the cache is shared. The generation of the map.rwm file is the key to loading the cache. It must be done!

    (a person could add a line in the launching .bat file to delete the map.rwm file for the mod, to make it easy)

    Example 1: THIS WILL VARY FOR EACH MOD THIS IS ONLY AN EXAMPLE

    Spoiler Alert, click show to read: 
    Code:
    del E:\Games\Strategy\Med2\mods\kingdoms_grand_campaign_mod\data\world\maps\base\map.rwm



    Modder Instructions: By Xeryx

    The same steps apply as above. However, I recommend you enable detailed trace logging. These are helpful for all sorts of troubleshooting! It is VITAL that you do this when you make changes to the files! Clear the cache every single time you boot your changes.

    Here is what my TESTBED KGCM .cfg looks like.

    [io]
    file_first = true
    disable_file_cache = true


    [ai]
    ltgd_logging = true

    [log]
    to=logs/KGCM.system.log.txt
    level = * trace

    file = ai.ltgd logs/XCAI.ai.log.txt
    ;file = game.script.* logs/pkh.script2.log.txt
    ;file = game.script* logs/pkh.script.log.txt
    ;file = game.script logs/pkh.scriptoutput.log.txt

    The blue text is what is needed, the rest is for other troubleshooting. If you need to know ask.

    The detailed logging is very important. Because when you have the cache enabled. It will tell you exactly when and which files have been stored to the cache. When the cache is not enabled, then of course it will tell you that the file is found and loaded. The log look like this.

    example 1: (cache disabled)
    Spoiler Alert, click show to read: 
    Code:
    20:39:11.649 [system.io] [info] exists:   found mods/kingdoms_grand_campaign_mod/data/config_ai_battle.xml (from: E:\Games\Strategy\Med2)
    20:39:11.649 [system.io] [trace] file open,,mods/kingdoms_grand_campaign_mod/data/config_ai_battle.xml,154569
    20:39:11.649 [system.io] [info] open:   found mods/kingdoms_grand_campaign_mod/data/config_ai_battle.xml (from: E:\Games\Strategy\Med2)


    example 2: (cache enabled)
    Spoiler Alert, click show to read: 
    Code:
    20:45:13.912 [system.io] [trace] exists: 68: caching file: mods/kingdoms_grand_campaign_mod/data/battle_config.xml (1264104069)
    20:45:13.912 [system.io] [trace] exists: 69: caching file: mods/kingdoms_grand_campaign_mod/data/blockset (1262126610)
    20:45:13.913 [system.io] [trace] exists: 70: caching file: mods/kingdoms_grand_campaign_mod/data/config_ai_battle.xml (1264145315)


    SPECIAL NOTE 1: Notice the number at the end of the line, in the cached line, after the file name. I would think that would be a checksum. From what I know of checksums, that is used to validate a file. If the file is not valid then it is not used, and pulled from the cache. What we do not know for sure, is what is used to determine the checksum? It maybe file length, format...it is unknown.

    SPECIAL NOTE 2; I recommend removing any compressed files, or duplicate files from your mod directories, as a precaution...not yet tested if the game willl load them or not. Better to be safe than frustrated!

    SPECIAL NOTE 3; Since the logs do not actually tell you where the "cache" file being used, is located, it looks as though there is suppose to be one for each mod, but I have never seen a any file generated, in the mods Packs folder? Maybe it is hidden? So we have to overkill and assume the cache, can be shared.
    Last edited by xeryx; January 29, 2010 at 10:18 PM.
    Proudly patronized by B. Ward Click Sig Logo for Downloads, Click forums here and here
    "Do not try and bend the spoon, that is impossible, instead only try and realize the truth.
    There is no spoon, and you will see, it is not the spoon that bends, only yourself."-The Matrix


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •