Is there a way to combine operations for network serialization?

Questions & AnswersCategory: ProgramingIs there a way to combine operations for network serialization?
Landong asked 2 years ago

 So i have a custom dig operation right now that additively increases the dig amount on a block by 0.01f. What this does is creates a very smooth digging effect into the terrain. This works fine over photon, the issue though is when a new player joins there are an absurd amount of operations to sync for them to see the changes.
Is there an existing function to essentially truncate all previous operations and only send the current value of a block that has been modified?
I was about to write something myself but i figured i would ask first to see if there was already some function i missed that does this.

1 Answers
uTerrains Staff answered 2 years ago

You could make an operation that aggregates your operations. I’m thinking of an operation that holds an array of affected voxels and that could receive another operation to affect its array. Then, you would just need to re-apply the operation. In the end, you will have a lot less operations but they will contain an array of voxels so that might be suitable for small areas only.

Landong replied 2 years ago

that’s a good idea actually, instead of adding operations on the same block just modify the original operation.

Landong replied 2 years ago

i’m actually only streaming over operations for the chunk the person is on otherwise… takes waaaaay to long to send the whole map lol.