5 Replies - 558 Views - Last Post: 26 October 2013 - 01:13 AM Rate Topic: -----

#1 lifeinbinary  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 158
  • Joined: 15-February 11

Saving and loading a game state (Obj-C)

Posted 12 June 2013 - 08:35 PM

Hi, I'm making a world domination board game for ios. This is my first "bigger" game and I was wondering if anyone had any suggestions on how to save and load a game state (all my variables, sprites, etc...) I was thinking something like a snapshot of the whole game allocation byte for byte... is this possible? Or do I have to create a file with my own format and recreate the game (fill my arrays, assign my variable values, load my sprites, etc...) I'm sure there must be a good way to do this... I don't want to reinvent the wheel :)

Is This A Good Question/Topic? 0
  • +

Replies To: Saving and loading a game state (Obj-C)

#2 anonymous26  Icon User is offline

  • D.I.C Lover

Reputation: 0
  • View blog
  • Posts: 3,638
  • Joined: 26-November 10

Re: Saving and loading a game state (Obj-C)

Posted 13 June 2013 - 08:25 AM

Have you looked at XML or JSON? Any C++ solution will do, it doesn't have to be Obj-C.
Was This Post Helpful? 0
  • +
  • -

#3 lifeinbinary  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 158
  • Joined: 15-February 11

Re: Saving and loading a game state (Obj-C)

Posted 13 June 2013 - 11:25 AM

View PostButchDean, on 13 June 2013 - 08:25 AM, said:

Have you looked at XML or JSON? Any C++ solution will do, it doesn't have to be Obj-C.

Could you elaborate on your answer? How would you go about using these methods?
Was This Post Helpful? 0
  • +
  • -

#4 anonymous26  Icon User is offline

  • D.I.C Lover

Reputation: 0
  • View blog
  • Posts: 3,638
  • Joined: 26-November 10

Re: Saving and loading a game state (Obj-C)

Posted 13 June 2013 - 11:27 AM

Check out TinyXML.

You can plug any C++ code directly into an Obj-C project of course.

This post has been edited by ButchDean: 13 June 2013 - 11:28 AM

Was This Post Helpful? 0
  • +
  • -

#5 lifeinbinary  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 158
  • Joined: 15-February 11

Re: Saving and loading a game state (Obj-C)

Posted 13 June 2013 - 11:29 AM

View Postlifeinbinary, on 13 June 2013 - 11:25 AM, said:

View PostButchDean, on 13 June 2013 - 08:25 AM, said:

Have you looked at XML or JSON? Any C++ solution will do, it doesn't have to be Obj-C.

Could you elaborate on your answer? How would you go about using these methods?

I looked it up... do you mean to serialize my GameState class and other classes that need saving? How will this work Cocos2d using sprite frames? Am I over thinking this?
Was This Post Helpful? 0
  • +
  • -

#6 james.malvi  Icon User is offline

  • New D.I.C Head

Reputation: -2
  • View blog
  • Posts: 2
  • Joined: 26-October 13

Re: Saving and loading a game state (Obj-C)

Posted 26 October 2013 - 01:13 AM

View Postlifeinbinary, on 13 June 2013 - 11:25 AM, said:

View PostButchDean, on 13 June 2013 - 08:25 AM, said:

Have you looked at XML or JSON? Any C++ solution will do, it doesn't have to be Obj-C.

Could you elaborate on your answer? How would you go about using these methods?


for better json and xml viewer use this online tool

http://codebeautify.org/view/json
Was This Post Helpful? -1
  • +
  • -

Page 1 of 1