-1

My problem is serializing you see I saved files before but only one lined text file's I want more advanced files that have a out put like:

[%File version format%]

Player
{
Health:100
MP:17
    Transform
    {
    X:13.91,
    Y:15.36,
    Z:82.68
    Rx:14
    //......and so on
    }
    Inventory
   {
    Weapons(mace[dam:80%])
    Chemicals(liquid nitrogen, chemicals)
   }
}

I've tried so many times probley compiled my program over 31 times for just one thing, and also i will not like to use Json, xml ect.

Cœur
  • 34,719
  • 24
  • 185
  • 251
  • or just post how one would do it here – Christopher Lovell Jul 29 '15 at 21:16
  • there is no standard serialization for c++ , choose your poison. json is cool , google finds : http://stackoverflow.com/questions/3512650/fastest-json-reader-writer-for-c – pm100 Jul 29 '15 at 21:17
  • Here's another link for you: http://stackoverflow.com/questions/12394472/serializing-and-deserializing-json-with-boost – TheSmartWon Jul 29 '15 at 21:17
  • Welcome to StackOverflow. It's helpful to actually have a question for us to answer...what are you wanting to do? What have you tried? – Colin Basnett Jul 29 '15 at 21:18
  • Here's another, better link that offers more options. http://gamedev.stackexchange.com/questions/2269/what-are-good-solutions-for-serialization-in-c – TheSmartWon Jul 29 '15 at 21:19

1 Answers1

1

Happy to hear you are giving c++ a try. For the example file you have, I would checkout YAML.

http://www.yaml.org/start.html

There are quite a few libraries that provide support for it if you don't want to write your own. Some resource to read up on include:

https://code.google.com/p/yaml-cpp/wiki/Tutorial

And the main page on the site hosts a variety of links to various libraries: http://yaml.org/

Chris Britt
  • 1,443
  • 1
  • 17
  • 35
  • 1
    Please do not encourage off-topic questions by answering them. – Lightness Races in Orbit Jul 29 '15 at 21:20
  • @LightnessRacesinOrbit My apologies. Didn't think it was off-topic enough to matter. Would you like me to delete the answer? – Chris Britt Jul 29 '15 at 21:21
  • i have a problem of use other peoples libarys simular to this https://en.wikipedia.org/wiki/Not_invented_here – Christopher Lovell Jul 29 '15 at 21:22
  • @ChristopherLovell I understand that quite well. I actually share that philosophy in a lot of ways. However it still might give you a starting point to look at how you would go about doing it. I actually have written my own configuration system that I use quite frequently, but often times it can also be important to consider using known standards. – Chris Britt Jul 29 '15 at 21:25
  • also ive hand writen over 38 files for mygames to read that use a formatt i was going to use for my game, formatt is my own – Christopher Lovell Jul 29 '15 at 21:26
  • @ChristopherLovell Sounds nice, Id still suggest taking a look at how other people have solved it to see what you like/don't like; and then proceed to write your own library if you wish. Good luck with it :) – Chris Britt Jul 29 '15 at 21:28
  • Ok Thanx i give them all a try and try my best to cope with using them – Christopher Lovell Jul 29 '15 at 21:29