Summary - AI
- Game Development course
- Advanced
- Lesson 42/71
- 4 min
Reinforce AI usage with a summary task.
Summary: Game AI Architecture
In this group, you explored the twin pillars of game artificial intelligence: the physical navigation layer provided by NavMesh and NavMeshAgent, and the behavioral layer steered by FSM and Behavior Trees.
// Decision system picks target, Agent traverses path
if (currentState == EnemyState.Chase) {
agent.SetDestination(player.position);
}Coupling robust decision logic with smooth pathfinding results in convincing and challenging enemy encounters.
Practice AI system integration
Define a Start method. Inside, declare string durum = "AI sistemi devrede"; and print it to the console with Debug.Log(durum);.
Starter code
using UnityEngine;
public class AiSummaryTester : MonoBehaviour
{
// Start icinde durum tanimla ve yazdir
}Sample solution
using UnityEngine;
public class AiSummaryTester : MonoBehaviour
{
void Start()
{
string durum = "AI sistemi devrede";
Debug.Log(durum);
}
}Expected output
AI sistemi devrede
Questions and answers
Review the lesson questions together with their answers. To test yourself, solve the lesson interactively.
1 Which two systems are respectively responsible for decision-making and spatial pathfinding in an AI enemy character?
- TextMeshPro and Canvas Scaler
- AudioSource and Shader Graph
- FSM / Behavior Tree and NavMesh / NavMeshAgent Correct answer
- PlayerPrefs and JsonUtility
Explanation: Decisions are dictated by FSM or Behavior Trees, while physical locomotion across geometry is executed by NavMesh and NavMeshAgent.
2 Active path check
if (agent.____) { CheckArrival(); }
if (agent.hasPath) { CheckArrival(); }
Explanation: The 'hasPath' property is checked to verify whether the agent currently possesses an assigned active route.
3 AI architecture summary
| Term | Meaning |
|---|---|
NavMesh |
Walkable surface geometry |
NavMeshAgent |
AI agent traversing the path |
Behavior Tree |
Hierarchical decision tree |
FSM |
State-to-state transition machine |