As you might have seen, I have been working on a turn-based dungeon crawler roguelike for a long time.
You might not know that as well as working on the programming, I have been thinking about the lore/backstory/fluff and characters for a long time also.
So far I only have three types of enemies:
- Rats - Random movement
- Goblins - Attack the player when in range
- Skeletons - Patrol but attack when adjacent
They are straightforward to implement and didn't need much in the way of enemy "AI".
Now I have a working demo, I need to plan for more enemy AI, movement, attack logic, idol defense mechanics, necromancer summoning mechanics, and thief stealing mechanics, and so on.
It's a lot, and probably not a good idea to go direct to code for this stuff.
Yes, I also have a problem with over-thinking too.
Anyway, here is my WIP planning so far!
Enemy Types and Behaviors
1. Swarmers (e.g., Rats, Vampire Bats)
- Movement: Random movement or hive mind behavior (bats move toward the player when one detects them).
- Attack: Melee attack when adjacent, but may apply a stacking debuff (e.g., bleeding, life drain).
- Variation: Some swarming enemies may split into smaller entities when attacked or reform when grouped together.
2. Bruisers (e.g., Ogres, Trolls)
- Movement: Move toward the player every 2 turns.
- Attack: High-damage melee attack when adjacent.
- Variation: Some may have an area-of-effect (AOE) attack.
3. Ranged Threats (e.g., Archers, Spellcasters)
- Movement: Stay at a preferred range (3-5 tiles away).
- Attack: Fire projectiles if line-of-sight is clear.
- Variation: Some teleport if the player gets too close.
4. Glass Cannons (e.g., Assassins, Sorcerers)
- Movement: Move fast, possibly twice per turn.
- Attack: High damage, low health.
- Variation: May have stealth (become invisible when not in line-of-sight).
5. Tanks (e.g., Golems, Shielded Knights)
- Movement: Move slowly (every 2-3 turns).
- Attack: Melee attack, possibly only vulnerable from specific angles.
- Variation: Some block projectiles.
6. Summoners (e.g., Cultists, Necromancers)
- Movement: Stay in place or move away from the player.
- Attack: Summon minions instead of direct attacks.
- Variation: Some sacrifice health to summon stronger minions.
7. Stealthy/Stalker Enemies (e.g., Phantoms, Assassins)
- Movement: Move toward the player but only when unseen.
- Attack: High burst damage, then retreat.
- Variation: Some disappear after attacking.
8. Status Effect Enemies (e.g., Venomous Spiders, Banshees)
- Movement: Move toward the player or stay still.
- Attack: Inflict poison, slow, or confusion.
- Variation: Some lay traps.
9. Environmental Hazard Creators (e.g., Magma Elementals, Cave Trolls)
- Movement: Move slowly, sometimes in a preset pattern.
- Attack: Change the terrain (e.g., create fire, block paths).
- Variation: Some break walls or flood areas.
10. Tricksters & Mimics (e.g., Chests, Statues)
- Movement: Stay still until interacted with.
- Attack: Surprise attack when the player gets close.
- Variation: Some may change locations after being spotted.
11. Elite Variants (e.g., Skeleton Champions, Goblin Lords)
- Movement & Attacks: Enhanced versions of base types with extra abilities.
12. Idol Guardians (e.g., Sentinel Statues, Cursed Knights)
- Movement: Remain near an idol but become aggressive if the player approaches.
- Attack: Defend idols with melee or ranged attacks.
- Variation: Some may be disguised as statues until triggered.
- Spawn Logic: One guardian per idol or a set number per room.
13. Necromancer & Ghost Minions
- Necromancer Movement: Moves slowly, staying at range.
- Necromancer Attack: Weak ranged magic but high health.
- Ghost Movement: Moves quickly, targeting the player.
- Ghost Attack: Melee damage but very low health.
- Ghost Special Ability: Can phase through walls only when the player is close.
- Summoning Mechanic: Necromancer spawns ghosts every few turns.
14. Thief (e.g., Shadow Bandit, Greedy Imp)
- Movement: Extremely fast, can move twice per turn.
- Attack: Does not deal damage but steals from the player.
- Stealing Mechanic: Removes keys, magic, armor, or other essential items upon contact.
- Escape Mechanic: Flees the room after stealing; can only be stopped by killing it before escape.
- Weakness: Very low health, dies in one hit.
Thief Implementation
Thief Behavior
FOR EACH thief IN room
IF Player_In_Range(thief, STEAL_RANGE) THEN
thief.Steal_Item(Player)
thief.Flee_To_Exit()
ELSE
thief.Move_Random()
END IF
NEXT thief
- The thief moves quickly and will attempt to steal from the player when adjacent.
- Once it steals, it immediately flees toward the nearest exit.
- The player must kill the thief before it escapes to retrieve stolen items.
Stealing Logic
FUNCTION thief.Steal_Item(Player)
STOLEN_ITEM = Player.Inventory.RandomItem()
Player.Inventory.Remove(STOLEN_ITEM)
thief.Inventory.Add(STOLEN_ITEM)
END FUNCTION
- The thief randomly selects an item from the player’s inventory and removes it.
- The item is stored in the thief’s inventory and can be recovered if the thief is killed.
Thief Escape Logic
IF thief.Has_Stolen THEN
thief.Move_Toward(ExitX, ExitY)
IF thief.Position == (ExitX, ExitY) THEN
thief.Despawn()
END IF
END IF
- Once the thief steals an item, it moves toward the nearest exit.
- If it reaches the exit, the stolen item is lost permanently.
Game Logic Notes
- Large enemies must consider pathfinding to avoid getting stuck.
- Swarm-based enemies should provide a unique challenge by surrounding the player.
- Bosses and mini-bosses should appear only at strategic level intervals to maintain pacing.
- Idol Guardians should dynamically respond to player actions while ensuring idol defense.
- Necromancer encounters should force the player to balance offense (killing the necromancer) and defense (fighting ghosts).
- Ghosts phasing through walls adds an extra threat when the player is close, making positioning key.
- Thieves introduce a unique challenge by stealing important resources, forcing players to chase them down.
- AOE attacks should add strategic positioning challenges.
- Different enemy behaviors create dynamic combat encounters.
That's a lot for players to keep track of. I was never too good at thinking of ideas for games. I've coded some simple ones and admire the skills of those who can get the most from a machine. Things like Elite on the Beeb were amazing.
They wont all be necessarily in this one game but I wanted to get it all documented.
You are right, I don't want it to be overwhelming, but also I need to ensure the player sticks around and has a challenge :)