YouTube
Videos
Programming, game development, Three.js, ECS architecture, gaming and long-form technical tutorials from AgentRuss.
Latest Upload
Latest from AgentRuss

Build an Encounter & Wave System in ECS | Spawn Enemies in Waves | Ep 43
Discord: https://discord.gg/Zvkk8Gr Twitch: https://www.twitch.tv/agentruss Website: https://agentruss.tv/ 📺 Watch the full playlist here: https://www.youtube.com/playlist?list=PLf1-5JViTP7AHmUNeUWft4bdSmLNj4q40 In Episode 43 of this ECS game engine series, we build the first version of a real encounter and enemy wave system. Instead of manually placing every enemy in the level, encounters now wait for the player to enter a trigger area, spawn enemies in waves, track when each wave has been defeated, and automatically advance to the next one. In this episode, we: - Create an Encounter component to track runtime encounter state - Add EncounterMember to associate spawned enemies with their encounter - Add DespawnOnDeath so wave enemies disappear instead of respawning forever - Create a data-driven EncounterDatabase - Define multiple enemy waves using our existing enemy variants - Build an EncounterFactory for spawning encounter entities - Update the EnemyFactory to support both normal respawning enemies and encounter enemies - Create DespawnOnDeathSystem for encounter cleanup - Build the main EncounterSystem for trigger detection, wave spawning, wave completion, and progression - Add an Encounter UI showing the current wave and enemies remaining - Replace manually placed enemies in the test level with a real encounter The important part is that the encounter system does not need special logic for every enemy type. It simply reads the encounter data and uses the existing EnemyFactory, AI, damage, death, loot, status effect, targeting, and UI systems. By the end of the episode, walking into the encounter area starts Wave 1, defeating that wave advances to Wave 2, and the encounter continues until all three waves are cleared. This gives us the foundation for things like combat rooms, enemy camps, arenas, dungeons, quests, and wave-based encounters. In the next episode, we can build on this with encounter rewards, so completing all waves can grant coins, items, experience, or unlock something in the level. If this series is helping you understand ECS and game engine architecture, consider subscribing and following along as we keep building the engine from scratch. #ECS #GameDev #JavaScript #ThreeJS #GameEngine
Watch on YouTubeTutorial Series
Three.js ECS Game Engine
Follow the complete game-engine series from ECS fundamentals through increasingly advanced gameplay systems.

Building a 3D Game Engine from Scratch in JavaScript (ECS + Three.js) | Episode 1

Building the ECS World — 3D Game Engine from Scratch (JavaScript + Three.js) | Episode 2

Systems & Delta Time - Make ECS Move! (3D Game Engine from Scratch) | Episode 3

Render System - Turning ECS Data into Visuals (3D Game Engine from Scratch) | Episode 4

Engine-Style Input Pipeline - Player Controller + Jump Buffer (JavaScript + Three.js) | Episode 5

ECS Camera Follow + Correct System Order (Smooth Movement) - 3D Engine from Scratch | Ep. 6

Real Collisions & Walls (AABB Physics) - Building the Game World | 3D Engine from Scratch | Ep. 7

ECS Lighting + Shadows (No Hardcoding) — 3D Engine from Scratch | Ep. 8

Capsule Collider Character Controller (ECS) + Control Modes (Face Move vs Strafe) | Ep 9

Third-Person Orbit Camera + Mouse Look (ECS) — 3D Engine From Scratch | Episode 10

ECS Aim System + Camera Data Pipeline (Strafe Mode Fixed) — 3D Engine From Scratch | Ep. 11

Character Controller Polish — Step Offset, Slopes & Wall Sliding | 3D Engine From Scratch | Ep. 12

Building a REAL Test Level (Stairs, Slopes & Corners) — 3D Engine From Scratch | Ep 13

Fix Third Person Camera Clipping (ECS Camera Collision System) | 3D Engine From Scratch | Ep 14

Over-the-Shoulder Camera + Polish | 3D Game Engine from Scratch (ECS) – Ep 15

Event Bus in ECS (Publish/Subscribe + Double Buffering) | 3D Engine From Scratch — Episode 16

Event-Driven Damage + Fixed Timestep (60Hz Simulation) | 3D Engine From Scratch — Episode 17

Event-Driven Death & Respawn System (ECS + Event Bus) | Ep 18

Add Checkpoints + Health Bar UI (Event-Driven ECS) | Ep 19

Build a Reusable Interaction System in ECS (Press E to Interact) | Ep 20

Build a Pickup & Inventory System in ECS (Press E to Pick Up) | Ep 21

Build an Item Definition Database for Inventory Systems (ECS) | Ep 22

Use Health Potions with an Event-Driven RPG System (ECS) | Ep 23

QuickBar UI for a 3D RPG Inventory System (ECS) | Ep 24

Build an Inventory Panel UI with Mouse Selection (ECS) | Ep 25

Add Use & Equip Buttons to the Inventory UI (ECS) | Ep 26

Equipment System + Equipped Weapon UI in ECS | Ep 27

Build a Real RPG Stat System in ECS | Equipment Modifiers & Final Stats | Ep 28

Make Stats Affect Combat in ECS | Attack, Defense & Damage Formula | Ep 29

Armor Now Reduces Damage! Add Body Slot Gear in ECS | Ep 30

Fix Health Bar UI in ECS | Player HUD + Target Health Bar | Ep 31

Add Floating Enemy Health Bars in ECS | World Space UI | Ep 32

Improve Target Selection in ECS | Sticky Camera-Aware Targeting | Ep 33

Add a Target Ring in ECS | Selected Enemy Indicator | Ep 34

Add Hit Flash & Damage Numbers in ECS | Combat Feedback Upgrade | Ep 35

Build Your First Enemy AI in ECS | Idle, Chase & Attack System | Ep 36

Build Enemy Death & Respawn in ECS | Corpse Linger + Clean Respawn | Ep 37

Add Enemy Loot Drops in ECS | Real RPG Reward Loop | Ep 38

Add Item Rarity & Gear Quality in ECS | RPG Loot Upgrade | Ep 39

Build an Ability System in ECS | Action Bar + Cooldowns | Ep 40

Build a Status Effect System in ECS | Poison, Regen & Damage Over Time | Ep 41

Build Data-Driven Enemy Variants in ECS | Grunt, Swift, Tank & Venom | Ep 42

Build an Encounter & Wave System in ECS | Spawn Enemies in Waves | Ep 43
Recent Uploads
More Videos

Build Data-Driven Enemy Variants in ECS | Grunt, Swift, Tank & Venom | Ep 42

Build a Status Effect System in ECS | Poison, Regen & Damage Over Time | Ep 41

Build an Ability System in ECS | Action Bar + Cooldowns | Ep 40

Add Item Rarity & Gear Quality in ECS | RPG Loot Upgrade | Ep 39

Add Enemy Loot Drops in ECS | Real RPG Reward Loop | Ep 38

Build Enemy Death & Respawn in ECS | Corpse Linger + Clean Respawn | Ep 37

Build Your First Enemy AI in ECS | Idle, Chase & Attack System | Ep 36
