Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question Solution for scripting Gameplay and Sequences

Discussion in 'Visual Scripting' started by Bloodybot, Sep 30, 2020.

  1. Bloodybot


    Jan 28, 2018
    Hello all

    I'm looking for a visual scripting solution that allows non-programmers (designers, artists etc.) to script gameplay/puzzles/sequences based on building-blocks that I as a programmer define.

    An example would be:
    A door that requires a key. When the player interacts with the door and has the required key in his inventory, the door opens. If not, it doesn't and a sound plays to indicate that it's locked.

    I imagine that door could be defined as a generic interactable that triggers a flow defined in some kind of node based editor using following conditions and actions:
    - Has object "Key" in inventory condition:
    If yes:
    - Remove object "Key" from inventory
    - Disable interactable "Door"
    - Play animation "Open" on object "Door"
    If no:
    - Play sound "Locked"

    A more complex example would be telling two AI characters to meet at a certain spot in the game and hand over an item.

    My current solution to this is something that looks very close to Game Creator ( The problem with that is that it quickly gets confusing and it's difficult to visualize whether things are running in sequence or in parallel.

    I've already had a brief look at the solutions out there (Bolt, Playmaker, NodeCanvas, Timeline) but none of them seem to do exactly what I want?

    What I (think I) want:
    - A node-based editor for defining a "flow" consisting of custom actions
    - Custom user-defined conditions that allow branching
    - Control over whether actions run in sequence or in parallel
    - Waiting for several parallel actions to finish and only continue after that
    - Nice-to-have: An ability to debug the flow of the graph and set breakpoints

    What I don't (think I) want:
    - A full visual scripting environment that gives my designers access to every single C# function. I basically want to limit them to ONLY use actions and conditions defined by me!
    - A FSM. Since multiple actions should run in parallel
    - A timeline based solution. It would solve managing parallel actions neatly, but branching based on conditions is hard/impossible to achieve
    - JIT compilation, reflection-magic or anything else that affects performance in a negative way

    What would be the best option for me?
    Should I just go ahead and write this myself using xNode or another node framework?

    Edit: I just noticed that this sub-forum is only about Unity's visual scripting solution (Bolt), so this thread rather belongs into General Discussion, sorry!
    Last edited: Sep 30, 2020
  2. Bloodybot


    Jan 28, 2018
    Anyone? Bump.
  3. Ex-Crow


    Aug 14, 2020
    Your needs sound highly specialized. Especially the parallel vs sequential execution you talk about. Typically VS is sequential, not parallel, although you can have as many events of the same type in a Bolt graph as you want which sorta does this. Bolt can also have multiple state machine start states that can transition in parallel. But the performance requirement automatically disqualifies Bolt and Flow Canvas since they're both reflection based (directly implemented nodes don't use reflection though).

    Unity are working on a new directly implemented nodes API for Bolt but it'll take a year or two for it to mature and become production ready.

    Since your needs are so specialized, xNode sounds like the better option. You might also want to look into the recently released Flow Reactor, which is being advertised as a high level VS tool, but it's closer to being a custom node framework like xNode.
  4. altepTest


    Jul 5, 2012
    I suggest looking into adventure creator assets. is a complete solution to create adventure like games and have triggers and the rest that you can usually find in this type of games.

    I can't recommend that asset enough. once you see how many building blocks you actually need you will be glad it is already available for you