A practice-based research project from RMIT University on creating a low-cost LLM-Unity communication pipeline for indie game AI.
A practice-based research project demonstrating a low-cost communication pipeline between Unity and Large Language Models for resource-constrained game developers.
This paper documents an exploratory study into a potential architectural approach: establishing a low-cost communication pipeline between the Unity game engine and an external LLM (DeepSeek). Through a practice-based research methodology involving functional prototyping and systematic observation, this study reports on the design and preliminary performance of a hierarchical model where the LLM provides high-level tactical commands while traditional state machines handle real-time execution.
The "AI Commander" system is built on a hierarchical, two-layer architecture that separates strategic reasoning from tactical execution. This approach, guided by the Command Pattern, allows an external LLM to act as a high-level "commander" without the heavy costs and latency of real-time control.
- Technical Viability: The communication pipeline between Unity and the LLM is technically functional and robust.
- Remarkable Cost-Effectiveness: Over a 4-month testing period with 454 API calls, the total operational cost was only ¥0.67 CNY (~$0.58 USD), proving the economic feasibility for indie developers.
- Emergent & Unscripted Behavior: The LLM autonomously generated a "hold" command—a conservative tactic that was never explicitly programmed—demonstrating contextual reasoning beyond its instructions.
- Game Engine: Unity
- Programming Language: C#
- LLM Service: DeepSeek API
The core logic for the AI Commander can be found in the /Code directory. The full research methodology and findings are detailed in the paper located in the /Paper directory.
If you find this research useful, please cite it as follows:
@misc{zhuang2025aicommaner,
author = {Zhuang, Haoduo (Alex)},
title = {The AI Commander: An Exploratory Study of LLM-Unity Communication for Resource-Constrained Game Developers in 2D Top-Down Shooters},
year = {2025},
publisher = {GitHub},
journal = {GitHub repository},
howpublished = {\url{https://github.com/AlexMercerDUODUO/AI-Commander-Unity-LLM-Exploratory-Research-RMIT-MAGI}}
}

