0
votes

I'm developing an app targeting Android and iOS, and I'm looking for alternatives on data serialization.

I know how to use basic binary serialization, but through my searches I've found that it's considerably less optimal than other libraries, such as Google Protobuf.

Is this true? Is it also true for using with Unity?

If so, how can I use Protobuf with Unity? The advice I seek is mainly "how to begin using protobuf". I've downloaded the NuGet packages Google.Protobuf and Google.Protobuf.Tools, but I have no idea where to go from there. I've checked the tutorials (https://developers.google.com/protocol-buffers/docs/csharptutorial, https://developers.google.com/protocol-buffers/docs/encoding, https://developers.google.com/protocol-buffers/docs/reference/csharp, https://developers.google.com/protocol-buffers/docs/reference/csharp-generated, https://developers.google.com/protocol-buffers/docs/proto3, https://github.com/protobuf-net/protobuf-net ) but none seem to indicate how exactly to actually begin using the buffer in Unity.

I have been developing in Unity for some time, but I've never developed outside it, neither had formal education on programming, so I'm not very comfortable using the scripting tools or raw programming languages outside Unity.

My first question, why? As for 'In Unity' should be irrelevant, as it's just protobuf in C#. Protobuf is great for gRPC, but if it's API to app, just use JSON like everyone elseStuart.Sklinar
Does this tutorial help?Ruzihm
@Ruzihm the tutorial definitely helps, thanks!inacioM
@Stuart.Sklinar Mostly I'm worried about performance and readability of data across platformsinacioM
@Stuart.Sklinar Yeah, it isn't a lot of data. I'm probably over engineering, indeed. I've decided to go with JsonUtility, since it's already plugged in Unity, and when I get to the later development I'll use some conversion to binary if performance proves to be an issue.inacioM