multiple es3file files?

Discussion and help for Easy Save 3
Post Reply
asgump
Posts: 2
Joined: Wed Mar 04, 2020 10:43 am

multiple es3file files?

Post by asgump »

Hello.
I am currently managing game data using ES3File.

I know that ES3File is fast.
But I wonder if there is only one ES3File in the game.
The data I need to store is:
GameData, (quest, characterinfo, item ...)
PlayerData, (playerposition, current level ..., frequently stored data)
UserData (game setting, etc ...)

Should I make three ESFILEs? Or is one ES3File enough?
The game isn't that big, so maybe 300-500 keys are stored.

How many keys should I include in one ES3File?

User avatar
Joel
Moodkie Staff
Posts: 2755
Joined: Wed Nov 07, 2012 10:32 pm

Re: multiple es3file files?

Post by Joel »

Hi there,

Underneath ES3Files use Dictionaries to manage the keys, so the number of keys doesn't really affect performance.

Just be aware that all of the data will be loaded into memory, so you might want to consider using multiple ES3Files if you're concerned about memory usage, and not all data needs to be loaded into memory.

All the best,
Joel
Joel @ Moodkie Interactive
Twitter - Unity

asgump
Posts: 2
Joined: Wed Mar 04, 2020 10:43 am

Re: multiple es3file files?

Post by asgump »

Thank you for the quick answer.

I have additional questions.
1. If ES3File has many keys, will it affect Sync performance as well?

2. without creating variables
Is there any performance penalty if I access the values directly via ES3File.Save/Load?
In short, I wonder if we can use it like a global variable.

User avatar
Joel
Moodkie Staff
Posts: 2755
Joined: Wed Nov 07, 2012 10:32 pm

Re: multiple es3file files?

Post by Joel »

Hi there,

More variables will affect Sync performance because it will have more data to write to the file. However, saving them all at once will require less performance than saving the same amount of data in three separate files.

You could use it as a global variable, and it would have the cost of a Dictionary lookup and deserialising the data. If you're not accessing it every frame then there shouldn't be any noticeable performance impact, but static variables will of course be quicker.

All the best,
Joel
Joel @ Moodkie Interactive
Twitter - Unity

Post Reply