Jump to content
  • Advertisement
Sign in to follow this  
Makkedah

Alternative to serialization?

This topic is 4506 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have been using serialization to save and load save states for my game. Now I want to start loading monster, skill, and item data from files, but I am using a different program to create those files. Thus, whenever I try to deserialize these files I get an error. I have really liked serialization until this came along, so it would be great if there was something that I could do make the serialization work. If not, what would be a good alternative that would allow me to do this?

Share this post


Link to post
Share on other sites
Advertisement
I hope this is enough info...

BinaryFormatter *formatter = new BinaryFormatter();
String *filename = S"Monsters.mon";
FileStream *output = new FileStream(filename, FileMode::OpenOrCreate, FileAccess::Write);
formatter->Serialize(output, monstercopylist);
output->Close();

Also, I'm using Visual C++.net 2003.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Write a tool to convert it for you.

You can use the files you have already and just write a tool to convert them after you make them. Reading them into a dummy program with the same class structure then emitting it should do the trick. Or you can have the main program do this instead, and skip that step.

If you have the source code for the programs to make the files you want to read, then edit the source code to have the same structure as the main program (enough so that serialization will be possible) and then spit it out from there.

You should only need the classes that are used in your monster, skill, and item data classes. Not anything that uses them.

Hopefully you made the tool to make those files, in which case it "should" only be a few includes and editing the save feature for the program to serialize.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!