Code center > Bugs and fixes
Saving and loading in 2.4
Numsgil:
It seems to me possible that you should be able to read in the mutation details without referencing the string length if your save sim reader is smart enough. Especially since most mutation details are quite regularly syntaxed.
EricL:
I looked at parsing the strings directly. It's quite a bit of work to do it right as different mutation types use different initial strings. What I've done instead isn't as good, but its probably good enough and saves me a lot of time and testing.
Saving sims:
If the length of the mutation details are < 2^15-1, things are the same. The length is stored as an Int, older versions will read the new files just fine.
If the length of the mutation details is >= 2^15-1 then I use a magic length number of 1 (the mutation details will never naturally have length 1) to signal to the read routine that the real length is stored immediatly following as a Long. If an older version trys to read such a file, it should still load, but the mutation details will be lost and everything following in the file for that bot will load incorrectly including the mutation settings. But it will load.
Reading Sims:
If the length is negative, we can assume it's a pre 2.42.4 file with lots of mutations. I read 2^15 -1 bytes of mutation drtails, then bail, skipping the rest of the bot. The sim will load, but as above, some things for that bot will be random valued.
If the length is postive but not 1, could be old or new file, just read that and keep going. All is well.
If the length is 1, its a new file with lots of mutations. Read the actual length as a Long then read the complete Mutation details.
So, in short, new saves preserve all mutation details even if they exceed 2^15-1 bytes. 2.42.4 and forward lets you save and load bot mutation details of any length. New files can be read by older versions, but sims with tons of mutations may load random values for some bots if loaded by older versions. But they will load. No more negative lengths! Old sims saved by older versions with tons of mutations will load in 2.42.4, but some bot values may be random.
Numsgil:
Nice, that was an elusive bug that seemed to pop up from time to time and I could never figure out why.
Evitan:
I get the same problem now. Sim is at 6.8 Million cylces and I can't go any higher without getting "bad or invalid procedure call" when loading.
Maybe an option button while saving a sim to delete mutation history? Interesting for very long evo sims.
Maybe I should buy a better computer....
I'll wait untill the next version to continu the sim.
Numsgil:
I think this has been fixed in 2.42.4
Navigation
[0] Message Index
[*] Previous page
Go to full version