Fantacode AI — Coding Behaviors
So, finally getting back to this video on the new AI Statemachine in the Fantacode Studios assets.
Fantacode AI — Coding Behaviors
So, finally getting back to this video on the new AI Statemachine in the Fantacode Studios assets.
[embed]
Starting from Scratch
First off, I’m going to attempt to more or less start from scratch so that I can properly test things. The video uses a scene which I think is from the upcoming Stealth package. I’ve grabbed the Synty Starter Pack so that I don’t have to build my level to play in.

As per the example in the video, I’ve dropped in an AI, in my case using the Parkour AI system (side note, if you don’t select any system, an enemy is created without the state machine behavior despite the Parkour AI system not actually customizing the state machine).

If we were to run this, we will run into another peculiarity in the system.

The AI requires an object with the FSSettings class in the scene. Normally, that would be the Player, but we can attach one to the scene camera.

Execute Behavior State
The Intro Behavior, Default Behavior, and Authored Behavior states are Execute Behaviors. What does this mean? Well, apparently you can execute behaviors defined in the Inspector instead of having to modify the state machine itself. Let’s try the example from the video. We’ll take an AI character in the scene and add an AI Behavior script to them.

From there, we’ll add a node to have the one AI move to the other one by adding a Node and keying it to the Core / Move behavior.

And… it initially looks like it’s working.

But, in actuality, both of them are in Patrol mode, and are using the same waypoints (no, the “conversation” bit at the top isn’t an authored behavior. They’re just running into each other). Hmm… I thought that the Intro Behavior would stick, but it looks like it’s moving right into Default Behavior / Ambient Behavior / Patrol.

Let’s remove the patrol coordinates on the second AI (they’re both using the same base State Machine) and see if the Intro Behavior triggers.

And success. It’s worth mentioning that you can stack a few behaviors on that Behavior node.


The second AI, at the start, will follow the first, crouch (and scream if you added an AudioSource to it), then run to the third waypoint. Lastly, let’s have the second AI set the AuthoredBehavior flag after it screams, and have it trigger a behavior on the first AI.



Clear as mud, I know, but basically it waits a second (during which time it does its other behaviors), does a jump animation, and then runs to the first waypoint.
This… is interesting. I think I’m going to have to really play around with it to see what I can trigger. It still feels a bit clunky in places. I feel like multiple behaviors will look less like a web of interactions, and more like a series of cue sheets that are only connected if you view them side by side. I also do still want to do the academic exercise of moving combat movement into the AI state machine so that it’s potentially easier to tweak behavior graphically.
메타데이터
- post_id
- 72ae4aec7085
- slug
- fantacode-ai-coding-behaviors-72ae4aec7085
- url
- https://medium.com/@sean.duggan/fantacode-ai-coding-behaviors-72ae4aec7085
- canonical_url
- https://medium.com/@sean.duggan/fantacode-ai-coding-behaviors-72ae4aec7085
- author_url
- https://medium.com/@sean.duggan
- status
- ok
- fetched_at
- 2026-08-19 00:11:10