Large Language Models for Behavior Trees Generation in Unreal Engine
Behavior Trees (BTs) enable dynamic and strategic gameplay by controlling non-player characters (NPCs) in video games, but their construction and iterative refinement remain time-consuming and technically demanding for game developers. This project explores the integration of Large Language Models (LLMs) within Unreal Engine 5 as a tool to automatically generate BTs from natural language prompts, thereby reducing the complexity of designing game AI and accelerating the production pipeline. In order to choose the adapted model in terms of coherence and practicability for local integration, multiple models were benchmarked. Results revealed that models under 2.5 GB provided the best trade-off between performance and output quality. The LLaMA 3.2 3B Instruct quantized model was found to be particularly suitable. In this study, we have thus developed a tool based on the Llama-Unreal Plugin to implement a local LLM into the engine. A custom prompt interface was implemented in the editor, allowing users to submit natural language inputs. The model responds with an XML description of the BT, which is then parsed and instantiated as a native BT asset in Unreal Engine. The XML schema was carefully designed to accommodate different node types (tasks, composites, decorators). The implemented system was tested with simple NPC behaviors like seeking and chasing the player for a guardian, or like a boss fight sequence for a dragon. It successfully produced functional BTs from simple prompts in various gameplay scenarios. Early results have shown how LLMs can streamline the creation of Game AI. The system could be extended to support more complex and hierarchical BTs, improve error handling in XML parsing, and integrate with other game engines such as Unity or Godot.
- Link
- https://www.semanticscholar.org/paper/5ca6acf115eb52b4c909850337f520f0e7307de7
- Found by
- Semantic Scholar
- Authors
- Axel Gerbeaud, Leo Lorcet, Loan Campan, Alexander Dockhorn, Florian Wolf, A. Lherbier, M. Addoum
- Categories
- benchmark
- Published
- 2026-08-09
- Last seen by the radar
- 2026-08-10
- Citations
- 0
- Influential citations
- 0
- Radar score
- 35.59 / 100 (how it is scored)
- Why it scored so
- Matched: benchmark; Primary record: Semantic Scholar
- Related links
- https://doi.org/10.1145/3815598.3815631