Menu
 

Cache limit

Started by xkcd, July 28, 2008, 08:30PM

Previous topic - Next topic
I have discovered a little something I would like to share, and since this is the Knowledge Base...
Apparentily, the game doesn't save everything the about every map you play (if it did, probably the saved game would be much larger)
My tests have shown a limit of 8 maps in it's memory (may be less, I haven't tested yet).
I will explain with a example: Let's say you are at Sepulcher (Mephisto's realm). You trashed the whole place, opened the weapons cache and killed the enemys that don't respawn. If you left to another map (extract or take a portal) and then immediatily come back, everything will be just as you left.
But if you extract to 8 differents locations and then go back to the Sepulcher, everything will be restored! The enemys will be there, the weapons cache will be back to it's original state. Even the cut scenes will play again!
But a few game relevant information (like skill points, the dead of Blackheart) you still be gone...
This means that the game has a "cache" where it stores information about the maps you visit. This cache has a limit of maps. If you want to save more information about some place, you must use the setGameFlag command in the py scripts.
If you are making a mod, where someone has to go back to areas previosily visited, consider this...

work in x men legends?Can i solved the problem of dropped itens?Do you know about this problem?

After this command....?Do I have add something?

This might be useful for the future of the XMLPC project. If I load "dummy" levels one right after the other I might be able to clear out the cache and prep for a new level. As an example, the game crashes by the time you first visit leave the X-Mansion. To solve this I could simply make a bunch of dummy levels with no characters, no objects, etc. Just a starting script that loads the next level. So when you finish the first mission and get in the X-Jet you see the following happen:

1) a dialog will appear to the player - "NOTICE: The game will now load several levels in succession to clear out the game cache. Please do not exit the game as this is normal. When you see the X-Mansion loadscreen the process is complete."
2) Dummy level 1 is loaded
3) Dummy level 2 is loaded
4) Dummy level 3 is loaded
5) Dummy level 4 is loaded
6) Dummy level 5 is loaded
7) Dummy level 6 is loaded
8) Dummy level 7 is loaded
9) Dummy level 8 is loaded
10) The X-Mansion is loaded

If the game really does cache things based on a number of levels it should clear it out and minimize crashes. I'll have to test it.

Is it always better to save after completing the mission? Or before starting the new mission? This always happens in X-men legends 2. I really want to solve this