Skip to content

Better handle loading files (modules, save games) from different platforms and architectures #17

@rmtew

Description

@rmtew

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:

  • Ties the correctness of a compiled module to the Incursion executable that built it.
  • Ties the correctness of a saved game to the Incursion executable that saved it.

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.
  • Modify deserialisation to check file header for correct platform and architecture.
  • Modify serialisation to write identified platform and architecture in file header.
  • Display clear, intuitive, useful messages to the user.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions