Questions tagged [serialization]

conversion of program state into a storeable format

Filter by
Sorted by
Tagged with
0
votes
0answers
8 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
49 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
95 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
35 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
62 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
549 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
811 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
210 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
56 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
92 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
84 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
219 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
60 views

Unitys [SerializeField] and parallel inheritance

I have the following: ...
2
votes
0answers
444 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
91 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
593 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
7k 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
292 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
182 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
57 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
312 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
353 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
2k views

Serialize ScriptableObject without creating an asset out of it?

Is it possible to do something like this? ...
1
vote
1answer
726 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
597 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
175 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
434 views

Deserializing component array using JSON

I have a collection of serialized components in JSON format: ...
2
votes
1answer
4k 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
266 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
416 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
511 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
953 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: ...
5
votes
3answers
9k views

How can I create a custom PropertyDrawer for my Point struct?

I created a Point struct: [System.Serializable] public struct Point { public int x; public int y; } I am trying to ...
1
vote
1answer
82 views

“Saving…” dialog isn't shown until after the saving is complete

I have implemented serialization/de-serialization process in my Unity game where I save/load data from/to XML file. During the serialization, my game isn't responding until the serialization is ...
0
votes
1answer
79 views

Code vs. Configuration in Unity [closed]

I know a thing or two about Unity at this point, but I've still lots of subjective, best practice questions, Such as: How do you decide what values are obtained via Start/Awake initialization, and ...
1
vote
1answer
638 views

Unity3D - generating a set of rooms (scenes) and saving them

I'm having a problem wrapping my head around scenario like this. Say I've got a scene called Room. Now, my game procedurally generates content of each room. Entering a new room to see new content, ...
-1
votes
1answer
323 views

C# XNA - Can't Deserialize Element

So This is my XML file: ...
0
votes
2answers
359 views

UnityEngine.PlayerPrefs corrupts string?

I need to use PlayerPrefs to store arrays of bytes for my game. For some reason, the string I save with PlayerPrefs doesn't come out with the same length. I.e. ...
2
votes
1answer
685 views

Keep state in Unity editor without hitting serialization

In my game I have a MonoBehaviour WorldView that, when created at editor time, initializes a large dictionary. Later from a Editor ...
2
votes
1answer
512 views

Unity5 TextAsset not functioning in WebPlayer

Preface I am working on a 2D Platformer in Unity5 utilizing TileMap techniques. I have a working system to read "Room Tile Data" from JSON files with the Unity <...
4
votes
2answers
266 views

How should I store a city map on disk?

I'm working on a game where players travel in a city. This city is defined by streets (names, positions...), points of interest (cinemas, restaurants...) and different zones (high criminality zones, ...
1
vote
1answer
495 views

Getting any type in Unity Inspector

I am developing a SaveManager system for my games. Basicly what it should do is; 1) Gets the "ANY" user created Serializable class by Drag&Drop to inspector. (save data). 2) Writes that class to ...
0
votes
2answers
330 views

Creating Entities from Identifiers (C#)

I am writing a game in C#/XNA. Often, it's useful to have a function like this in a game engine: ...
2
votes
1answer
142 views

How do I serialise a mesh to a text file?

I'm building a game engine in OpenTK (OpenGL for C#). Is it ossible to take a terrain mesh (in any format) and convert it into a text file (or a really small character-filled file, no more than a few ...
1
vote
1answer
11k views

Binary Serialization of C# for GameObject in Unity?

I'm trying to serialize a GameObject (with children and textures) using the binary serialization for C#. It works with many data types but not with GameObject. In the docs it says should be ...
9
votes
3answers
2k views

How can I handle versioning changes when saving assets?

I've been working on an RPG now for a while and I use two of different serialization techniques. Enemies, Weapons, items are as saved as XML. Maps and events are saved as "controlled binary" (every ...
2
votes
1answer
114 views

How do I implement references or relations for entities within a serialized savegame?

I have a 2D tile based RPG for which I'm developing save game function. In particular, I'm trying to save this structure: A caster can have multiple buffs that he maintains. Each buff can have ...