Type.EVE
Overview
School project focused on implementing Behavior Trees for AI control. Created a strategic game where AI units make complex decisions using hierarchical behavior tree structures.
Technical Focus: Behavior Trees
Implemented a comprehensive behavior tree system with over 600 lines of AI logic, featuring sequences, selectors, conditions, and actions for strategic unit control.
Code Highlight
Behavior tree builder showing hierarchical decision-making structure:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
private RootNode BuildBehaviourTree() {
return new RootNode(new Selector(new List<Node>() {
new Sequence(new List<Node>() {
new Condition(NormalBehaviour) { Name="AggressiveCheck" },
new Action(ToPursue) { Name="ToPursue" },
new Sequence(new List<Node>() {
new Condition(CanAttackTarget) { Name="CanAttackTarget" },
new Action(ToIdle) { Name="ToIdle" },
new Sequence(new List<Node>() {
new Action(DealDamage) { Name="DealDamage" },
new RepeatUntilFailure(new Condition(TargetDied)) { Name="TargetDied" }
})
}) { Name="AttackTarget" },
}) { Name="NormalBehaviour" },
new Sequence(new List<Node>() {
new Condition(UsingWaypoints) { Name="DefensiveCheck" },
new Action(ToPursue) { Name="ToPursue" },
new Selector(new List<Node>() {
// ... waypoint and attack logic
})
}) { Name="WaypointBehaviour" },
}));
}
Technologies
- Engine: Unity3D
- Language: C#
- Key Systems: Behavior Trees, AI, NavMesh, coroutines
- Libraries: TextMeshPro