Hello everyone, tell me how and where to store the text data of the game ios, a game with a non-linear plot, everything changes depending on the choice of the player, the game is simple, text. I understand that it is not correct to store everything in the code, tell me what other options are there, thank you.
- I think there may be a lot of options (sql (locally and not), just csv, json, xml, etc.) - Batanichek
|
2 answers
In the light of your previous question, your game will look something like this.
A class that contains information about a single game step:
- step identification number
- text with description
- array consisting of
- response text
- the number of the step to which the player proceeds after selecting this answer
Now it is easiest to write this case either in json (which is easily converted to NSArray / NSDictionary, or saved in a plist file which is converted in the same way.
more complex solutions:
- save the whole thing in coredata (I would not advise)
- store on the server and request only the necessary step (at the same time you can change the content of the game without changing the client code)
|
- In the file handles save
- Realm
- Coredata
|