Project X.E.N.O.
A Lua-scripted tool featuring a dynamic entity that follows players and interacts with the environment, showcasing modular design and gameplay integration.

Introduction
Autonomous Aerial Threat
for Garry’s Mod
Project X.E.N.O. is a Lua-scripted addon for Garry’s Mod, a sandbox game built on the Source engine that lets players build and experiment with custom gameplay.
It creates a dynamic entity that follows players and interacts with its environment, working ideal in both Garry’s Mod’s free-form Sandbox mode and Trouble in Terrorist Town (TTT), a role-based gamemode where players are assigned roles such as innocent, detective, or traitor.
Technologies
While Project X.E.N.O. behaves like an AI enemy, its actions are driven by scripted routines that handle targeting and movement.
Technology / Technique | Description |
---|---|
Garry’s Mod Lua API | The main system used to create entities, handle movement, physics, and control how things work in the game. |
TTT Base Code | Makes sure the weapon and equipment work properly with Trouble in Terrorist Town1, including role-based features. |
Timers & Think Hooks | Controls real-time updates and timed events to keep movement, actions, and events running smoothly. |
Networking & ConVars | Syncs data between the server and players, allowing settings to be customized and updated in real time. |
Dynamic Attachments | Keeps things like grenades attached and positioned correctly, even when X.E.N.O. is moving around. |
Material & Model Adjustments | Changes how models2 look, including scaling, transparency, and visual effects during gameplay. |
Client-Side Rendering | Handles things like the health bar on each player’s screen without adding extra work to the server. |
Physics & Collision Handling | Manages how objects move and interact with the environment, including collision detection. |
Sound & Resource Management | Loads custom sounds3 and icons4 to make the gameplay experience more immersive. |
1 Project X.E.N.O. was originally designed to work exclusively in TTT gamemode. Based on user feedback, it was later expanded to also function in Sandbox mode.
2 X.E.N.O. is built from Half Life 2 models in Garry’s Mod. Its main body is a single model that gives it an alien-like look, while on its stomach two additional models are combined to form an attachment that generates grenades. One part of this attachment is a bomb-like element that rotates continuously for a cool effect.
3 All sound effects used in Project X.E.N.O. were generated using AI, with LoudMe as the tool for sound creation.
4 Icons were crafted in Photoshop and then converted into VMT/VTF formats. These formats are used by the Source engine to define material properties and textures.
Development Process
The project was developed in clear stages, focusing on smooth movement, dynamic interactions, and responsive feedback. Each stage was built and integrated step by step to create a smooth and efficient gameplay experience.
Project X.E.N.O. Flow Diagram
Summoning System
Summoning Core: An alien egg-like object, visually based on an in-game throwable item, serves as the foundation for the summoning process.
Transformation: Upon landing, the core expands, hovers, and then transforms into X.E.N.O. This transition uses scale manipulation, material fading, and particle effects for a visually appealing effect.
Targeting & Tracking System
Continuous Scanning: X.E.N.O. constantly looks for the nearest target. In TTT, it prioritizes innocents and detectives. In Sandbox mode, it tracks both players and NPCs.
Obstacle Detection: A ray is shot upward from the player to check for space above. If a ceiling is detected, X.E.N.O. adjusts its height for smoother movement.
Movement System
Smooth Interpolation: X.E.N.O. uses smooth lerping to move naturally towards its target rather than teleporting.
Speed Scaling: Higher settings make X.E.N.O. move aggressively, while lower settings result in a more cautious chase.
Natural Positioning: It lags slightly behind the player instead of hovering directly overhead to avoid awkward collisions and maintain a natural movement feel.
Grenade Dropping System
Visual Consistency: To simulate grenades dropping from its stomach, a custom attachment object is positioned dynamically beneath X.E.N.O.
Animation Details: Grenades follow a smooth descent with transparency fading and physics-based movement.
Customization: The drop radius can be adjusted, giving server owners control over how spread out the grenades appear.
Damage & Health System
Client-Side Health Bar: Each client can enable or disable the health bar, reducing the performance impact on the server.
Damage Feedback: X.E.N.O. darkens visually as it takes damage, providing quick visual feedback.
Explosive Destruction: When X.E.N.O. is destroyed, it triggers a multi-stage explosion with adjustable intensity.
Challenges
Summoning System
The summoning core was misaligned in third-person views, breaking visual consistency, and the first-person view needed improvement.
Adjusted the attachment points on the player model by fine-tuning position, rotation, and scale. This ensures the core appears naturally in the character’s hand in both first- and third-person views.
Targeting & Tracking System
Using many timers in multiplayer can slow the game down because each timer adds a separate update, which increases the CPU load.
Instead of using many timers, all updates are combined into one continuous loop. This loop handles everything such as smooth movement, collision checks, and updating attachments at the same time. This method reduces extra work and improves performance.
Movement System
X.E.N.O. had to follow a moving target and turn naturally while avoiding obstacles in real time.
X.E.N.O. smoothly adjusts its position and rotation by gradually blending its current state with the target's state, making its movement fluid and its turns natural.
Grenade Dropping System
The grenade drop point needed to remain correctly aligned under X.E.N.O.'s stomach despite movement and rotation.


