Giter VIP home page Giter VIP logo

rosehfsm's Introduction

RoseHFSM

This project is used for the implemention of hierarchical state-machine AI in Unity.

Features:

  • An easy to use node editor for designers to develop the behaviours for agents.
  • A frame work for designers/programmers to inherent from to create their own states specific to the game.
  • Abstract enough to be used alongside game systems not related to agent behaviour.

Installation:

Place the files within an appropriate place in your Unity Projects' file structure.

How to Use:

Add a 'Behaviour' object to a game object. Once added you'll be able to click the 'Node Editor' button to begin designing agent behaviours.

States:

Within the node editor, drag and drop any monoscript files that inherit from the State class to add states. Once a State is clicked, variables that you have marked as a SerializeField will appear for you change to match the design of your AI.

Transitions:

You may right-click a state to add transitions between them, to edit a state click on either of the states that the transition is between and find the button to edit the appropriate transition at the bottom of the state editing menu.

You have the ability to transition to parent-states and choose where the parent state begins, or to an exact state within the parent state if you select another tab while selecting the end of your transition.
Read the parent state section below for more details.

Conditions:

Once editing a transition you may drag and drop monoscripts that inherit from a condition class. Similar to the State class, it will show fields you've marked as a SerializeField to edit.

There are built-in distinct boolean conditions that may help you build more advanced behaviour:
  • NOT Condition
  • AND Condition
  • OR Condition

Parent State

A parent state is where more enhanced behaviour may be used. It's basically a state which acts like another finite state machine. Right-click anywhere in the editor and select 'Parent State' to add a new Parent State. A tab will appear at the top of the node editor so you may switch to editing this parent state. Once editing this parent state you may either click the 'Base' tab or 'Back' tab to return to the last state-machine you were in.

Read the Transitions sections to read about the more distinct properties of transitioning to a parent state.

Bugs

  • Currently UnityEvents do not function properly as a SerializeField as their variables will not be saved.
  • Various errors while switching between GameObjects in the middle of using the NodeEditor.

rosehfsm's People

Contributors

hookkshot avatar rhiyo avatar

Watchers

 avatar

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.