Questions tagged [serialization]

conversion of program state into a storeable format

Filter by
Sorted by
Tagged with
0
votes
0answers
19 views

How to annotate a BinaryFormatter packet with a header describing its length?

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 ...
0
votes
1answer
29 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 ...
0
votes
0answers
27 views

XML Serializer deleting player files

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 ...
2
votes
1answer
63 views

Component instance reference in Unreal Engine 4

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

Saving Complex Data to File Javascript

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 ...
-1
votes
1answer
49 views

Serializing game information over TCP connection

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 ...
1
vote
1answer
58 views

Serializing nested ScriptableObjects with runtime changes

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 ...
0
votes
1answer
69 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 ...
0
votes
0answers
10 views

How to update an old save path with new collection type?

I'm having a problem with the saving in my game. I have a serialized class called Save. I have just recently updated the script and after testing have figured out the cause. Before i updated the ...
0
votes
1answer
44 views

Unity editing List via Editor Script

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 ...
0
votes
1answer
94 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 ...
0
votes
0answers
84 views

How can I uniquely identify a GameObject in Unity?

I'm trying to serialize and deserialize my custom classes with Unity. I've got an ISerialize interface that mandates the class can ...
1
vote
1answer
182 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":[{},{},{},{},{},{},{},{},{},{},{}]}... ...
1
vote
1answer
175 views

