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.

Filter by
Sorted by
Tagged with
2 votes
0 answers
67 views

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
65 views

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
209 views

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
120 views

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

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
192 views

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

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

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
250 views

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

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
324 views

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

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

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

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
1k views

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
69 views

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
0 votes
0 answers
207 views

In my game, which implements the network functionality with Kryonet, I would like to send a class ("MyBox2DComponent") over the network which e.g. contains a field of type Body (Box2D). Of ...
EchtFettigerKeks's user avatar
0 votes
1 answer
207 views

At this point, I don't have any idea of what could the issue be. So, I was trying to make a project wide loading screen. Through an editor window, I assigned the loading scene, which was picked up via ...
YoshGJ's user avatar
  • 535
0 votes
1 answer
236 views

I have UProceduralMeshComponent that I generate in editor from data entered by level designer. Now I need to save it to level file in editor to load it in runtime without generating new mesh again. Is ...
Robotex's user avatar
  • 251
1 vote
1 answer
211 views

I am working on a Unity multiplayer game using mirror, and i separated server- and client-only code using partial classes and preprocessor #if statements based on this answer i found: https://gamedev....
ToltottKaposzta's user avatar
0 votes
1 answer
508 views

One of the advantages that's often brought up when talking about ECS-systems is that they allow a higher degree of flexibility in regards to Data vs Code. Without the limitation of hard-coded types, ...
JensB's user avatar
  • 157
1 vote
1 answer
2k views

I have a class, EnumMap<TEnum,TValue>, for associating each member of an enum type with a value of a given type, since I find myself running into situations ...
crass_sandwich's user avatar
2 votes
1 answer
2k views

I have a list of object references inside a serializable class, like this: ...
RenX's user avatar
  • 707
1 vote
0 answers
2k views

I have a UProperty in struct which is a TArray<UCoverInfo*> where UCoverInfo is inherited from UObject: ...
Robotex's user avatar
  • 251
0 votes
1 answer
690 views

Is there a way to access info about the script that a PropertyAttribute is part of in Unity? In my case: getting the memberInfos of the script: ...
Charly's user avatar
  • 752
1 vote
1 answer
349 views

I am trying to make a text-only dungeon crawler game. The general structure for the game is in place (ie. a 'Level' is a 16x16 grid of 'Rooms'). ...
I_Keep_Trying's user avatar
0 votes
2 answers
1k views

I'm designing a kind of simple open world with ECS. The whole world is too large to be loaded at once, so I load and unload chunks according to player's position. Nothing fancy, pretty much standard ...
Sisyphe's user avatar
  • 66
0 votes
1 answer
287 views

I'm trying to create a complex serialized object with property drawer with assignable GameObject field. I want to make something like Binding. So that you could declare a field in an X Monobehaviour ...
zORg Alex's user avatar
  • 129
0 votes
1 answer
244 views

After setting a field using the editor API, the field gets cleared on Play in Unity. How to fix it? I have a menu item. That menu item sets a field on one of my game objects in scene. After the field ...
qqqqqqq's user avatar
  • 278
0 votes
2 answers
1k views

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 vote
0 answers
528 views

In Unity, I have an Animator on a character. Upon saving/loading the game, I want to preserve the pose and animation state the character is in. However, I can see no way to read/write all the data ...
Weckar E.'s user avatar
  • 842
0 votes
1 answer
2k views

What is the difference between Serializable, and System.Serializable? I'm guessing ...
Shrey Joshi's user avatar
0 votes
1 answer
480 views

I have a ScriptableObject that's already used extensively in my project: ...
Commodore Yournero's user avatar
0 votes
0 answers
887 views

I am working on a set of ScriptableObjects that represent base stats for characters in my game. Think Strength, Speed, Intellect, etc. A whole laundry list of em (about 20 stats). I'd like to later be ...
Weckar E.'s user avatar
  • 842
0 votes
1 answer
3k views

It seems JsonUtility.FromJson does not work for MonoBehaviour classes (and I can't get Newtonsoft to parse strings to Vector3s) Suppose you have a MonoBehaviour ...
ina's user avatar
  • 294
0 votes
0 answers
105 views

I am working on a project that is sending data from pc to tablet via usb, using android adb. To serialize the data, we are using BinaryFormatter. The problem I'm running into is that the client is ...
ethan codes's user avatar
0 votes
1 answer
2k views

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
0 answers
61 views

I've been getting reports from my users that sometimes the game isn't saving. I've recently been provided with the game save files from one of these reports and found all the XML files were completely ...
mr-matt's user avatar
  • 2,779
2 votes
2 answers
3k views

I'm creating a C++ script and I want to get a reference to a component instance. For example, imagine that I want to get the player camera, which is a ...
Daniel Marques's user avatar
0 votes
0 answers
400 views

My game uses lots of complex objects to store game data. (Each block and entity has its own instance of a class) I am trying to create a saving and loading system, where the user can save game ...
Eyesight Technology's user avatar
-1 votes
1 answer
288 views

I'm trying to write a Unity client with C++ game server with TCP socket. When I'm sending game data back and forth with client and server, I'd want to serialize it in someway that can be deserialized ...
James's user avatar
  • 1
3 votes
1 answer
831 views

I was having trouble where Git shows a lot of changes (for my case, about ~3000 diff change since I have many objects in the scene) after saving a scene (.unity file) in Unity, even though there are ...
kkl's user avatar
  • 43
2 votes
1 answer
2k views

I'm making an effort to use ScriptableObjects more in my game architecture, after watching a fantastic Unity Unite talk on the subject. The central idea is to use ScriptableObjects, during runtime, as ...
crass_sandwich's user avatar
0 votes
1 answer
2k views

**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
1 answer
623 views

I am currently working on an editor script for a custom component I created, I am using UIElements to do this, the UI is constructed and working all apart from when I try to modify a list item of the ...
Pheonix2105's user avatar
2 votes
1 answer
614 views

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
1 vote
0 answers
871 views

I'm trying to serialize and deserialize my custom classes with Unity. I've got an ISerialize interface that mandates the class can ...
Chuck's user avatar
  • 249
2 votes
1 answer
2k views

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
3 votes
1 answer
2k views

I'm running into a problem that I think will seriously affect maintainability down the road, so I'd like to figure it out now before it becomes a problem. I've been starting to use private [...
Adam B's user avatar
  • 800