Can ES3 be used to sync position of characters?

Discussion and help for Easy Save 3
Post Reply
88888888
Posts: 25
Joined: Tue Sep 10, 2019 10:41 pm

Can ES3 be used to sync position of characters?

Post 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.
User avatar
Joel
Moodkie Staff
Posts: 4825
Joined: Wed Nov 07, 2012 10:32 pm

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

Post 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
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
88888888
Posts: 25
Joined: Tue Sep 10, 2019 10:41 pm

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

Post 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:)
User avatar
Joel
Moodkie Staff
Posts: 4825
Joined: Wed Nov 07, 2012 10:32 pm

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

Post 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
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
Post Reply