Skip to main content

Questions tagged [serialization]

Serialization is the process of converting a data structure or an object state into a different format for storing or network transmission purposes so that it can be reconstructed later.

2 votes
0 answers
67 views

Best Approach for Storing / Serializing Property Value Animations

Background I'm making a platformer game, in C#, in Monogame. I've got a middling amount of experience with gamedev, having done some mini projects in Unity in the past and deciding I don't like a big ...
Jake Lawrence's user avatar
0 votes
1 answer
64 views

Unity FromJson Utility Not Populating Instance of Class

I've used FromJson in Unity/C# a dozen times, and yet for some reason I cannot figure out why this one's not working. Here's the code that does the parsing: ...
rpatton583's user avatar
1 vote
2 answers
197 views

Persist global shader parameter

I use Shader.SetGlobalVector to modify the behaviour of multiple shaders. I added a MenuItem to change these parameters in ...
Askhento's user avatar
  • 123
0 votes
1 answer
118 views

Newtonsoft.Json JsonConvert.DeserializeObject (Polymorphism)

I'm using JsonConvert.DeserializeObject to deserialize animals from the Animal list, but unfortunately they get deserialized as Animals instead of their derived classes (Cat and Dog). As you can see, ...
Manuel Saraiva's user avatar
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 ...
Volkan AKDAG's user avatar
0 votes
1 answer
189 views

How to save and instantiate game data containing lists of polymorphic types

Let's say I have a class named Entity such as: ...
Trobibot's user avatar
0 votes
1 answer
105 views

How to make non-respawning collectables with a collection counter?

Using Godot 3.1, I've written this script for diamonds that the player collects: ...
Nina Monti's user avatar
0 votes
1 answer
385 views

How to read/edit data compressed in ZXML format for modding the game Chocolatier?

I'm trying to mod the game Chocolatier from 2007. It has two .xml files, but they don't look like conventional XML when I open them in VS Code or Notepad++. Here's a sample of what they look like: ...
user4068's user avatar
1 vote
1 answer
241 views

How to compare a GameObject's component settings to those of the original Prefab

I have a Prefab with a number of Components, such as: Rect Transform Text Mesh Pro Sprite Renderer Box Collider 2D I think Instantiate a GameObject using the Prefab, and configure it. As the ...
kanamekun's user avatar
  • 379
1 vote
2 answers
145 views

Loading game state before first save has occurred (chicken/egg problem)

I've learned that storing and loading game saves is commonly done by serializing runtime data into binary files and then loading in those binary files de-serialized to reconstruct the runtime state ...
Michael Moreno's user avatar
1 vote
1 answer
317 views

How to stream a game world to & from disc while supporting dynamically added objects?

Let's just say you have a massive world that isn't loaded into RAM all the time, and is streamed from the hard drive storage. How would that world be stored on the hard drive? Is it serialised? Let's ...
Zebrafish's user avatar
  • 189
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 ...
EzioMercer's user avatar
1 vote
2 answers
2k views

How to check if a Vector3 or Quaternion are unassigned?

How can I check whether Vector3 and Quaternion are not "null"? I have a saving system and didn't have a vector and ...
stingalimian galimian's user avatar
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
1 vote
1 answer
6k views

Exposing list of interfaces to inspector using Odin

Use case: scriptable objects that contain different algorithms but generate compatible data, which are used randomly in a procedural system. They implement an interface so that the system can give ...
arcadeperfect's user avatar

15 30 50 per page
1
2 3 4 5
9