Skip to content

Rhiyo/RoseHFSM

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages