Issues errors in LimboAI behavior tree demo WIP

Godot Version

4.6.2 stable

Question

I tried to write the code to get the Limbo-ai addon demo working in 3D, and I’ve managed to get the basics working but there are errors I can’t find. There’s an error complaining about an animation, but I’ve checked through and added simple animation placeholders. There’s also a couple of other repeating errors from the C++ but I can’t figure out whats going on.

The other problems are that the pink mob seems to work properly for quite a long time then suddenly flips over sideways, and the white mob (I think its the simple melee) doesn’t even move.

Any help is appreciated, or if anyone can point out a behave project that does the same stuff :slight_smile:

project linked here:

DarkGrey456/limbo-3d: limboai in 3d

this was build with the latest release version of the addon, linked in the readme file.

I personally think it would be better to google it or look on youtube, as plugins are a very specific niche per say,
its hard for people who dont know about it to help with anything…
I hope you can fix it, but without an actual overview of the triggers for the glitch, console, stack trace, etc. it is really difficult for me to say what is wrong.

1 Like

the repeating errors come from the C++ function “_tick()”

defined in bt_play_animation.cpp

BT::Status BTPlayAnimation::_tick(double p_delta) {
	ERR_FAIL_COND_V_MSG(setup_failed == true, FAILURE, "BTPlayAnimation: _setup() failed - returning FAILURE.");

	// ! Doing this check instead of using signal due to a bug in Godot: https://github.com/godotengine/godot/issues/76127
	if (animation_player->is_playing() && animation_player->get_assigned_animation() == animation_name) {
		if (get_elapsed_time() < await_completion) {
			return RUNNING;
		} else if (await_completion > 0.0) {
			WARN_PRINT(vformat("BTPlayAnimation: Waiting time for the \"%s\" animation exceeded the allocated %s sec.", animation_name, await_completion));
		}
	}
	return SUCCESS;
}

its the “ERR_FAIL_COND_V_MSG” . (took about 5 mins to track that down, and tbh it looks like I could rebuild with better animations.) cheers.

I just deleted the white one that wasn’t working and most of the errors are gone.

now its just this:-

E 0:00:00:874   emit_signalp: Error calling from signal 'area_entered' to callable: 'Area3D(HitBox3d.gd)::_area_entered': Cannot convert argument 1 from Object to Object.
  <C++ Source>  core/object/object.cpp:1406 @ emit_signalp()

so I changed the signal handler to this:

func _area_entered(hurtbox: Area3D) -> void:
	if hurtbox.owner == owner:
		return
	if hurtbox is Hurtbox3D:
		(hurtbox as Hurtbox3D).take_damage(damage, get_knockback(), self)

and that error stopped, then the last one was

E 0:00:05:610   callv: Error calling method from 'callv': 'CharacterBody3D(character_body_3d.gd)::throw_ninja_star': Method not found.
  <C++ Error>   Method/function failed. Returning: Variant()
  <C++ Source>  core/object/object.cpp:866 @ callv()

and I realized that I had removed that function from the agent_base script for the 3d characters. So I added a function stub.

That left just 10 errors, but mostly white non serious warning level errors, so now I can get to work on the good stuff …. the character_base shouldn’t throw ninja stars, a class hierarchy would be appropriate, but …. some characters would need behaviors from multiple tree branches. So I decided on an ECS. I haven’t implemented it yet.

1 Like

I highly recommend limboai and even building it yourself if you use a dev build of the engine. The demo that is shipped with it is very well produced and the user interface is very intuitive and user friendly.

The conversion to 3D was not so trivial simply because I had to redefine functions (like the flanking stuff) that were intended for 2D, and also had to figure out how to use the get_facing() and set_facing() functions in 3D properly for the thing to work … of course its just -Z.

the behavior trees are much more appropriate than HSM’s for a lot of game programming tasks, like combinations, or sequential behaviours, pretty useful for scripting things. (theres a lot more on this topic but I dont have time to write the essay). Also its interesting to develop stronger ways that agents can work in teams.

The user interface is one of the best I’ve seen