Search Unity

Amazingly Easy - Free Save Game Manager - Unity Serializer now on Version 0.7

Discussion in 'Made With Unity' started by whydoidoit, Jun 24, 2012.

  1. whydoidoit

    whydoidoit

    Joined:
    Mar 12, 2012
    Posts:
    365
    UPDATE: Unity Serializer is now on version 2.21 and has had many thousands of downloads from my site and installs from the Asset Store.

    Here's a video of me adding a save game feature to Angry Bots in under 2 minutes and using the new server features



    You can get Unity Serializer on the Asset Store, the latest documentation and versions are available on my website.
     
    Last edited: Dec 3, 2012
  2. XavLar

    XavLar

    Joined:
    Feb 14, 2012
    Posts:
    143
    JESUS! THAT IS AMAZING! And it's all going to be free? No pro-version?
     
  3. whydoidoit

    whydoidoit

    Joined:
    Mar 12, 2012
    Posts:
    365
    No pro version - I'm suggesting people might like to donate something if it works for them and they make money - no obligation to do that - totally MIT licensed.
     
  4. voncarp

    voncarp

    Joined:
    Jan 3, 2012
    Posts:
    188
    Seems to work great so far. The example scene works nicely. Is there a simple way to delete the saved games in the scene or have the saved games available on scene reload or we going to have to study up on all the documentation for that.
     
  5. whydoidoit

    whydoidoit

    Joined:
    Mar 12, 2012
    Posts:
    365
    If you have version 0.7 then you can delete the saved games using the Wizard. Or otherwise you can add a Components>Storage>Internal>Clean Up And Maintenance to any scene object (it deletes itself) - that gets rid of the saved games.

    Not sure I understood your second question.
     
    Last edited: Jun 24, 2012
  6. voncarp

    voncarp

    Joined:
    Jan 3, 2012
    Posts:
    188
    If I was to start the sample scene again, the saved games are displayed. But, they don't load and return a null reference error.
     
  7. whydoidoit

    whydoidoit

    Joined:
    Mar 12, 2012
    Posts:
    365
    Ah ok - yes if you start again there will be a new Save Game Manager and that won't match. So you need to delete them. This is certainly easier with V0.7 because there is just a button for it. The Save Game Manager is responsible for allocating the IDs to the game objects.
     
  8. whydoidoit

    whydoidoit

    Joined:
    Mar 12, 2012
    Posts:
    365
    Actually there looks like there is a reloading bug. I'll check it out - seems some of the IDs change on reload of the scene in the editor.
     
    Last edited: Jun 24, 2012
  9. whydoidoit

    whydoidoit

    Joined:
    Mar 12, 2012
    Posts:
    365
    There is a fixed version 0.71 available on the web site and pending on the Asset Store.
     
  10. voncarp

    voncarp

    Joined:
    Jan 3, 2012
    Posts:
    188
    Example is brilliant. If you use this, be sure to help support plug-ins like this. So far, its supported by the author and free for everyone. Very beneficial project for the Unity Community.
     
  11. Heu

    Heu

    Joined:
    Feb 13, 2012
    Posts:
    349
    Wow this will be very nice to have! Thank you for sharing!
     
  12. vished

    vished

    Joined:
    Oct 24, 2010
    Posts:
    26
    This is great - would it possible to play a cut scene, or keep playing while the scene is saved at certain stages in a level?
     
  13. Sir-Tiddlesworth

    Sir-Tiddlesworth

    Joined:
    Oct 19, 2011
    Posts:
    908
    THIS IS FREE!? :eek:
     
  14. UnlimitedEdition

    UnlimitedEdition

    Joined:
    Feb 27, 2012
    Posts:
    287
    I agree with Tiddlesworth above. Thank you for this amazing product. Is there any online documentation?
     
  15. voncarp

    voncarp

    Joined:
    Jan 3, 2012
    Posts:
    188
    There seems to be some difficulties using this in conjunction with Navmeshes. I also appear to be getting errors in relation to texture2d with joystick controls based on NGUI.

    Thoughts?
     
  16. whydoidoit

    whydoidoit

    Joined:
    Mar 12, 2012
    Posts:
    365
    WIth Navmesh - you have to recalculate the agent path on loading - I'm looking at other ways - but basically I couldn't figure out the structure so in my example I use OnDeserialized() to recalculate the path.

    Will look at NGUI - I use NGUI too - there might be a reference issue.
     
  17. whydoidoit

    whydoidoit

    Joined:
    Mar 12, 2012
    Posts:
    365
    It could be - it will depend on how you are doing it :) I'm really keen to get this working for lots of different 3rd party components, it should work with animations and it will allow you to continue Coroutines if you include a manager object in the scene and start them slightly differently.
     
  18. whydoidoit

    whydoidoit

    Joined:
    Mar 12, 2012
    Posts:
    365
    Yep :)
     
  19. whydoidoit

    whydoidoit

    Joined:
    Mar 12, 2012
    Posts:
    365
    No problem :)

    Online documentation is available on my website.
     
  20. whydoidoit

    whydoidoit

    Joined:
    Mar 12, 2012
    Posts:
    365
    The complex example project uses Navmeshes - I'll add some documentation to the website shortly
     
  21. whydoidoit

    whydoidoit

    Joined:
    Mar 12, 2012
    Posts:
    365
    Can you point me to the NGUI package you are using?
     
  22. Alec

    Alec

    Joined:
    Mar 11, 2008
    Posts:
    1,330
    Would just like to say you are doing a huge service to the community with this, I am yet to try it but will no doubt follow this very closely as my project comes to fruition.
     
  23. whydoidoit

    whydoidoit

    Joined:
    Mar 12, 2012
    Posts:
    365
    Thanks :) I'm hoping it will work for most peoples games. I'm sure it will keep developing over time as more and more people use it and I find out all the other libraries and components it needs to support ;)
     
  24. voncarp

    voncarp

    Joined:
    Jan 3, 2012
    Posts:
    188
    I am using the Virtual Control Suite Controls from the asset store for NGUI. Nice little package that seems to integrate well with NGUI.

    Also, on the complex example scene, many of assets have become unlinked and broken on import.
     
  25. whydoidoit

    whydoidoit

    Joined:
    Mar 12, 2012
    Posts:
    365
    That Terrains.zip should be the whole project directory - is that not what you got?
     
  26. voncarp

    voncarp

    Joined:
    Jan 3, 2012
    Posts:
    188
    I downloaded the whole Terrains.zip, yes. But while running it quite a bit of warning errors are showing up about missing Behaviours. Regardless, it does run quite well.
     
  27. whydoidoit

    whydoidoit

    Joined:
    Mar 12, 2012
    Posts:
    365
    Yeah I see that now - looks like I trashed something unimportant - will run the find missing behaviours script on it before I upload again.

    Think I can do the navmesh agent auto start without requiring code on the programmers behalf - looking at texture references now...
     
  28. whydoidoit

    whydoidoit

    Joined:
    Mar 12, 2012
    Posts:
    365
    Version 0.74 is available on the web site - automatic support for NavMeshAgent and added the ability to support references to Texture2D assets.
     
  29. EricTheCoolDude

    EricTheCoolDude

    Joined:
    Feb 21, 2011
    Posts:
    164
    Whoa, this is exactly what I need! Would it be possible to save every instance of a prefab? The enemies in my game multiply from a master object of the enemy far away from the playing field and I wouldn't want players to be able to cheat by saving and loading to get rid of the enemies. If I saved the master enemy object, would any multiplied instances of it be saved as well?
     
  30. voncarp

    voncarp

    Joined:
    Jan 3, 2012
    Posts:
    188
    Issues, with NavMesh agents still seem to be present. Getting errors on whether Navmesh agent is present.

    "MissingReferenceException: The object of type 'NavMeshAgent' has been destroyed but you are still trying to access it.
    Your script should either check if it is null or you should not destroy the object."

    Also, seems to throw off existing some existing scripts on save. Particularly, on the Public Texture2d I have OnGui().

    NGUI related issues seem to have been fixed though.

    Though everyone is going to have errors, project specific, I still believe this plug in is very good thing for the community.
     
  31. whydoidoit

    whydoidoit

    Joined:
    Mar 12, 2012
    Posts:
    365
    Thanks - this beta is all about stamping on these things that don't happen in my projects!

    Oh darn - yeah I delete and recreate the NavMeshAgent because it was complaining that it was off the damn NavMesh on my test harness - you must be using the reference to the first one that I kill. Right back to the drawing board on that. I was deliberately not storing Texture2D references because I was worried about them, do you create that Texture2D yourself (or with something via code?) I can probably check for that.
     
  32. whydoidoit

    whydoidoit

    Joined:
    Mar 12, 2012
    Posts:
    365
    Yes it saves every instance of a prefab :)

    Anything that is flagged with a Prefab Indentifier and has a findable prefab parent is reproduced exactly.
     
  33. voncarp

    voncarp

    Joined:
    Jan 3, 2012
    Posts:
    188
    Very basic crosshair script. What is happening, when I load a level from the saved games, the Texture2d is changing to a completely different texture. ???

    Code (csharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. public class Crosshairs : MonoBehaviour {
    5.  
    6.     public Texture2D crossHairs;
    7.     public Rect position;
    8.     private float screenWidth;
    9.     private float screenHeight;
    10.    
    11.     void Start(){
    12.  
    13.         screenWidth = Mathf.Max (Screen.width, Screen.height); // enforce landscape mode screen width
    14.         screenHeight = Mathf.Min (Screen.width, Screen.height); // enforce landscape mode screen height    
    15.         position = new Rect ((screenWidth - crossHairs.width) / 2, (screenHeight - crossHairs.height) / 2, crossHairs.width, crossHairs.height);
    16.        
    17.     }
    18.    
    19.     void OnGUI(){
    20.    
    21.         GUI.DrawTexture(position, crossHairs);
    22.        
    23.     }
    24. }
     
  34. whydoidoit

    whydoidoit

    Joined:
    Mar 12, 2012
    Posts:
    365
    I've got it I think - the textureId inference isn't working properly - so it's finding the wrong one. Something to do with the cataloging not working. I'm on it right now...
     
  35. whydoidoit

    whydoidoit

    Joined:
    Mar 12, 2012
    Posts:
    365
    So here's a thought - the way to be absolutely sure it will always work and be robust around the changing of structures in the scene is to ensure that all objects have a unique name. But that would involve changing the name of the textures, meshes etc if they were the same. At the moment it uses a index, but the name would always work. Depends how annoying it is that some names might change.
     
  36. whydoidoit

    whydoidoit

    Joined:
    Mar 12, 2012
    Posts:
    365
    Uploaded version 0.76 to the web site - should be much more robust for NavMeshAgents and all asset references now. Feedback greatly appreciated :)

    You can get version 0.76 here
     
  37. voncarp

    voncarp

    Joined:
    Jan 3, 2012
    Posts:
    188
    An issue I am having, again probably project specific with the Navmesh is when I have two enemies on screen. Say I zap one and he turns into a ragdoll. Upon loading the saved game, his body just disappears with the following error message:

    "CalculatePolygonPath" can only be called on an active agent that has been placed on a NavMesh.

    What would I need to do to have his body reappear?
     
  38. voncarp

    voncarp

    Joined:
    Jan 3, 2012
    Posts:
    188
    Also, with the latest upgrade, I can't run a build on the iPhone anymore.
     
  39. whydoidoit

    whydoidoit

    Joined:
    Mar 12, 2012
    Posts:
    365
    Got it on the iPhone - I'll cache whatever it is I've introduced that does a JIT - damn didn't realised I'd added one.

    I'll also trap out the agent having a path issue and just swallow that if it has an exception and only calculate the path if it had one.
     
  40. EricTheCoolDude

    EricTheCoolDude

    Joined:
    Feb 21, 2011
    Posts:
    164
    If I set it up with the current version, will it still work if I just replace the files whenever you upload a new one?
     
  41. whydoidoit

    whydoidoit

    Joined:
    Mar 12, 2012
    Posts:
    365
    Yes I now have the files in a good location - release notes will cover upgrading as time goes by, but I don't envisage much.
     
  42. phime-studio

    phime-studio

    Joined:
    Nov 16, 2009
    Posts:
    49
    Great work Mike ! We will use it in our upcoming projects :)
     
  43. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    Amazing! Will be following this and donate right away when our team uses this.
     
  44. whydoidoit

    whydoidoit

    Joined:
    Mar 12, 2012
    Posts:
    365
    I am expecting the first commercial grade release in about 4 weeks - getting some great feedback still and fixing different scenarios is really helping.
     
  45. whydoidoit

    whydoidoit

    Joined:
    Mar 12, 2012
    Posts:
    365
    I've released a version with a whole series of bug fixes and the like. Also a new wizard to help you track Assets that might be referenced by your scripts.

    On the Asset Store and downloadable from here.
     
    Last edited: Jun 28, 2012
  46. whydoidoit

    whydoidoit

    Joined:
    Mar 12, 2012
    Posts:
    365
    I'm excited to announce that I've finally managed to find the time to add full material and texture saving to Unity Serializer - it will now store references and script generated materials and textures.

    The latest version also uses compression to keep down the file sizes.

    Available from here, pending on the Asset Store.

     
  47. LucasDaltro

    LucasDaltro

    Joined:
    Oct 31, 2010
    Posts:
    236
    Can I use this in a level editor?
     
  48. whydoidoit

    whydoidoit

    Joined:
    Mar 12, 2012
    Posts:
    365
    Sure, I don't see why not!
     
  49. LucasDaltro

    LucasDaltro

    Joined:
    Oct 31, 2010
    Posts:
    236
    Awesome:D
    I'll definitely use it in my next project
     
  50. voncarp

    voncarp

    Joined:
    Jan 3, 2012
    Posts:
    188
    If I have two scenes: Scene1 and Scene2. I saved a game in Scene1 and then made a transition to Scene2. From Scene2, I loaded the saved game from Scene1. To make this work I would have had to have stored all the objects in Scene1. Is that correct?