A dedicated attachment entity is used. Its position offset is recalculated every frame so that grenades consistently appear to drop from the proper spot.
Damage & Health System
The health system had to run on the client while continuously syncing live health data from the server, and each user needed the ability to toggle the health bar without impacting performance.
Implement a client-side health bar that syncs health via networked variables, letting each user enable or disable it as needed. Additionally, provide immediate damage feedback by darkening the entity when hit, and trigger a multi-stage explosion on destruction with adjustable intensity.
Outcome
Project X.E.N.O. isn’t about advanced artificial intelligence, it’s all about carefully designed scripted behavior that makes it feel like a real, serious threat. Every movement, attack, and visual effect has been carefully adjusted to create a fun and challenging experience.
What are these Settings?
Project X.E.N.O. includes custom configuration settings, known as ConVars (Console Variables), that enable a server administrator or a client playing in Sandbox mode to adjust X.E.N.O.’s behavior.
These settings allow for changes to parameters such as the maximum number of active entities, health values, and event timings.
They function like switches or sliders, permitting fine-tuning of the addon’s operation without modifying the underlying code.
Server ConVar | Default Value | Description |
---|---|---|
ttt_xeno_max_active | 1 | Maximum number of active X.E.N.O.’s allowed in the round. |
ttt_xeno_announce_target | 0 | Set to 1 to announce the target in chat, 0 to keep silent. |
ttt_xeno_health | 800 | The health of X.E.N.O. |
ttt_xeno_duration | 30 | How long X.E.N.O. stays active (in seconds). |
ttt_xeno_speed | 100 | Adjusts X.E.N.O.’s follow speed: Higher values make it more aggressive, lower values slow it down. |
ttt_xeno_spawndamage | 100 | Damage dealt by X.E.N.O. upon spawning. |
ttt_xeno_deathdamage | 50 | Damage dealt by X.E.N.O. upon death. |
ttt_xeno_grenade_damage | 70 | Explosion damage of grenades dropped by X.E.N.O. |
ttt_xeno_grenade_interval_min | 0.1 | Minimum interval for dropping grenades (in seconds). |
ttt_xeno_grenade_interval_max | 0.8 | Maximum interval for dropping grenades (in seconds). |
ttt_xeno_grenade_drop_radius | 100 | Adjust the drop radius and spread of grenades dropped by X.E.N.O. The larger the ConVar value, the greater the spread. The smaller the value, the tighter the spread. |
Client ConVar | Default Value | Description |
---|---|---|
ttt_xeno_healthbar | 1 | Set to 0 to disable X.E.N.O.’s health bar, or 1 to display it. |
This project challenged my skills in:
- Real-time movement interpolation.
- Dynamic object attachment.
- Crafting responsive, AI-like behavior through scripting.
I’m really proud of what X.E.N.O.* has become ❤️, yet its design still holds significant potential for future enhancements and maybe some variations…
* X.E.N.O. - Xtreme Explosive Neutralization Organism