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

  • SEARCH
  • Home
  • 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 563327
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T12:38:54+00:00 2026-05-13T12:38:54+00:00

I am working on a small roguelike game, and need some help with creating

  • 0

I am working on a small roguelike game, and need some help with creating save games. I have tried several ways of saving games, but the load always fails, because I am not exactly sure what is a good way to mark the beginning of different sections for the player, entities, and the map.

What would be a good way of marking the beginning of each section, so that the data can read back reliably without knowing the length of each section?

Edit: The language is C++. It looks like a readable format would be a better shot. Thanks for all the quick replies.

  • 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-13T12:38:54+00:00Added an answer on May 13, 2026 at 12:38 pm

    If you have a marker, you have to guarantee that the pattern doesn’t exist elsewhere in your binary stream. If it does exist, you must use a special escape sequence to differentiate it. The Telnet protocol uses 0xFF to mark special commands that aren’t part of the data stream. Whenever the data stream contains a naturally occurring 0xFF, then it must be replaced by 0xFFFF.

    So you’d use a 2-byte marker to start a new section, like 0xFF01. If your reader sees 0xFF01, it’s a new section. If it sees 0xFFFF, you’d collapse it into a single 0xFF. Naturally you can expand this approach to use any length marker you want.

    (Although my personal preference is a text format (optionally compressed) or a binary format with length bytes instead of markers. I don’t understand how you’re serializing it without knowing when you’re done reading a data structure.)

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

Sidebar

Related Questions

I'm working on a small project to help me tag content on Flickr. I've
We are a company, working on small and some huge project. Sometimes on one
Working on a small web spider in python, using the lxml module I have
I've been quite used to working on small projects which I coded with 1,000
I'm working on a small templating engine, and I'm using DOMDocument to parse the
I am working on a small intranet site for a small company, where user
I am working on a small application in VB.NET. The program needs administrator privilege
I'm working with a small FAT16 filesystem, and I want to generate CRC values
I'm working on a small app where I can generate a list of barcodes.
I'm working in a small company and weeks away from deploying a web-app that

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.