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.

0 votes
1 answer
40 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
116 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
0 answers
18 views

Is there a way to convert assets based on a ScriptableObject to another ScriptableObject type?

Is there a reasonably practical way to convert assets based on a ScriptableObject to another ScriptableObject type (that are not part of the same OOP hierarchy) without breaking references to the ...
Saturn's user avatar
  • 1,753
0 votes
1 answer
102 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
50 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
238 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
167 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
  • 369
1 vote
2 answers
89 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
169 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
980 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
1k 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
0 votes
1 answer
4k 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
1 vote
2 answers
957 views

How should I implement the idea behind this abstract class setup in a Unity-Friendly/Inspector-Usable way?

First up, the name of the question is terrible and I am open to suggestions. For context: I'm still relatively new to C#/Unity and it's hard to ask questions properly when I don't know the terminology....
Disgusting's user avatar
0 votes
0 answers
64 views

Datatype for procedural terrain generator

I'm making a kind of infinite runner style engine. It generates the terrain in chunks each time a milestone is reached, and stores each chunk as a custom class in a list. To minimize overhead, it only ...
arcadeperfect's user avatar

15 30 50 per page
1
2 3 4 5
8