Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3356992
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T02:34:49+00:00 2026-05-18T02:34:49+00:00

Suppose I have a game written in C/C++. For simplicity, I have: struct masterStruct

  • 0

Suppose I have a game written in C/C++. For simplicity, I have:

struct masterStruct
{
       Coords player1;
       Weapon player1;
       Gravity player1;
       ...
};

Suppose this struct contains 1000s of variables that relate to the player. I want to be able to create a “snapshot” of the player’s state at time t = 10s of my game with all of these variables. The snapshot should be saved in a fle.

Now, suppose my hard core developing group decided it is necessary to add a 1001th variable to the structure. Now, my game, expecting there to be 1000 variables fails to load the “snapshot” correctly (because of that last variable).

My question: how do I tackle such a dilemma? Should I create these “snapshots” with version numbers and a handshake between snapshot file and game loader so only approved version files will be loaded?

——————— Side Note:
I am using Lua as the scripting language to parse all of these data which is pretty nice. It’s just reading the variables which is a pain.

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T02:34:50+00:00Added an answer on May 18, 2026 at 2:34 am

    Use a good serialization library with versioning support. Boost.Serialization is a very good library for this sort of thing.

    Of specific interest to you should be this feature (quoted from the docs):

    Independent versioning for each class
    definition. That is, when a class
    definition changed, older files can
    still be imported to the new version
    of the class.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Suppose I have a stringbuilder in C# that does this: StringBuilder sb = new
Suppose I have two applications written in C#. The first is a third party
I have written a simple, working tetris game with each block as an instance
Suppose I have following data in my game. I have developed game in cocos2d.
Suppose I have a flash application; let's say a chess game. The user is
Suppose I have the following tables: CREATE TABLE Game ( GameID INT UNSIGNED NOT
I have this first integration test for a tic tac toe game: [TestClass] public
Suppose you have 2 different ASP.NET applications in IIS. Also, you have some ASCX
Suppose we have a table A: itemid mark 1 5 2 3 and table
Suppose I have the following CSS rule in my page: body { font-family: Calibri,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.