Skip to main content
Share Your Experience: Take the 2024 Developer Survey

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`.

Filter by
Sorted by
Tagged with
0 votes
0 answers
40 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 ...
Volkan AKDAG's user avatar
0 votes
0 answers
54 views

Scrolling camera with a tile map stored in JSON and PNG

I'm trying to get a scrolling camera into my SDL2 game and I'd like some advice. The way I'm implementing my map is as follows: I use a tileset to build a map in the Tiled map editor, and I'm ...
Derek Kwon's user avatar
0 votes
1 answer
147 views

Web application for efficient placement of blocks

Task: to develop a function that efficiently places rectangular blocks in rectangular 2D container. The location of the blocks in the container should be as dense as possible in order to rationally ...
Назар Саханда's user avatar
0 votes
0 answers
13 views

Help please I have task Web application for efficient placement of blocks [duplicate]

Task: to develop a function that efficiently places rectangular blocks in rectangular 2D container. The location of the blocks in the container should be as dense as possible in order to rationally ...
Назар Саханда's user avatar
3 votes
1 answer
697 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 ...
evol1102's user avatar
0 votes
0 answers
82 views

Can't start Unity project, none of the scripts load and materials are pink: JSON parse error: The document is empty

I am trying to open a project from a company, the problem is, nobody has this problem except me, so one can replicate it. When i open the project i get the following issues: There seems to be a file ...
Seyren Windsor's user avatar
0 votes
0 answers
66 views

Ideas for how to attach meta data to an arbitrary sprite sheet?

I am currently messing around with monogame and creating some silly sprite based games. One issue I have is when I get sprites for OpenGameArt or any equivalent they are often in spritesheets in a ...
kiooikml's user avatar
  • 101
1 vote
1 answer
612 views

Reading JSON nested objects with JsonUtility

I currently have a JSON file: ...
misaochan's user avatar
  • 185
0 votes
1 answer
782 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 ...
rpatton583's user avatar
0 votes
1 answer
67 views

Persistent save value, event after deleting savefile

Now, I now the title is really obscure, but I have tried to solve the following problem for so long and most of it is integrated into my game so far that I can't just copy & paste it here, so this ...
Felix193's user avatar
0 votes
1 answer
295 views

Problem with JSON ScriptableObject saving using NewtonSoft JSON

I am saving a list of ScriptableObjects in a JSON file using NewtonSoft JSON, the problem being that the following error message is thrown when it tries to save: <...
Felix193's user avatar
0 votes
0 answers
286 views

"rigidbody property has been deprecated" when trying to save ScriptableObject to JSON with NewtonSoft

I am using NewtonSoft Json to save data in my Unity game, but when I try to save something it get this error: ...
Felix193's user avatar
2 votes
1 answer
396 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 ...
Silz's user avatar
  • 37
0 votes
2 answers
930 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 ...
EzioMercer's user avatar
0 votes
0 answers
39 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 ...
Kaeru's user avatar
  • 3
1 vote
1 answer
2k 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 ...
Ivan's user avatar
  • 337
1 vote
0 answers
1k views

Unity: JsonUtility.ToJson() not serializing everything

I'm trying to serialize the state of play of my Unity game (Unity 2021.3.7f1) to JSON using UnityEngine.JsonUtility.ToJson, so that I can persist this state to disk ...
ChrisC's user avatar
  • 116
0 votes
2 answers
179 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 ...
Jack Hail's user avatar
0 votes
1 answer
640 views

JsonUtility deserializes list of strings, but all strings come out empty [closed]

What I have JSON file ...
Arian_ki's user avatar
  • 691
0 votes
1 answer
547 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: ...
Arian_ki's user avatar
  • 691
0 votes
0 answers
232 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 ...
arcadeperfect's user avatar
1 vote
1 answer
638 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 ...
Vivien Lynn's user avatar
0 votes
1 answer
39 views

Equipped weapon does not appear in JSON data

I'm trying to make an RPG style game with equipment using ScriptableObject, but whenever I equip the item, it does not register in my JSON data. Here is the script ...
Dwiky Anderson's user avatar
0 votes
2 answers
1k views

How can I serialize lists to JSON on mobile?

I'm having difficulties serializing lists with the built in JsonUtility. I eventually figured out this just isn't possible with its limited capabilities. As much as I'd like to use Newtonsoft, I ...
Vandel212's user avatar
  • 135
-1 votes
1 answer
501 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 ...
stratos la's user avatar
0 votes
0 answers
67 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 ...
stratos la's user avatar
0 votes
1 answer
190 views

Parse Data on runtime into JSON

I have been trying to work out a subscription form for my game and thanks to you guys here, I came to a solution which works but still needs some changes. The idea is to have an input field in the ...
stratos la's user avatar
0 votes
1 answer
1k views

Deserialize only some fields from a JSON file

I'm trying to parse a very large JSON string in Unity. I do not need all the fields and I can't create a class with all the members. It appears that all examples I have found, including the official ...
mneumann's user avatar
  • 103
0 votes
1 answer
1k views

How to properly format classes for JSON deserialization with JSON.net for Unity?

**UPDATE: This answer has been solved and this post updated to ** I am creating an inventory system and decided to keep a master list of all the items. The goal is to use Newtonsoft's JSON.net to ...
Ian Rosenberg's user avatar
0 votes
0 answers
259 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 ...
BreakSilence's user avatar
0 votes
1 answer
117 views

Minecraft: `foot_size` doesn't work

I'm making an add-on that lets the player step over 1-block high blocks and the foot_size property is exactly what I'm looking for. The documentation says the following: "Sets the number of ...
icebird76's user avatar
  • 101
2 votes
1 answer
476 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 ...
Macmanmatty's user avatar
2 votes
1 answer
2k views

Unity3D - JsonUtility returns empty string

i have the problem that when I convert an instance of highscores through JsonUtility.ToJson the value of my value of it is always {"highscoreEntryList":[{},{},{},{},{},{},{},{},{},{},{}]}... ...
Hypes's user avatar
  • 21
0 votes
0 answers
87 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: ...
DauntlessRob's user avatar
1 vote
1 answer
1k views

JsonUtility is throwing exception when there is \" in the string

The following is my JSON file: ...
AKA's user avatar
  • 111
0 votes
0 answers
74 views

Facing issues trying to Parse JSON in Lua

Problem statement: Need help trying to load a JSON file into a table array in Lua for Corona SDK development. My Objective: Call specific data from JSON file to my application by using key value ...
Kinzoku Battu's user avatar
0 votes
0 answers
65 views

Questions about Jrpg NPC events (Unity C#)

So, I'm trying to wrap my head around something. I've got my basic quest system up and running for my rpg style game. Right now I'm taking a look at NPC events and triggers that as I see it have two ...
user2350585's user avatar
0 votes
2 answers
950 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 ...
Green_qaue's user avatar
  • 1,903
0 votes
1 answer
1k 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 ...
sininen's user avatar
  • 101
0 votes
1 answer
628 views

Get JSON property dynamically in Unity C#?

I'm saving game data into JSON, however basically I can't get property with just string just like in JavaScript. This makes my code to write so many if/switch statements, looks very not clean, hard ...
modernator's user avatar
  • 1,213
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 ...
roseicollis's user avatar
1 vote
1 answer
366 views

unity 3d loading data from json problem

i am trying to practice on loading data from json files my problem is about when i try to load the sprite path from the json file to load the image icon from the floder that contain it, i manged to do ...
Times's user avatar
  • 11
1 vote
1 answer
213 views

How to parse User-defined types from String?

I am trying to save data about various entities in each Level in my game in a JSON file and load it at Runtime(Like a Scene file in Unity). I can save simple stuff like floats and ints and parse them ...
Vignesh Gunasekaran's user avatar
4 votes
6 answers
17k 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 ...
tatmanblue's user avatar
0 votes
2 answers
2k views

Why can't I read this JSON file?

I get an error every time I try to parse this .json file. Here is the error: ...
user3262463's user avatar
1 vote
1 answer
399 views

Godot: does parse_json accept multiple JSON objects?

If I had a JSON file that had multiple objects, can the method read through without some form of exception?
Kennichi Nitta's user avatar
0 votes
1 answer
4k views

Loading a list of items from JSON, all entries are null

(I posted a very similar question here recently and the response I received was helpful. But I have been advised to start a new question, and here it is.) I am developing a Unity game which includes ...
WPWPWP's user avatar
  • 101
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 ...
WPWPWP's user avatar
  • 101
2 votes
1 answer
6k views

Error: "JSON must represent an object type" when parsing array of objects

I'm trying to use Json to hold game dialog in a text asset file. I've tried to make a barebones project to test this and it is failing with the Error Message: ArgumentException: JSON must represent an ...
Big T Larrity's user avatar
1 vote
5 answers
13k views

Parse JSON in Unity

I've this JSON code like below. How do I parse it to the objects on code below? ...
H. Pauwelyn's user avatar