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 roguelike game, and for any object/thing that is not
Im working on a small project which has a textarea and i need help
Iam working on small booking room system. In my solution I have a Reservation
Im working on a small application to try out an idea that I have.
When working on small projects or some test classes , I would prefer to
I am working on small web application for iPad Safari. I have to display
Currently I am working on small application in asp.net mvc. It is a some
I currently have a small working JS gallery (onmouseover). The code is below. What
We have service that's working with small to large sets of data (document generation),
Working on a small web application, I have a user table in which user

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.