Object serialization in UnrealEngine


How to save game system at dedicated authority server online?

Now I think on how to save Characters, but not with UE SaveGame system (wich works with local files /SaveGames/*.sav). I am looking for solution, which will allow me to serialize/deserialize objects to some standart format, like XML or JSON.

Currently, my on-line save game system works on JSON, but I should to script code to serialize/deserialize all Character variables, that could be strings, float, structs, etc… It take a lot of time and it is not an effective way.

How to serialize whole Character class to JSON or to XML, with binary data (for example, for textures) in some variables/tags?

Thank you!

Still not resolved…

Still not resolved…

And is quite likely to remain “Still not resolved”. Unless you are willing to do the coding. You might try to get a class serialized via C++, and get the output of that, and then do something with xml/json.

In terms of XML it doesn’t support binary data in it’s raw state, you will have to convert it to Base64. I would start by taking look at what the serialization methods do. See if I could adapt those to my needs, in order to build the output that I wanted.


The language barrier isn’t helping. Are you saying you want to save/load files in your own format? I gave my best shot below.

If this is just game-specific data then you would probably not want to use UE4 serialization at all. It’s pretty complicated. In C++ you can go through all your actors/components/etc and write your save files as you see fit (see here). Or you could connect to a database and store everything that way.

Edit: In my own research, I found this. It may help you figure out what you can/can’t do. Also, there is this from Rama. I’m reading through it now but it looks like what I think you want to do.

JSON and XML are meant to be human readable, formatted plain text files. Serialization and deserialization involves taking some data object and outputting a binary chunk of data. In other words, you can’t “serialize” data into an XML or JSON file and you shouldn’t be trying to do that either.

It sounds like what you’re trying to do is store data on a server somewhere. Why not create a SQL database and store the data in tables? Then you don’t have to worry about outputting to a plain text file or serialization / deserialization.