The enemies in U.R.S.T. are driven by a lightweight but highly capable state machine. It is made to be identical to retro shooter games such as DOOM and Hexen. However they don't just blindly walk toward the player, they utilize 180-degree cone vision, line of sight raycasting, and built in strafing logic to dodge and weave as they chase their target.

The enemy system is designed to be as flexible as possible. Instead of duplicating complex code for every enemy, enemies are created using Custom Resources similar to the Weapon system. This means that the enemy system is split into two parts:

Brief Video Guide: https://youtu.be/Oa7AARwOMIQ


⚒ Creating a New Enemy

You should never (and I mean it!) directly edit the base RetroEnemy.tscn file. Instead, you create new enemies by inheriting it and plugging in a new resource file. Here is quick and easy 3 steps to create a new enemy, it takes seconds to do it:

Step 1: Inherit the Base Scene

  1. In your FileSystem, locate res://Core/Core_Prefabs/RetroEnemy.tscn.
  2. Right-click the file and select New Inherited Scene.
  3. New tab with scene will open, save (Ctrl + S) this new scene in your User_Assets folder (for example MutantGuard.tscn).

Step 2: Create the Enemy Resource

  1. Right-click inside your User_Assets folder and select Create New > Resource.
  2. Search for RetroEnemyResource and create it (name it for example MutantGuardStats.tres).

Step 3: Connect Them Together

  1. Open your newly created MutantGuard.tscn scene.
  2. Select the root node and look at the Inspector.
  3. Drag and drop your MutantGuardStats.tres file into the Stats slot under "Enemy Settings".

You now have a brand new functional enemy ready to be customized (Yay!).