- Post your Feature Requests in this thread -

Vote for new features, or make your own requests here.
User avatar
Joel
Moodkie Staff
Posts: 4826
Joined: Wed Nov 07, 2012 10:32 pm

Re: - Post your Feature Requests in this thread -

Post by Joel »

davidlim wrote:Hii, I would like to request some kind of streaming capability for files, this can either be a continue that loads X keys every Y time/frames or even more simply just expose some of the internal methods that already read via stream to allow us to implement this our selfs.
Hi there,

I've created a feature request for this here: https://moodkie.com/forum/viewtopic.php?f=14&t=1650

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
davidlim
Posts: 9
Joined: Fri May 31, 2019 11:27 pm

Re: - Post your Feature Requests in this thread -

Post by davidlim »

JSON minimization and compression,
Work can be done to minimize the size of the json files.
There are a lot of simple and complex string compression algorithems out ther ethat we can use to minify the amount of characters written to the file.

using LZF with this free lib https://www.npmjs.com/package/lzfjs I was able to bring a 1300kb json file to a 1kb base64 file.

A more simple solution, at least for now is to not repeat the big _ES3Ref over and over if its the same ref, instead it could be beneficial to create a placeholder ref inside the file for each ref

{ 2999978709547824141: 1 }

In my file I can see hundreds of repeats like this.
Image

Solving this might save a lot of space overtime.

For example, using this simple script I wrote in js (using lodash) I reduced the file size by 300kb (30% of the file size) just by indexing the __types.

Code: Select all

let innerRef = 0;
const types = {}

const newData = _.mapValues(originalData, obj => {
	if (!types[obj.__type]){
		innerRef += 1;
		types[obj.__type] = innerRef;
	}
	Object.assign(obj, { __type: types[obj.__type]})

	return obj;
})
User avatar
Joel
Moodkie Staff
Posts: 4826
Joined: Wed Nov 07, 2012 10:32 pm

Re: - Post your Feature Requests in this thread -

Post by Joel »

davidlim wrote:JSON minimization and compression
[/code]
Thanks for the request. We actually have a request for Compression here, and we're currently looking into ways of doing this in a platform-independent way.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
krolldk
Posts: 25
Joined: Sun Jun 02, 2019 11:15 am

Re: - Post your Feature Requests in this thread -

Post by krolldk »

Path support in the cloud solution.

Right now, we can save files in the cloud solution, and thats fine. If I save e.g.
E3File myFile = new ES3File("myFile.ecs");
cloud.UploadFile(myFile);
I get a file in the database with filename "MyFile.ecs". Great.
If I do:
E3File myFile = new ES3File("myDir/myFile.ecs");
cloud.UploadFile(myFile);
I get a file in the DB with filename "myDir/MyFile.Ecs". As expected.

BUT: I can't really use the path, to e.g. get all files in MyDir directory.
Suggestion: Add a path field in the DB. When uploading the file, split the filename into path and filename, and store path and filename in seperate fields in the DB.
Then, you can make a cloud.GetFileNames(string directory, string user) function relatively easily, and select in the DB based on the directory AND the username.
That would be really useful....
User avatar
Joel
Moodkie Staff
Posts: 4826
Joined: Wed Nov 07, 2012 10:32 pm

Re: - Post your Feature Requests in this thread -

Post by Joel »

krolldk wrote:Path support in the cloud solution.
Thanks for the suggestion, I've created a feature request for this here :)

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
FredTuna
Posts: 20
Joined: Sat Aug 10, 2019 3:16 pm

Re: - Post your Feature Requests in this thread -

Post by FredTuna »

Hey Joel,

I have created over 70 ES3Type_*** to support all the types I have in my game. It is now very easy to create errors in my code base if I change the structure of a monoBehaviour that has a corresponding ES3Type. Like if I change a private field or property, it will not trigger a compile error because that field or property is referenced by its name as a string in its ES3Type file. It can be very tedious to catch those every time I make changes and even harder for someone else in my team who might not be familiar with the Save System. It would be great if there was some way to validate all my ES3Types to make sure I don't break the save system by accident.

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

Re: - Post your Feature Requests in this thread -

Post by Joel »

Hi there, and thanks for the feature request.

The nature of ES3Types is that they need to be hardcoded to avoid expensive reflection libraries. Note that even referring to them by name will eventually cause an error, because if the field has been removed then it will cause issues when trying to access it using reflection. However, this would allow for auto-updating of ES3Types which would be a possible solution to your issue.

However, a lot of what ES3Types achieve can be done without any hardcoding. As mentioned in the Supported Types guide, there's a list of fields/properties which are supported without the need of an ES3Type.

There are then attributes you can add to control what else gets serialised, or to suppress something from being serialised. For example, a private field with the [SerializeField] attribute will enabled it to be serialised, and a public field with the [NonSerialized] or [Obsolete] attribute will not be serialised.

If you're adding support for Components so that they're serialised when you save GameObjects using Auto Save or ES3.Save<GameObject>, we're making it so that you can manually select which Components get serialised and plan on having this functionality available in the upcoming update. This means you will no longer need to create an ES3Type for a custom Component for it to be serialised when saving GameObjects.

Just in case there are cases where the above does not suffice, I've created a feature request for this here.

Hope this helps!

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
FredTuna
Posts: 20
Joined: Sat Aug 10, 2019 3:16 pm

Re: - Post your Feature Requests in this thread -

Post by FredTuna »

Thanks for your answer. The problem I have is that often times I want to save properties instead of fields which means that I have to create custom ES3Types because properties are not saved automatically. I could probably write up some sort of validator which parses every ES3Type file I have created and checks if the member name in writer.WritePrivateProperty* and writer.WritePrivateField* exists on the corresponding class. It's not the cleanest solution but it should be relatively easy to do and use.

The added control of selecting which components are saved will help also because sometimes I create a custom ES3Type just so that nothing gets saved for that component and that will solve that.
User avatar
Joel
Moodkie Staff
Posts: 4826
Joined: Wed Nov 07, 2012 10:32 pm

Re: - Post your Feature Requests in this thread -

Post by Joel »

Hi Fred,

Thanks for the feedback. Just to clarify, the [SerializeField] and [NonSerialized] attributes also work on properties if that's helpful to you?

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
Cabo
Posts: 2
Joined: Tue Aug 07, 2018 8:55 pm

Re: - Post your Feature Requests in this thread -

Post by Cabo »

Binary Save/load option instead of XML Text save.

Would be great to have the Primitive Types, and some of the primitive collections Array [], 2D Array [,], 3D Array [,,].
And it would be not a shame to add the functionality step by step. :-)
Post Reply