How to reference nameof private serialized field in unity custom inspector

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 [...
1
vote
3answers
2k views

ScriptableObjects lose references/stored objects upon build/restarting the Unity Editor?

I'm working on implementing room prefabs for my 2D procedural map generation algorithm. Basically I made a tool which parses a scene's monsters, items, etc into an ObjectContainer prefab, and into ...
1
vote
1answer
95 views

Saving and loading a GameObject's full state easily in Unity3D?

I'm working on placing predesigned tilemap rooms in my procedural dungeons, and I would like to design the items' and monsters' placement in these special rooms as well. Currently I "compile" my ...
1
vote
0answers
160 views

How would I go about serializing my LibGDX game?

I am currently using Kryo for serialization. I have a Player class, but it extends Sprite. Sprite isn't serializable. This means I can't serialize Player as a whole. Is there another way to do this? ...
0
votes
1answer
246 views

Fast Serialization for Multiplayer Gaming

I wish to make a Java based multiplayer game. I am learning all about sockets and so forth. I have built a very basic UDP system that serializes an object with all the information about the game state ...
0
votes
1answer
42 views

How to add to a MonoBehavior array from an Editor script in Unity

I've made an editor which makes a list of tags and splits them into two rows of true or false values (selectable by the user). I then compile this list into a dictionary, and each entry is like so: <...
0
votes
0answers
257 views

How does Unity store references to GameObjects in a scene

A Monobehaviour can have references to GameObjects in the same scene, but Prefabs, ScriptableObjects can't reference GameObjects in a scene. While Assets, Objects and serialization covers references ...
0
votes
1answer
2k 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 ...
0
votes
1answer
2k views

Unity JSON parsing Array of Objects problem - error: JSON must represent an object type

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 ...
0
votes
1answer
593 views

(Unity) Serializing Data with Custom Object Stored by Reference

I have a custom class that I serialize/deserialize to/from file(s), and is not guaranteed to be identical each time the game runs (in this example, a language pack. it's possible to fix a typo ...
0
votes
0answers
61 views

How to save Player's progress with variables?

I'm trying to save and load my Player's progress. I have a serialized class named "gamestate". This class contains all of the Player's progress, number of lives, total points, etc. That class also ...
1
vote
2answers
37 views

Update dependent values of Serializable C# classes on Inspector

I have some data types' properties that depend on the input given into other attributes, but I haven't found in the Unity's API an elegant way to update them automagically on the Inspector. As an ...
0
votes
1answer
101 views

Why is there no standard 3d file format that saves models as (collections of) primitives?

I have been looking around for a file format that saves models as a collection of primitives (Boxes, Spheres, Cones, Cylinders, etc.). After some research, I came to the conclusion that pretty much ...
-1
votes
1answer
115 views

Unity3D MonoBehaviour in .dll loses serialized data when dll is updated

I have a MonoBehaviour class in a compiled DLL that I have included in my Unity project. It automatically serializes public field data as expected. However, whenever I update the dll (by overwriting ...
0
votes
1answer
403 views

Serialization/Deserialization Solutions for Loading & Playing Audio Files

I'm creating a music game in unity, and the first issue I encountered was that I had no way to load music into the game from a file. I tried using a WWW to load the mp3 files, but in my research I ...
0
votes
1answer
74 views

Unitys [SerializeField] and parallel inheritance

I have the following: ...
3
votes
0answers
533 views

Making generic type T method as a layer of abstraction for Unty3D's EditorGUI field draw methods

I am making a visual tool for Editor Window on Unity3D, and I am just recently using System.Reflection methods to get class's assembly data, to get information about properties, fields and methods (...
0
votes
2answers
119 views

Unity: Component not being serialized

I have a script like this: public class A: MonoBehaviour { public bool x = false; } ... and a Custom Editor like this: ...
0
votes
2answers
715 views

Still having problems using Json data in Unity

I have the following classes and json file, i thought id followed the documentation exactly but I am clearly wrong. Can anyone see why I get an error just saying : INVALID VALUE in my unity console: ...
1
vote
1answer
9k views

How to create JSON file in notepad that will hold my positional vector3 data for one type of object

I'm trying to get my head around using JSON files to store level data . Specifically in this example is to make my walls. (its a top-down game like pacman). Each wall prefab is a 1x1x1 cube. I just ...
9
votes
2answers
2k views

How to make a field visible (attachable) in the inspector but inaccessible through code (private-like)?

Let's say I have a variable named button of type Button which is of course ...
0
votes
0answers
427 views

Serializing and writing a Dictionary of Vector2 keys and custom class values in Unity

I have tried to create code to serialize a Dictionary of <Vector2, Block>, where Block is a custom serializable class, loosely based off of this guide. I need ...
0
votes
0answers
214 views

Unity - Serializing a single property or UnityEngine.Object reference

When I call new SerializedObject(obj) where 'obj' is a UnityEngine.Object instance, as I understand it this is what it does: Each serializable property of the object is traversed, and its sub-...
0
votes
1answer
60 views

Saving Very Little Data But for Lots of Objects

Imagine 50 instances of one type of object and 25 instances of another. Both types of object needs to remember a simple Boolean or int for their own purposes that can be saved to file and reloaded. ...
1
vote
0answers
356 views

C++ Class to Void Pointer, Data Lost? [closed]

Reaching out yet again for a point in the right direction. Specifically, I am casting a simple struct to a void pointer so it can be sent out on the network, but it is cutting off my second variable ...
1
vote
1answer
463 views

Way to deserialized or load last save state scene with GameObject and other classes instead of storing normal fields via binary format?

I humbly ask for help in order to solve this problem. I successfully take a quick guide to learn more about save and load state of the game. Basically first, I know how to use ...
1
vote
1answer
3k views

Serialize ScriptableObject without creating an asset out of it?

Is it possible to do something like this? ...
1
vote
1answer
1k views

Binary Serialization and Protocol

i found this page Protocols. I'm currently working on a game similar to agario and i find that page is helpful for my game. They using WebSocket for sending game messages which is mine too. But i'm ...
1
vote
1answer
684 views

Vector3 Array serialization ReorderableList

I've been working on a ReorderableList, but it's given me quite the headache. I've come to the point where I want to define a "drawElementCallback" -callback, which looks like this: ...
1
vote
2answers
273 views

Updating an XML Document to Match New Save Data?

The Problem I'm developing a game and using the XmlSerializer to store some user data. While it isn't an immediate problem, I'm trying to conceptualize what would happen if I needed to update Save ...
0
votes
1answer
1k views

Converting to JSON String with JsonUtility.ToJson

I am working on converting and displaying the JSON String with unity. I have done coding for it ...
2
votes
1answer
465 views

Deserializing component array using JSON

I have a collection of serialized components in JSON format: ...
2
votes
1answer
7k views

Unity - How to serialize / show private fields and custom types in Inspector?

By default, Unity only serializes public fields. How can I serialize private fields and custom types to show them in inspector?
1
vote
0answers
281 views

Monogame intermediateSerializer with winforms

I want my xml files to be game ready on save in my winforms. Right now I am trying to serialize a simple object like this and it is accessing the XML file, but not outputting anything. Am I missing ...
1
vote
1answer
577 views

Unable to remove class information in serialized json file using libgdx

I am encountering a problem in serializing an array of objects to json file. Please let me know where I'm making the mistake. Object to be serialized : ...
1
vote
1answer
586 views

How to store level data in a libgdx game if implementing ECS pattern

I am writing a beat'em up like game in Libgdx while following the ECS pattern brought up by ashley. For setting up the stage, I am using TileMap and Tiled. An object layer for collisions, and a tile ...
1
vote
0answers
1k views

Unity - SerializedObject.ApplyModifiedProperties() using relavant property setting method

The problem I have is this. I have an editor script, at the end of OnInspectorGUI() I want to apply all the changes with the serialized object. The simplest way to show my problem is thus: ...