25-06-2024, 09:02 AM
(25-06-2024, 08:29 AM)josemendez Wrote: What's your use case? Why are you using JSON to serialize this data?I've reflected on it, and there are probably two main reasons for using JSON to store and restore ropes:
- Before I was preparing to implement the function of restoring ropes with data, I saw the above two posts in this forum. They all used the method of particle positions to restore the original shape of the rope, and from the responses in the posts, they seem to have succeeded. In addition, after using the Obi Rope plugin, my understanding is that it only requires basic particles to draw a complete rope.
- This reason is more important. Because I am developing a game that can be social in the future. For example, I made some complex entangled ropes, and when I want to share them with friends for decryption, I only need to serialize the rope data into JSON. Essentially, what is shared is just a string of characters. Others only need to parse the string when they open the game to restore the rope level I designed before. Because I was in a hurry to develop the function, I didn't spend too much time researching whether the blueprint could also achieve the function I mentioned above. My first intuition was that JSON is the most convenient and feasible, and the blueprint is limited by the serialization of the file (although when opening the blueprint with Notepad, you can see that the data stored inside is similar to what I need). If the data is based on the blueprint, then must it be shared through the server when sharing, because this is a file?