Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
How to save game state??? (Newbie question) — Gideros Forum

How to save game state??? (Newbie question)

bayopbayop Member
edited September 2013 in General questions
I'm working on a game in gideros and I'm currently struggling with how best to save and restore game state. I was wondering if I could use the dataSaver api to save and retreive sprite objects (with physics properties)... I would also want to avoid saving the whole object as I suspect that this might take up a lot of space and be really slow...

Anybody have any clues. I'm trying to test the idea, but my lua is not so good and it's taking a while to do a simple prototype.

Comments

  • Use this https://github.com/ar2rsawseen/dataSaver by @ar2rsawseen

    To Save:
    dataSaver.save("|D|filename", data)
    To Load:
    local t = dataSaver.load("|D|filename")

    Likes: andrecaribe

    Loon Games LinkedIn Facebook Twitter - "Something bit me, gaah!"
    +1 -1 (+1 / -0 )Share on Facebook
  • My question is where or not it works for sprite objects (since they use graphics memory and may be attached to the scene as at the time a save is requested). I'm just trying to find the best/most efficient way to get this done.
  • Might be best if you just save the data you need for individual objects e.g: current position, health etc. Then spawn the object and assign the retrieved values.
    Loon Games LinkedIn Facebook Twitter - "Something bit me, gaah!"
  • Also would dataSaver work for object methods or does just work for data?
  • Thanks aditya...

    that's probably what I was thinking as well...
  • @bayop saving data is possible
    saving objects not possible, but hmm, thats an interesting idea :)
Sign In or Register to comment.