Zombie Survival: NextBot AI Base
Game: Garry’s Mod
Type: AI Framework / NextBot System
Ecosystem: Server-side Addon (Garry’s Mod Multiplayer Servers)
Platform: Windows (32-bit), Linux (32-bit)
Role: Lead AI Engineer (Client Project)
Engine: Source 1
Languages: C++, Lua
Tools: Source SDK, NextBot SDK, Detours, IDA Pro
Purpose: A powerful AI system for developers to script and program bot behaviors for a custom version of the Zombie Survival game mode in Garry's Mod. It comes with AI behaviors out of the box for humans and different zombie classes, such as a poison headcrab that can spit projectiles, a wraith zombie that can cloak and stalk humans, and a fast zombie that can leap toward humans. It supports both C++ and Lua, giving developers the ability to work with the AI at different levels.
Motivation: Garry's Mod does not provide an AI system like this out of the box, and its built-in bot functionality is not designed to provide developers with the level of control needed for advanced bot behavior. Basic capabilities such as crouching, a configurable eye position so the bot's vision and line-of-sight calculations originate from the correct location, climbing ladders and ledges, and reliably navigating around physics objects had to be implemented in C++. The available third-party solutions also did not provide the performance, structure, or level of control required for what I wanted to achieve.
Performance was another important consideration. Since the AI performs many operations continuously, implementing much of the core system in C++ was necessary to keep its CPU cost low enough to fit within the 16.67 ms frame budget required for 60 FPS, while Lua provides the flexibility needed for scripting and customizing bot behavior.
Challenge: Maintaining compatibility with Garry's Mod itself. Since the game continued to receive updates during development, each update would break the C++ component. This meant updating the Source SDK implementation to match each new version of the game and adjusting the C++ component to keep it working without causing server crashes and other unexpected behavior. This is a common challenge when it comes to modding.