Bliss Code

Godot Limbo AI Conditions

2025-02-07
Godot Limbo AI Conditions

This article is all about Godot and LimboAI Behavior Tree Conditions. In previous articles I went over the basics of behavior trees and how to create a simple game with them.

If you haven't read the previous article you can check it out here:

You can check out the game here:

Behavior Tree Conditions

Conditions are a type of node that can be used to check the state of the game or the AI. They are used to determine if an action should be taken.

extends BTCondition

@export var target_var := &"target"

func _tick(delta: float) -> Status:
	var target: CharacterBody2D = blackboard.get_var(target_var, null)
	if target == null:
		return FAILURE
	return SUCCESS
  • First it extends from BTCondition as opposed to BTAction like a normal task would.
  • Then it exports a variable target_var which is the key in the blackboard that the condition will check.
  • If it has a target on the blackboard it will return SUCCESS otherwise it will return FAILURE.
  • It makes it easy to check if you have a target or not in your sequences.

Conditions typically don’t take multiple ticks to finish and return either SUCCESS or FAILURE immediately.

So in my case I have two sequences, a Wander sequence and an Attack sequence.

  • The Wander sequence will only run if there is no target.
  • The Attack sequence will only run if there is a target.

Conclusion

Conditions are a great way to check the state of the game or the AI. They are used to determine if an action should be taken.

Links


More Articles

Game Marketing

Game Marketing

A brief introduction to game marketing.

Google Search Indexing Wait Times

Google Search Indexing Wait Times

In this article we will go over how long it takes Google to index a new page.

Godot Limbo AI Conditions

Godot Limbo AI Conditions

Behavior Tree Conditions in Godot with LimboAI


Newsletter

Stay up to date with the latest articles, tutorials, and news.