If I have an open Paths of Glory game in Vassal on my Windows 11 PC and then I put the PC into Sleep mode, most times when I resume from Sleep and attempt to do something in the Module, it will throw an error, for example I’ll get a message along the lines of “Bad Data in Module: Source: card_cp05.svg Error: Error reading image”
I had a look in the Vassal Error Log in AppData/Roaming/Vassal and all I get is “Bad Data in Module: Source: card_cp05.svg Error: Error reading image”, ie the same message as above (Note: I have enabled “Generate audit trails in errorlog for ‘Bad Data in Module’ errors” in Preferences, General)
I thought this was a problem everyone else has but I found no hits when Googling it and I’ve asked two fellow players and neither of them have experienced this issue. It’s a bit of a pain because sometimes I need a response from my opponent before I can complete my Action Phase and if they’re not answering then I have to leave my PC on, sometimes for hours, hoping I’ll get a response rather than having to re-start the Action Phase again.
Note, this issue may also occur with other Vassal modules, it doesnt always occur and I cant definitively say if it happens with every module I’ve used but it almost always happens with Paths of Glory (across multiple versions of this module). I am currently using 3.7.16 of Vassal and PoG module 10.7.
I think this has to do with VASSAL loosing the “connection” to the .vmod file. I’ve certainly seen similar behaviour when I change a .vmod file while it is opened by VASSAL.
More technically, I think the Java code that does the I/O from the ZIP archive (the .vmod file), does some caching, but when the underlying file is changed, the code does notice it, and the internal state of the code is out of sync with the actual file content.
Note, when VASSAL wants to draw a piece or similar, I think it does not always use a cached image, but will sometimes re-read the image from the ZIP archive.
If the above is correct, then the remaining question is why this happens on a suspend/sleep of your machine. Here, I guess Windows, or perhaps the underlying filesystem, will close some open file handles before suspending, and then try to reinstate them on wake-up. This could cause the Java ZIP code to be out of sync. I guess Windows, or the filesystem, will have a tendency to close file handles to “large” files (Paths of Glory is 72.97 MB.)
The bad news is that there’s probably little to do about it. You should be able to save your current state before suspending, and then recover from that .vsav or .vlog. Perhaps if you do “suspend to RAM” (sleep) rather than “suspend to disk” (hibernate), that could help.
Thanks for the response. Thing that puzzles me is that it doesnt happen to others using the same module - so I got to think about my PC set up - all my files are on a NAS drive, I’m wondering if that might be the issue - if the modules were stored on the drive inside the PC rather than accessible over the local network would that stop the problem?
That sounds very plausible. If your machine is doing I/O over a network, it is very likely that the internal representation of the file gets out of sync.
OK, to circle back on this, I deleted and then re-installed the PoG module in Vassal that I was having problems with - I copied the PoG .vmod file to my local C: drive and opened it from there as part of the re-install. Ever since, and I’ve had the PC in and out of Sleep mode maybe 20 times now, no errors at all.
This has made life so much easier! Good to have found a fix, no more leaving the PC on for hours waiting for an update, hurrah!