-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Better handle loading files (modules, save games) from different platforms and architectures #17
Comments
I thought the modules would be platform independent after they were compiled. What's the current error message? |
I'm guessing this isn't portable..
|
I take that back. I have no idea. I've stared at the serialisation code. |
Incursion seems to dump things from memory by the looks of it. So when it looks to see if the manually written So it probably is the virtual table pointer. |
I just ran into this myself while working on #4. |
Do saves still work across platforms? Because I assume those will break when moving between x86 and x64 if it's a simple memory dump. Might need to be more careful with pointers. |
At the very least I might need to modify the CI to bundle the mod based on the correct platforms. |
The module compilation as you did it is per-debug arch IIRC, so IIRC it should already be. I think we should serialise the architecture in files we save, whether games or modules. they use the same mechanic. At the moment we detect corruption purely because someone decided that checking the deserialised type means something. |
Oh, I see, unless you're building debug for release, you can't be compiling the module for release builds. |
It currently shares the x86 mod, so the x64 build breaks. I've checked and confirmed this. |
Thanks for fixing CI. I've clarified the description and broken it down into some hopefully simple tasks. I don't think this is critical as the two signatures should ensure that corruption is detected. It's just a nice to have that no-one is asking for. |
Another point to consider is tying builds to commits for the purpose of compatibility. We wouldn't want to be in the situation where users compile their own builds from random commits for a given version and give the save files to us. Again this is in no way likely or critical, just a possible ideal. |
The issues with serialization are extensive. It's something I probably could've worked on if I didn't have to work with the compiled module file simultaneously. |
Those would be code maintainability issues though, not user visible problems, right? |
Not being able to open serialized data saved on a different platform is a visible problem. The current implementation is inherently unstable, making any minor change break backwards compatibility. For now users will have to assume that their saves are not forward compatible until further notice. |
I originally leant towards forward compatibility. But players didn't care about it at all. It was something that would have required a huge amount of work and complicated development, so I quickly aligned with the players on this. Not having to deal with this or preserve it makes development a lot simpler. |
We need to give a clean intuitive user experience when a user loads a module or game which is not compatible. Serialised files are already fixed to a given release version and deserialised ones are checked to match. The Incursion serialisation mechanic however writes C++ objects to disk for both module loading/saving and game loading/saving. This memory layout is architecture specific which:
A bad file version gets a displayed "File Version Mismatch" error. A bad platform or architecture should display text along the lines of "File is for another operating system" and so on. Ideally we would revisit the whole mechanic of how these messages are displayed to the user and exceptions passed, and show the expected value and the actual value that is not usable.
This is a non-binding guess at the work involved:
Defines.h
should select appropriate platform and architecture values when compiling.Registry.cpp:fileHeader
should have fields for the platform and architecture.The text was updated successfully, but these errors were encountered: