question

Aaron avatar image
Aaron asked

Storing a large structure of Data from UE4. Including Vector, Time Span arrays, mesh object references and strings

I'm using Blueprints in UE4 and I wish to send a structure of data to other users.
This data is basically a replay - Which including location and rotation information and timing data stored in an array.
I also have the mesh data stored which I want to store - Though I have read that it might be better to store it more as an inventory ID reference rather than a static mesh object reference.
Plus two strings.

I'm not sure how to pack and unpack this data and where it needs to be stored in PlayFab.

So far I've tested account creation and logging on. But this has left me puzzled

unreal
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Seth Du avatar image
Seth Du answered

Many resources are stored in the form of KVP, in which the value is either JSON object or string. In the common scenario, we will recommend serializing data before the data is uploaded to PlayFab via API call. I am not sure which is the best scenario of handling JSON in Blueprint, but I believe there are many plugins on MarketPlace to meet your requirement, otherwise, you may consider to use C++ script to serialize and deserialize JSON. PlayFab also provide a variable type named PlayFab JSON object in Blueprint, you may create functions to convert your data for storage.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Aaron avatar image
Aaron answered

@SethDu - Thank you for your response I have been looking into what you've said.

Don't suppose you have a jargon buster anywhere? - I'm not read up on the lingo. Not sure about the meaning of;
KVP
Serializing
Parsing - I also hear this often

I've saw a few resources on the marketplace but I have to be honest. Without understand more I'm hesitent to get any without knowing it's what I'll need

The PlayFab JSON Object you talked about. I set something up based on how I think thing might work from looking at how other people have set up data.

Could you tell me if this is a viable solution for the PlayFab network. Also a follow up question

Q. Where on the PlayFab infastructure do I save this data - and what is the correct method of doing this?. Say that I have a JSON object that is viable.

Q2. I do wish to save the data that it can be retreaved in a slot Say, from slot 1-10. Would I need to put the JSON Object that I created into another JSON Object?. Is such a thing possible?

https://imgur.com/2leGqzx



https://imgur.com/lqb9Rbs


https://imgur.com/ISo3yAM



https://imgur.com/FLl51OX



What I did is get the data in it's rawest form. Mostly Floats, some strings. convert the data into Json values. Put it into a Json array with each value in a specific slot, And into another array.

Then I get that info back from getting each array then reading each value in the array and placing back into the original data format then into back into it's structure


1.png (381.7 KiB)
2.png (282.2 KiB)
2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Seth Du avatar image Seth Du ♦ commented ·
  • KVP: Key-Value pair. Data in PlayFab is mostly stored in this form.
  • Serializing: convert an Object to a string, but with particular format.(JSON)
  • Parse/deserializing: convert a string to an Object.

>> For Q1:

It depends on your requirement. You may use SetObjects APi to store those data. If it is something a player wants to share with another player, sometimes we should consider shared group data. Here is an official sample: Example: Turn-based multiplayer Async games, which is using Shared Group Data via UpdateSharedGroupData API.

If it is a player's personal data, simply Player Data (or Player Read-Only Data) with public permission will do the job. Other players are able to see those data via API.

Meanwhile, all these resources are not designed for frequently change. If it is your requirement to let players communiciate in real-time, a dedicated hosted server will be necessary. To implement Multiplayer server: https://docs.microsoft.com/en-us/gaming/playfab/features/multiplayer/

You may find the resource you want to use in PlayFab, and find the corresponding API. Then check how it is defined in Blueprint and check the format of request. Usualy a PlayFab JSON object should work.

0 Likes 0 ·
Seth Du avatar image Seth Du ♦ commented ·

>>For Q2:

Yes, it is possible. PlayFab JSON object is Blueprint specific feature. As PlayFab is a service based on RESTful API, we will treat the data in the form of JSON. If you are not familiar with JSON, you may check: https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Objects/JSON.

I also recommend you to implement POSTMAN to check the API list and learn the usage of PlayFab API: https://docs.microsoft.com/en-us/gaming/playfab/sdks/postman/

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.