Questions tagged [json]
JSON (JavaScript Object Notation) is a lightweight human-readable data interchange format. It is programming language-independent and many modern programming languages include code to generate and parse JSON-format data. JSON filenames use the extension `.json`.
87 questions
1
vote
1
answer
859
views
Can't deserialize parameters from JSON in LibGDX
I am quite new to JSON and I have been having trouble with this data-driven asset manager (not my code). I have been trying to deserialize parameters for my TmxMapLoader object from JSON. It takes the ...
0
votes
1
answer
173
views
When saving in Json format, some places I want are not saved
I'm making a game in Unity and I'm using json format to save. I have no problem recording it on my computer, but it does not record the animals I catch on my Android phone. How can I solve this? What ...
0
votes
0
answers
45
views
About Json format and Player Prefs [duplicate]
I'm making an Offline RPG game in Unity. I want to save some things in my game. I have heard of two recording systems for this, one is PlayerPrefs and the other is to save in json format. PlayerPrefs ...
3
votes
1
answer
865
views
How to store condition dependent item information in JSON
I'm developing a RPG-game. After searching about various ways to save item information in RPG-game, I determined to save information in JSON files. The problem is that in my game, some equipment's ...
4
votes
6
answers
19k
views
unity JsonUtility.ToJson returns empty string
I am trying to use Unity's built in json serialization. It produces empty string. I do not understand why. (I was trying to use NewtonSoft Json.Net but that wasn't working either even though I was ...
0
votes
1
answer
2k
views
JSON Parse Error - Invalid Value
I'm trying to create a script that parses a JSON file to get information about the levels in my project. I know this technique should work because I have the same code in two other scripts, parsing ...
2
votes
1
answer
784
views
How to store localized text data in Unity?
I need to create a lot of read-only text data. As far as I know storing a lot of data directly in the script is not good, so I need to create a separate json file with ready-made data to load in the ...
0
votes
2
answers
1k
views
Can't serialize plain struct with Nullable fields
I try to save game data in PlayerPrefs as JSON string. I read in documentation that I can use plain struct/class with ...
0
votes
0
answers
53
views
Entity initialization in an online game
How do online games handle creation of new entities? I currently have an EntityFactory class that requires an ID (specifying the entity type). A bunch of subroutines are executed to determine exactly ...
1
vote
1
answer
3k
views
Where should I put a JSON file to be readable in a Unity build?
I have a file which is created manually. In what folder should I put it so I can read it in a build?
For example Application.dataPath in editor reads the file from ...
0
votes
2
answers
210
views
Do a quiz from web api data
i'm new to unity and i want to do a quiz using data coming from a web api
I was able to retreive data from the api but i couldn't make the game logic with them
This is where i arrived
...
0
votes
1
answer
684
views
How to look up items by name in lists loaded from JSON data?
I'm using a JSON file for loading texts and dialogs and here's my JSON file:
...
-1
votes
1
answer
589
views
Deserialization of JSON from Firebase to load data
i was wondering if you could help me with an issue i have with firebase and databases!
I have a class that saves variables into an array. i have managed to send that json file to firebase and i can ...
0
votes
0
answers
351
views
How to save a class full custom property types and their data to disk
Background:
My app is a sandbox with a large number of parameters that I want to be able to easily add / selectively expose to the user, edit during runtime through the game UI or from the Unity ...
1
vote
1
answer
807
views
Unity - How to create a game-save with a preview image?
I want my game-save to be shown with a preview image.
This is often seen in City Builder games: The game-save usually has a name, a date and often also provides a preview of the build city (just a ...
0
votes
0
answers
81
views
Saving JSON to firebase
I want to integrate Firebase to my android/iOS game. So far in production I used JSON to save a class into the devices PersistentDataPath and load them accordingly. I did follow the firebase ...
0
votes
1
answer
4k
views
Trying to load .json questions and answers into a multiple-choice quiz game in Unity [duplicate]
I am developing a Unity game which includes a multiple-choice quiz.
I've placed what I believe is a properly-formatted .json file (the quiz question, four answer choices, the correct answer, and an ...
0
votes
1
answer
2k
views
How to encode a save game / game state as a string?
I'm building an HTML game. For this game I want to implement a save-feature that should work like in some already existing games:
The user can chose export, this ...
0
votes
0
answers
278
views
JSON deserializing 'nested' Array
Greetings!
I'm working on a class that loads and parses .json files and returns information from the loaded .json, but I have problems reading the nested arrays of my .json files.
Turning the ...
2
votes
1
answer
608
views
Json Libgdx serialize / de-serialize a Object Map of Object Maps
Any one have any ideas on how I can serialize / de-serialize an
ObjectMap<Enum, ObjectMap<String, Object>>();
(Object is usually a String Integer ...
1
vote
1
answer
5k
views
Could not find a part of the path "/jar:file:/data/app
I need a hand on this . On Unity Editor this pretty works fine but when i'm building the apk and try to run my Language Changer function it can't find the path . ...
0
votes
0
answers
98
views
How do I add data to a Dictionary after I deserialize the data for the class?
I'm getting a null reference exception on "AddEmpireView()" and I cannot figure it out for the life of me. Here's the class:
...
1
vote
1
answer
1k
views
JsonUtility is throwing exception when there is \" in the string
The following is my JSON file:
...
0
votes
2
answers
1k
views
Unity - Save/load in a sandbox game, how to instantiate saved objects
I have a game where a player can place GameObjects.
I can save/load this GameObjects data with using JSON, for example its position, but I cannot think of a good way to tell my save-file (and my ...
4
votes
2
answers
2k
views
Is there a way to hardcode a JSON file into a Unity build?
I'm currently creating an external tool to generate dialogues that are exported as JSON files.
The idea is that after you create a dialogue (as a JSON), my main Unity project reads that file and ...