Devlog 3: Creating Smart Enemies
Author: ben,
published 2 months ago,
Along with levels and weapons, enemies are one of the toughest but also [b]most crucial design elements when it comes to making a first-person shooter game.[/b]
Prior to working on IHAS, I didn’t have a lot of game design experience, so I taught myself the ins and outs of creating enemy AI using [b]books, video tutorials, and lots of experimentation.[/b] In this dev log, I’ll give you a rundown of how I taught myself to create the smart enemies in IHAS!
[u][b]Smart Enemies[/b][/u]
In an FPS game, enemies create an engaging experience, and their behaviour can make or break immersion. [b]A "Smart Enemy" doesn't necessarily mean having to be highly advanced & intelligent. Instead, they need to feel natural and integrated into the game world you're building. [/b]
This involves more than just AI; it's about [b]making sure enemies react and move in ways that are believable[/b]. Technical issues like T-posing or unnatural movement patterns can pull players out of the experience. Ultimately, smart enemies don’t need to be complex — they just need to [i]seem [/i]smart, reacting in ways that feel intuitive and aligned with the player's actions.
[u][b]Creating the AI in Unreal[/b][/u]
I booted up the Unreal Engine and began by giving enemies [b]basic movement, allowing them to navigate the levels I had created[/b]. After that, I added [b]perception so they could sense their surroundings and react[/b] accordingly. To tie it all together, I used [i]behaviour trees[/i]. Behaviour trees are sort of like [b]decision-making flowcharts[/b], which helped me organise the AI's actions and behaviours.
[img]https://clan.cloudflare.steamstatic.com/images//43140933/c39c0c380f108dfa772dca2e4447e49dda450b39.png[/img]
For example, if an enemy spotted the player, it would immediately attack. I added sequences and made them capable of handling multiple tasks at once, like moving and attacking simultaneously. It was a simple but effective way to bring my enemies to life.
[u][b]Creating 9 Enemy Types[/b][/u]
With the AI set up, I moved on to [b]creating models for each enemy[/b], and I quickly bumped into a major problem. I had 3D modelled five enemy types and four unique bosses and began to create their respective AI. With 9 different behaviour trees in place, [b]adapting even minor tweaks across all enemies became tedious, often leading to buggy behaviour. [/b]
[img]https://clan.cloudflare.steamstatic.com/images//43140933/f8f6136803c35f4109e7de793c79536ba0dd2e0c.png[/img]
To solve this, I [b]rebuilt the entire AI system[/b], giving each enemy its own unique attack patterns. Some enemies ended up behaving quite differently from others. For the bosses, I combined various elements from the smaller enemies' behaviours, which made them feel more complex without starting from scratch.
I definitely encountered a steep learning curve when it came to creating the enemy AI for IHAS. But I felt motivated by the constant trial and error and figuring it all out in the end felt incredibly satisfying, partly because it finally tied the visuals together with the gameplay!
Stay tuned for more insights in the next devlog!
Vladyslav
--------------------------------------------------------------------------------------------------------------
[b]The Difference Studio[/b]
[list]
[*][url=https://x.com/The_D_Studios]Twitter[/url]
[*][url=https://discord.com/invite/PZVgAkrsaY]Discord[/url]
[*][url=https://www.tiktok.com/@the_difference_studios]TikTok[/url]
[*][url=https://www.youtube.com/@thedifferencestudios]YouTube[/url]
[/list]
[b]Iceberg Interactive[/b]
[list]
[*] [url=http://www.twitter.com/iceberg_int]Twitter[/url]
[*] [url=https://www.tiktok.com/@iceberg_int]TikTok[/url]
[*] [url=https://www.facebook.com/iceberginteractive]Facebook[/url]
[*] [url=https://www.youtube.com/iceberginteractive]YouTube[/url]
[*] [url=https://store.steampowered.com/publisher/iceberg]Steam Publisher Page[/url]
[/list]