Search Unity

Saving Data

Discussion in 'Getting Started' started by TDDLES, Nov 4, 2019.

  1. TDDLES

    TDDLES

    Joined:
    Nov 1, 2019
    Posts:
    4
    Hi there,

    I am pretty new to using Unity and have come to a problem that I could use some advice with.

    I am trying to make a multiplayer quiz game where people would be able to select "question packs", having some default packs made by me and then later on one day maybe packs made by the community.

    Now the question is... I would love to have these packs in a text format so I can easily add questions in and out, but also keep players from editing my default ones. I looked into Steamworks if they had an option to put these kinds of things to some cloud or something, found the steamworks cloud, but that still seems like its saved on the device.

    I would really love any kind of ideas and opinions.
     
  2. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    Just put the text files that represent your own questions into your project. They will become TextAssets, and accessible to your code as strings. But they'll be compiled into your build in such a way that users can't easily read or change them.

    If you're looking for a format for that data, you might consider GRFON.
     
  3. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    Write your question packs code so it can take both TextAssets and external text files as input. As already mentioned, use TextAssets for the questions you don't want modified. Use the external text files for your community provided or otherwise add on packs.
     
    JoeStrout likes this.
  4. TDDLES

    TDDLES

    Joined:
    Nov 1, 2019
    Posts:
    4
    Thank you so much for the reply, any specific reason for using GRFON instead of JSON for example?
     
  5. TDDLES

    TDDLES

    Joined:
    Nov 1, 2019
    Posts:
    4
    Thank you aswell, will look more into TextAssets.
     
  6. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    The blog post linked above goes into my reasons for it. In (extreme) brief: less syntax, more comments.