Search Unity

Unity Stories - Redux like state container utilizing Scriptable Objects

Discussion in 'Assets and Asset Store' started by AdamRamberg, Apr 29, 2018.

  1. AdamRamberg

    AdamRamberg

    Joined:
    Dec 8, 2016
    Posts:
    22

    Unity Stories is an open source state container for games built in Unity utilizing Scriptable Objects. Unity Stories is inspired and influenced by Redux and Flux.
    • Predictable state management.
    • Get the best of 2 worlds: Flux like architecture combined with Unity's Scriptable Objects.
    • Decouple your data from your game logic.
    • Enhance your state using Middlewares. Unity Stories ships with a logger for easy debugging.
    • Includes examples of how to use Unity Stories.
    Go here for full documentation and examples.

    Download on Asset Store.

    Want to contribute or have an idea on how to improve the library? Lets connect on GitHub. ​
     
    kawashimays, scvnathan and rakkarage like this.
  2. AdamRamberg

    AdamRamberg

    Joined:
    Dec 8, 2016
    Posts:
    22
    v1.1.0 of Unity Stories is out on the Asset Store!

    What is new in v1.1.0?
    • Added 2 methods to the API: Disconnect and RemoveListener.
    • Added Stories Helper: a helper class that reduces the amount of coded needed to Connect / Disconnect and Listen / RemoveListener to Stories in your MonoBehaviours.
    These changes were made after using Unity Stories in my own projects and I needed a way to remove listeners to Unity Stories. The new update fixes this problem and adds the Stories Helper that reduces the boilerplate code needed to setup Unity Stories in your own code.

    If you got an idea for an improvement or a feature you want to be added to Unity Stories? Create an issue on GitHub.
     
  3. AdamRamberg

    AdamRamberg

    Joined:
    Dec 8, 2016
    Posts:
    22
    New version of Unity Stories is out! Check it out here.

    What's new?
    • GREAT improvements to the API when creating StoryActions. StoryActions are now basically as easy / few lines of code as creating an Action in Redux - but without creating unnecessary garbage!
    • Upgraded the project to use Unity 2018

    As always I'm open for suggestions on how to improve this library through GitHub.
     
    kawashimays likes this.
  4. scheidtventureestate

    scheidtventureestate

    Joined:
    Nov 28, 2017
    Posts:
    33
    Just stumbled over this. Pretty great work! (though I have a strong web dev background)
     
  5. one_one

    one_one

    Joined:
    May 20, 2013
    Posts:
    621
    Huh. I think this is too abstract for most of the forum community ;)

    I need to look more closely into it (completely clueless about web dev/nodeJS), but from what I've seen, this could greatly benefit from a node based flow graph editor. I have modified an open source node editor to create flow graphs - if you're interested, we could see if it makes sense to integrate that into this system?
     
  6. scheidtventureestate

    scheidtventureestate

    Joined:
    Nov 28, 2017
    Posts:
    33
    Can you provide a link to the node graph editor? And yes; functional programming and an immutable state is something that is probably out of scope for most people. However, with the upcoming ECS structure, that might not be the case anymore.
     
  7. one_one

    one_one

    Joined:
    May 20, 2013
    Posts:
    621
    These are the two most feature complete open-source node editors in unity:
    xNode is quite a bit more lightweight and not as far along in development
    The Node Editor Framework comes with more features, including run-time support, but is a bit more, hm, clunky.

    The (admittedly rather basic) flow graph editor I use is based on the latter, as I'm entertaining the idea of using it for modding tools later on, so run-time support would be great.
     
  8. AshMcConnell

    AshMcConnell

    Joined:
    Aug 10, 2011
    Posts:
    11
    This is great, thanks a lot Adam! Hoping this will make state management a lot easier. I'm starting to use ngrx (an Angular Redux implementation) and finding it very useful
     
  9. AdamRamberg

    AdamRamberg

    Joined:
    Dec 8, 2016
    Posts:
    22
    Thanks everyone! A node based / graphical editor would be awesome! This project is sadly not something I've been working on for some time though. Have favoured my other state management project called Unity Atoms based on Ryan Hipple's talk from Unite 2017 on Scriptable Objects. If anyone is interested in extending this project with a graphical node based flow go ahead! Fork my repo and make a PR I will take a look at it. And if you are instead interested in Unity Atoms you can find it here: https://github.com/AdamRamberg/unity-atoms