Sign in to follow this  
ThePointingMan

Saveing and loading files

Recommended Posts

Saving and loading is the one thing that just terrifies me, I'm sure it's irrational as it can't be that hard but I don't really know where to start. I've done it before where I read or write to a text file to get information and build a map out of it, but I feel like that is kind of messy... I figured ya'll might be able to give me some insight on this.

At this current moment in time I am working on a program that gives you a 2d grid that you can alter, I want to save the information of each tile and use it in a game I am also working on. Is saving it to a text file really the best answer for me or is there another way?

Share this post


Link to post
Share on other sites

Saving and loading is the one thing that just terrifies me, I'm sure it's irrational as it can't be that hard but I don't really know where to start. I've done it before where I read or write to a text file to get information and build a map out of it, but I feel like that is kind of messy... I figured ya'll might be able to give me some insight on this.

At this current moment in time I am working on a program that gives you a 2d grid that you can alter, I want to save the information of each tile and use it in a game I am also working on. Is saving it to a text file really the best answer for me or is there another way?

 

Loading and saving can be a really horrible thing to deal with on occasion, especially if you try to build the serialization engine at the same time as the data you are trying to load/save.  I would actually suggest you might consider doing this as a two stage process.  Use an existing framework for serialization, I'd probably suggest Boost or Sweet for this as a starting point.  In this way you can avoid most of the issues with the low level serialization portion for a while, get your work done and then deal with serialization separately.  The nice thing about the existing solutions is that they are pretty low impact and won't require a lot of thought/code to make them work so you are not doing much wasted work in order to break up your dev tasks.

 

It's just a thought on how you might simplify your life for a while.. :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this