Search Unity

Activation Graph System, 1.43 will be available! Mission, tech, building, skill tree solution

Discussion in 'Assets and Asset Store' started by mkgame, Sep 5, 2016.

  1. mkgame

    mkgame

    Joined:
    Feb 24, 2014
    Posts:
    592
    The next version will not have serialization and deseliaziation. Unity has no good built in way to save a lot of data. PlayerPrefs saves data under Windows in the Registry. I and you cannot do that to the customers. I found 2 comon serialization assets in the asset store, 'Easy Save' and 'JSON .NET for UNITY'. I used 'Easy Save' for a mobile game successfully, but I wouldn't use it for saving a lot of data. I do not have any experience with 'JSON .NET for UNITY', but it looks like a professional way to save data.
    I will try to implement saving the current state of the graph with the help of 'JSON .NET for UNITY', but that means for you, you have to own that asset. But however, I'm still not sure what I will use.
     
  2. mkgame

    mkgame

    Joined:
    Feb 24, 2014
    Posts:
    592
    New version submitted:

    - Reworked editor, optimized size for nodes.

    - Multiple selection of nodes in the graph is possible.

    - Duplicating nodes is now possible.

    - Additional helper methods for dynamically adding container nodes. E.g.: Build a silo and create its own container node, where the storage for products are defined.

    - Update button added to the graph to update dynamically changes at runtime.

    - Larger description fields in the custom inspector can be hidden.

    - Tested in my own upcoming RTS game. (www.metadesc.com)

    Price will rise to 35$.
     
    Last edited: Feb 21, 2017
  3. mkgame

    mkgame

    Joined:
    Feb 24, 2014
    Posts:
    592
  4. CommunityUS

    CommunityUS

    Joined:
    Sep 2, 2011
    Posts:
    240
    Glad the update is out. Any progress on saving example?
     
  5. mkgame

    mkgame

    Joined:
    Feb 24, 2014
    Posts:
    592
    Working on it. Definitely comes with the next content update.

    Unity approved the Update 1.4 quite fast, documentation is not finished yet, but the API documentation will be uploaded as soon as possible. For duplicating the nodes type 'd'. This key deleted a node before. For deleting use the 'Delete' key. If you want to delete or duplicate more nodes, select them by dragging the mouse and select or unselect additional nodes by type the 's' key. After duplicating the nodes, the connections between the nodes will be lost. If you duplicate or remove nodes, be sure the mouse cursor is on one of the selected nodes or on the empty area. If it is over an unselected node, the unselected node will be duplicated.

    This update should not change your graph data. However, make a backup before you update.
     
  6. Extrakun

    Extrakun

    Joined:
    Apr 2, 2009
    Posts:
    69
    Hi mkgame,

    Just to let you know I am highly interested in your asset, especially since you are going to add in serialization.

    Will it means that the upgrade nodes can be loaded in when the game runs, instead of complied into the scene?

    One idea, which might be slightly complicated, is to expose an interface that allow us to write our own serializer. Perhaps use an example with JSON .NET so that we can refer to it. This way we won't need to have a copy of that asset to do serialization.
     
  7. mkgame

    mkgame

    Joined:
    Feb 24, 2014
    Posts:
    592
    Hi Extrakun,

    The main idea was to save runtime the state of the graph and load it again, if the player loads a saved state of the game. But I agree, with JSON .NET I can serialize/deserialize all the graph. I will need it anyway, if I implement saving/loading for my game. I cannot promise anything, but the aim is the full serialization/deserialization with JSON .NET.
     
  8. mkgame

    mkgame

    Joined:
    Feb 24, 2014
    Posts:
    592
    I was trying to implement it with the Unity's built in JSON serialization/deserialization, but it was not ment to be for such purposes (https://forum.unity3d.com/threads/unity-5-3-jsonutility-question.373101/). My classes are built for serialization, I just need a capable JSON, which is able to handle instance references, to test it. I also have dictionaries, but for that are already solutions available (For Unity, another JSON solutions have it normally.).

    Unfortunately I must use a JSON solution from the asset store...
     
  9. CommunityUS

    CommunityUS

    Joined:
    Sep 2, 2011
    Posts:
    240
    this is totally fine and found in many solutions just look at UFPS or NGUI. sometimes even a standard will use another standard, like UFPS mobile required NGUI before Unity UI came out. many times working with an est. solution is preferred anyways, so it gets full attention on its own. or from a popular user base. then you can focus on what your asset does rather than trying to support 2 things. looking forward to the save!
     
  10. mkgame

    mkgame

    Joined:
    Feb 24, 2014
    Posts:
    592
    I made a lot of investigation about how to serialize/deserialize things in Unity. The most improved, most popular and well supported asset is Easy Save. I already began the implementation, should be soon in Unity approval. If you want to use another serialization, then at least you will have the list of fields that must be serialized.

    I wanted to do this at the end of the game development, but now I done it, a generic way to save and load GameObject's.

    The serialization class on top of the Easy Save will synchronize your scene with the loaded data. That means, If you load a graph and the graph GameObject with the same name already exists, then the graph GameObject in the scene will be removed and replaced by the loaded graph. That is the case, if you save the game and load the game.
     
  11. Mark_T

    Mark_T

    Joined:
    Apr 25, 2011
    Posts:
    303
    I'm glad you choose Easy Save.
    Any chances for Playmaker actions?
    Thanks.
     
  12. mkgame

    mkgame

    Joined:
    Feb 24, 2014
    Posts:
    592
    Important fix for 1.4 added. The annoying selection rectangle isn't visible anymore, when you scrolling the view with pressed middle mouse. The examples are also adapted for 1.4.
     
  13. mkgame

    mkgame

    Joined:
    Feb 24, 2014
    Posts:
    592
    @Mark_T
    Maybe later I will give it a try again, but I have not the time yet.
     
  14. Mark_T

    Mark_T

    Joined:
    Apr 25, 2011
    Posts:
    303
    Thanks! I really appreciate it.
     
  15. TokyoDan

    TokyoDan

    Joined:
    Jun 16, 2012
    Posts:
    1,080
    Is that "Easy Save" or "Easy Save System"? Could you please include an Asset Store URL to the actual Asset
     
  16. mkgame

    mkgame

    Joined:
    Feb 24, 2014
    Posts:
    592
    Hi, I missed your message. The Easy Save URL is https://www.assetstore.unity3d.com/en/#!/content/768. I had some trouble with the Easy Save workflow. In the next weeks I will continue the Easy Save implementation.

    If you want to serialize the nodes, you just have to serialize the visible serializable fields, nothing else.
     
  17. CommunityUS

    CommunityUS

    Joined:
    Sep 2, 2011
    Posts:
    240
    thanks for not giving up. any update or example you can pm? thank you for your time. (early adopter)
     
  18. mkgame

    mkgame

    Joined:
    Feb 24, 2014
    Posts:
    592
    Hi,

    I would like to have a generic solution with easy save. Saving a GameObject/GameObject hierarchy has still some issues. I prefer a solution with EasySave, where I can save a hierarchy of GameObjects, then the components on the script and then the references on the components.Unfortunately at the time for each reference a GameObject will be created.
     
  19. mkgame

    mkgame

    Joined:
    Feb 24, 2014
    Posts:
    592
    Version 1.43 is sent to Unity approval. Duplicating tasks with internal conditions now correctly handles the references.

    I made some progress with XML serialization, without any other assets, so it won't be specialized for one of the asset store assets. Please understand, this is pretty complex, because I did not used proxy classes for preserving data. Changing this would lead to lose all the settings in the nodes, so this would brake your work and my work. So, proxy classes won't be implemented. However, some of the asset store assets can handle this by reflection (The assets, which can serialize the entire scene.). Also EasySave is able to handle this situation, but I would like to have a readable output file. In my opinion for that is XML the best solution.
     
  20. will_jones

    will_jones

    Joined:
    Dec 20, 2011
    Posts:
    80
    Looking forward to this! I have been waiting a long time for a good "tree-builder" whether it's for missions, crafting, skills etc. my game needs it! Currently I am using GDE (Game Data Editor) + Playmaker for generic game data, soon will be getting Easy Save and Activation Graph System
     
  21. ArvindRajaYadav

    ArvindRajaYadav

    Joined:
    Dec 15, 2017
    Posts:
    3
    Hi, I just purchased your asset and was looking through the tutorials. I want to make a tech tree using the graph editor, but I simply can't figure out how to add connections between the nodes. The manual or the youtube video doesn't seem to mention how to add connections either. Can you please tell me how to add connections between nodes?

    EDIT: Figured it out. I should have read the "Get Started" part a bit more carefully.

    I made two new node called Start (the starting point for my tech tree) and Tech 1 (connected to start) after including the two prefabs as described in the manual. I get this error in the unity console:

    SkillTreeGuiController: task 'Start' cannot mapped by name. Create a SkillTreePrefab with the name!

    SkillTreeGuiController: task 'Tech 1' cannot mapped by name. Create a SkillTreePrefab with the name!

    How do I do this? What am I missing here?
     
    Last edited: Mar 8, 2018
  22. mkgame

    mkgame

    Joined:
    Feb 24, 2014
    Posts:
    592
    For serialization of the graph is still no solution yet. However, there are many assets which can do serialize scripts, which derives from MonoBehaviour. I'm working again on the XML serialization, but it is not simple. The root of the troubles around the serialization is, that Unity MonoBehaviour cannot be serialized by common serialization solutions. This makes it complicated...
     
  23. mkgame

    mkgame

    Joined:
    Feb 24, 2014
    Posts:
    592

    Hi, there is a Readme file under the "Activation Graph System". Press control for green lines and shift for red line under Windows OS and the left mouse button. Under Mac OS 'X' and 'C' keys.

    You took the Skill-Tree example and extended it with your own node, then this error message just telling you to create a UI skill-button, which must have the same name "Tech 1". By the name matching the Task-Node will be connected to the UI-Skill-Button.
     
  24. ArvindRajaYadav

    ArvindRajaYadav

    Joined:
    Dec 15, 2017
    Posts:
    3
    Where do I create this button - in the inspector or in a C# file? It doesn't seem like there are buttons in the "UISkillTree" prefab when I load it into the inspector.
     
  25. mkgame

    mkgame

    Joined:
    Feb 24, 2014
    Posts:
    592
    In the scene stree is a UI node (not sure what the name is), where all the buttons are attached. You just have to duplicate one of the buttons and set the name and a new position. You can faster find the buttons in the scene, if you click on one of them in the scene view. You can also search one of the button name in the scene tree.
     
  26. ArvindRajaYadav

    ArvindRajaYadav

    Joined:
    Dec 15, 2017
    Posts:
    3
    Thanks, I found the buttons (they're nested quite deep in the GUIController) and created two new buttons. Here's what my setup looks like:


    I've got a few followup questions:

    1. The second button does not seem to be visible, even though there is a button for it with a different X,Y.


    2. When I click on the Start button (shown in the red rectangle above), I get an error:
    "NullReferenceException: Object reference not set to an instance of an object
    ActivationGraphSystem.SkillTreeItem.ClickedOn () (at Assets/ActivationGraphSystem/Scripts/Example/SkillTreeItem.cs:161)"
    I'm likely missing how to connect the nodes properly, I would simply like there to be 1 point put into start before Anima is visible. Perhaps the manual can explain things in a more beginner friendly way?

    3. It seems I must also create the lines that connect the buttons. Are there any plans to automate generating the UI, because it will get tedious if there are a lot of items in the skill tree.
     
  27. mkgame

    mkgame

    Joined:
    Feb 24, 2014
    Posts:
    592

    Sorry for this late reply. Next time if I don't answer, just mail me a short message.

    1. The Unity UI is responsible to show the buttons. You may have to adapt some components to have a nice skill tree. This part of the work is Unity UI stuff.

    2. Duplicate (ctrl + d) one of the buttons like FireBall. Rename it to Start and the other button to Anime. Then duplicate the node in the graph with selecting the e.g. IceShot and duplicate it by pressing "d" (or duplicate it in the scene tree by pressing ctrl + d) 2 times. Name one Start and the other anim. Set Start to activate state, as you did, and connect them, as you already did. Works fine for me. The 2 additional fireballs in the middle of the graph.

    bandicam 2018-03-30 14-11-43-551.jpg
    3. I have already that kind of solution in my own game in NGUI, but it is not yet working well. I just have UI update issues. And yes, I have the same problem, I have a lot of nodes in the graph (about 150 for units, buildings, skills, researches, technology and upgrades). From this kind of graph I have 5 for each my races, so about 750 nodes. But I'm not sure that the player would like a such generic created tree. For prototyping until the game has a stable selection of nodes it is awesome.

    Connections and nodes created by the position of the nodes in the graph:

    bandicam 2018-03-30 14-31-16-924.jpg

    However, I will create a tutorial for the skill tree example. I belive that this is one of the example projects, which can be used without touching the source code.
     
    Last edited: Mar 30, 2018
  28. Rujash

    Rujash

    Joined:
    Jan 3, 2014
    Posts:
    37
    Hi, I'm interested in purchasing this but I'm concerned about the ability to save research/unlock progress for the player and an example of implementing the system with different UIs would go a long way for customization (wanting a more dynamic UI, like Skyrim's skill point/unlock system). Are these implemented or still being worked on?
     
  29. mkgame

    mkgame

    Joined:
    Feb 24, 2014
    Posts:
    592
    Hi, the UI's are just examples for using the graph. If you think implementing it in for a new UI system, then you must change the UI script. I did this myself for NGUI, because I use that UI system. Changing the script was quite simple due to the similarities. For me under 30 min. work.
    Sorry for the late reply, did not get any email notification.
     
  30. MAeStROx

    MAeStROx

    Joined:
    Mar 20, 2015
    Posts:
    15
    Hi, cool asset, works really well!

    I have 2 questions:
    1. Regarding the saving/loading - I understand it's difficult to serialize it, but until you make progress with that, can you add to the documenation how would I go about saving the state of the tree? XML would be no good for my purposes,
    so maybe you could add API to serialize it - like a function on the AGM which would call every item that needs to be serialized, passing an object reference, which could be overriden.

    2. Tree UI creating - this is more of a feature request - to have the ability to define a tree using the node manager, and then be able to click a button and have the UI for this tree be created/edited, which you could then move the items around and also edit properties of the nodes themselves ontop of the UI. What I ask is similar to the Talentus asset functionality.


    Thanks! Counting on this asset :)
     
  31. CommunityUS

    CommunityUS

    Joined:
    Sep 2, 2011
    Posts:
    240
    I assume you plan to implement saving on your own game. Perhaps we will get it after that?