Giter VIP home page Giter VIP logo

splatter.ai's Introduction

Splatter.AI

Splatter.AI is a code based behaviour tree for Unity projects. Current version v0.0.6 can be found in the releases, note there may be breaking changes while in early preview.

Installation

To add to your Unity project go to the Package Manager, click the plus in the top left of the window. Select git URL and enter: https://github.com/ormesam/splatter.ai.git?path=/src/Assets/Splatter.AI

Quick Start More Docs...

  1. Create new class deriving from BehaviourTree
  2. Override Awake method (optional) and initiate blackboard values, make sure to call base.Awake(); at the start of the method
  3. Override CreateRoot method, here you can build up your behaviour tree using the BehaviourTreeBuilder class as shown below
  4. Attach the script to the GameObject
  5. The tree will be executed every frame

View the wiki for more documentation.

Example

using Splatter.AI;

public class ZombieBehaviourTree : BehaviourTree {
    public override void Awake() {
        base.Awake();
        
        Blackboard[ZombieKey] = GetComponent<Zombie>();
    }
    
    protected override Node CreateRoot() {
        return new BehaviourTreeBuilder(this)
            .Sequence()
                .Name("root")
            	.Do("custom action", () => {
                    return NodeResult.Success;
                })
            .End()
            .Build();
    }
}

Patrol / Chase Demo

Found under Samples

Example.mp4

splatter.ai's People

Contributors

ormesam avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

splatter.ai's Issues

Trouble with opening Behaviour Tree Viewer

Unity version 2020.3.28
Template URP Samples

  1. Created new project using the URP template.
  2. Imported the package and Samples
  3. Sample scene runs, no problem.
  4. Attempt to view the Behaviour Tree Viewer results in error:
ArgumentNullException: Value cannot be null.
Parameter name: styleSheet
UnityEngine.UIElements.VisualElementStyleSheetSet.Add (UnityEngine.UIElements.StyleSheet styleSheet) (at <3b9216b5eb2547d2a9ee9f63fc12b7c2>:0)
Splatter.AI.Editor.Viewer.AddStyles () (at Library/PackageCache/com.samorme.splatter.ai@07aa7664f1/Scripts/Editor/Viewer.cs:24)
Splatter.AI.Editor.Viewer.CreateGUI () (at Library/PackageCache/com.samorme.splatter.ai@07aa7664f1/Scripts/Editor/Viewer.cs:18)
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <695d1cc93cca45069c528c15c9fdd749>:0)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <695d1cc93cca45069c528c15c9fdd749>:0)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at <695d1cc93cca45069c528c15c9fdd749>:0)
UnityEditor.UIElements.DefaultEditorWindowBackend.Invoke (System.String methodName) (at <bc087a59f3c04c9aad8fcd92325a4a28>:0)
UnityEditor.UIElements.DefaultEditorWindowBackend.SendInitializeIfNecessary (System.Boolean duringOnCreate) (at <bc087a59f3c04c9aad8fcd92325a4a28>:0)
UnityEditor.UIElements.DefaultEditorWindowBackend.<SendInitializeIfNecessary>b__34_0 () (at <bc087a59f3c04c9aad8fcd92325a4a28>:0)
UnityEngine.UIElements.VisualElement+SimpleScheduledItem.PerformTimerUpdate (UnityEngine.UIElements.TimerState state) (at <3b9216b5eb2547d2a9ee9f63fc12b7c2>:0)
UnityEngine.UIElements.TimerEventScheduler.UpdateScheduledEvents () (at <3b9216b5eb2547d2a9ee9f63fc12b7c2>:0)
UnityEngine.UIElements.UIElementsUtility.UnityEngine.UIElements.IUIElementsUtility.UpdateSchedulers () (at <3b9216b5eb2547d2a9ee9f63fc12b7c2>:0)
UnityEngine.UIElements.UIEventRegistration.UpdateSchedulers () (at <3b9216b5eb2547d2a9ee9f63fc12b7c2>:0)
UnityEditor.RetainedMode.UpdateSchedulers () (at <bc087a59f3c04c9aad8fcd92325a4a28>:0)

Something to do with adding the style sheet. I'll put a couple screenshots:
image
image

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.