Page 1 of 1

Can ES3 be used to sync position of characters?

Posted: Tue Oct 08, 2019 8:13 pm
by 88888888
I just want do save and load a bool variable for this but everytime I save it inside my ssd drive reduces the game frame rates from 600 to 150 fps for seconds.

Re: Can ES3 be used to sync position of characters?

Posted: Wed Oct 09, 2019 7:26 am
by Joel
Hi there,

Would you be able to show me how you're doing this? I'm not sure how saving a bool could save the position of characters.

If there's already data in the file then this will cause slowdown because it will have to perform a random-access operation in the file. Also note that performing IO operations is inherently expensive, however saving a bool on each frame . Instead you should only store the data to file when absolutely necessary. You might want to consider using an ES3File to cache the data, and then only store it at specific points, rather than on every frame: https://docs.moodkie.com/easy-save-3/es ... g-es3file/

Note that if you're using this to make sure that players are synchronised in a multiplayer game, you should use Unity's networking APIs instead:
https://docs.unity3d.com/Manual/UNet.html

All the best,
Joel

Re: Can ES3 be used to sync position of characters?

Posted: Wed Oct 09, 2019 12:06 pm
by 88888888
Joel wrote:Hi there,

Would you be able to show me how you're doing this? I'm not sure how saving a bool could save the position of characters.

If there's already data in the file then this will cause slowdown because it will have to perform a random-access operation in the file. Also note that performing IO operations is inherently expensive, however saving a bool on each frame . Instead you should only store the data to file when absolutely necessary. You might want to consider using an ES3File to cache the data, and then only store it at specific points, rather than on every frame: https://docs.moodkie.com/easy-save-3/es ... g-es3file/

Note that if you're using this to make sure that players are synchronised in a multiplayer game, you should use Unity's networking APIs instead:
https://docs.unity3d.com/Manual/UNet.html

All the best,
Joel
I want to use bool variables for input system as W,S,D,A keys to control the character from anoher PC. Have no idea if it's a good way to do this or not:)

Re: Can ES3 be used to sync position of characters?

Posted: Wed Oct 09, 2019 5:20 pm
by Joel
Hi there,

If you want to control a character remotely then latency would be a major issue in this case. Unity's Networking API is made for these specific cases, so I recommend that you use these as these use Sockets to directly send information between clients.

All the best,
Joel