Two questions as I consider the product

Easy Save 2 has been replaced by Easy Save 3, so is no longer supported.
Locked
Velo222
Posts: 3
Joined: Sun Jan 19, 2014 5:48 am

Two questions as I consider the product

Post by Velo222 »

Hello,

Well the Easy Save 2 looks like it might be an asset I would like to purchase, however I have two concerns:

#1: I am working on an rts-type game along the lines of StarCraft 2, in which I could have hundreds, if not thousands of units, buildings, cloned objects, trees, rocks, and just game objects in general. Would Easy Save 2 be able to handle this type of a game? I'm thinking that all of the transform and rotation states would need to be saved for each and every gameobject, would this asset be able to handle this? In addition, what about the location of trees using Unity's built-in terrain features? I also have some code that modifies the tree's array to indicate trees that have been "chopped" down or harvested. I would need to load the trees array in the same state it was saved in -- any advice on that?

#2: I'm also concerned about versions. For instance, lets say a player saves a game under one version of my game, and then Unity updates the editor and I add some code and release another version of the game. Is there a system in place to handle this as well?

Thank you for any information you might be able to give.

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

Re: Two questions as I consider the product

Post by Joel »

Hi Velo222,

Easy Save 2 has been used in various RTS games, so it's well suited to it. We're actually in the process of adding some new methods and a guide which will allow you to get extra performance out of Easy Save, especially when saving a large number of objects which aren't contained in an array. It takes less than 200 milliseconds to save an array of 20,000 Transforms (ie. position, rotation, scale and tag) on a 2009 iMac, so it's already very quick.

I've not actually used Unity's tree features before, but taking a quick look it shouldn't be too difficult to persist the state of it. Here's my general thought process on saving and loading trees:

The Terrain component contains an AddTreeInstance(TreeInstance instance) method, and a terrainData field. This terrainData field contains both our array of instantiated trees (treeInstances) and an array of prefabs/prototypes for each tree we can have (treePrototypes).

Each TreeInstance has a prototypeIndex variable, which is the position of the tree prefab in the treePrototypes array. With this information we would need to do the following:
  1. We would save the following information:
    • The length of the treeInstances array
    • The color, heightScale, lightmapColor, position, prototypeIndex and widthScale of each TreeInstance
  2. Then when loading, we would do the following:
    • Load the length of the treeInstances array[/i] )
    • For each treeInstance we want to load (ie. for(int i=0; i<treeInstancesLength; i++):
    • - Create a new TreeInstance and load the data we saved into it.
    • - Add our TreeInstance to our terrain using terrain.AddTreeInstance(treeInstance);


I'll see if we can get TreeInstances added to our Supported Types list for either v2.29 or v2.30. In which case, you would just need to save the treeInstances array, and then you could just load the array and then iterate over it, calling terrain.AddTreeInstance for each one.

With regards to save formats, the Easy Save 2 format hasn't really changed since v2.0. If new fields are added to classes, the format is designed to handle this while maintaining backwards compatibility.

All the best,
Joel
Velo222
Posts: 3
Joined: Sun Jan 19, 2014 5:48 am

Re: Two questions as I consider the product

Post by Velo222 »

That sounds great Joel, thanks. And thanks for the information and quick response.
Locked