Ultimate Guide for Unreal Engine 5 AI and Unity AI

Does Unreal Engine Use AI?

Unreal Engine includes AI behavior trees. These select from different behaviors based on conditions in the world. These behaviors include pathfinding, movement, sight, hearing, etc.

Are you using your AI? Don’t make a game without Character Models, no one likes the Unreal Mannequin.

How to create an enemy in Unreal engine?

It’s actually pretty easy to create Enemy AI, just track down a useful tutorial and get going. You can also buy asset packs to greatly speed up the process.

Ok, so the first thing I want to talk about is the difference between Unity AI and Unreal AI, and to do that I’ll start with and overview of what’s build in out of the box in both, and some of the better AI solutions on offer.

You can also check out our game dev course, right here at gamedev.gg :

UNREAL AI

In Unreal, you are spoilt for choice when it comes to AI. There is no shortage of AI solutions on offer, from simple to complex, however, if you do not want to purchase them, you’re not out of luck, not at all.

Unreal out of the box comes equipped with a fully functional AI system based on behavior trees. You can use the preprogrammed behavior nodes, or you can make your own nodes. The AI will move down a hierarchical list of behaviors, you can control when and how they move from node to node, you can control what factors manage entry into a node or just skipping it over.

You can create very complex behaviors with this, right down to:

1: No Player Character in Sight, Patrol.

2: Player Sighted, attack.

3: As combat ensues, spout dialogue at the player while ducking behind cover.

4: Player gets AI down to 30% of life, begin singing songs of victory.

5: You are at ten percent of life, walk up to the player and start a dialogue.

6: Ask the player to spare you, with a yes/no UI interface.

7: The player spares you, begin a half hour dialogue tree.

All of this is feasible without too much difficulty in a behavior tree.

Much as I am brilliant and good, check out the Unreal Docs for the real scoop on how behavior tree’s work. It is too broad a topic for my 2000 word article to cover in fullness.

NPC MANAGER

https://www.unrealengine.com/marketplace/en-US/product/npc-manager-system

NPC Manager is a really good AI solution for Unreal. It can create complex crowds of characters who are reactive to their surroundings. They have points of interest, tasks and behaviors, waypoints, roaming, pathfollowing, go to location, or craft your own custom tasks. They are fully animated, you can plug in your own characters to make whatever you want, they take damage, run, etc. They even have dialogues between each other. They also have static and spline based crowds, so if you want a Persona 5 style crowd walking through your levels, they have that.

The same developer also makes Procedural City Generator, and he is very responsive to questions and issues. He’s currently working on big update which will make it a lot easier to spawn in a whole bunch of NPC’s into your city. You can already do it but the process is time consuming, he’s working to streamline it.

His long term goal is to allow you to make your own GTA clone, and he’s already halfway there.

AI DAILY LIFE

https://www.unrealengine.com/marketplace/en-US/product/human-life-ai

A more budget conscious option is AI Daily Life. You can pick it up for less than 30 dollars on sale, it’s not as all expansive as NPC Manager, but it’s a serviceable little program and the AI’s behaviors are cute.

Note it is somewhat difficult to use your own characters with this system, nevertheless it is a good AI system on a budget.

The AI’s have occupations, they go about their jobs all day, until they’re done working, then they go home and relax, they eat, they talk with each other, and the go to sleep, then wake up and do it again.

EASY SURVIVAL RPG v2.5

https://www.unrealengine.com/marketplace/en-US/product/easy-survival-rpg

To call this an AI solution would be doing it a disservice, this thing has everything you need to make your own survival RPG game, it has ballistics, lots of different weapons, melee and ranged, is has all the systems you need for a game coded in. It’s got a minimap, it’s got all your combat and crafting and research and stat systems built for you. I could go on for hours but this thing has EVERYTHING.

The price is not cheap, but when it comes to a good framework for making your game, honestly with money comes value, and long term it is worth the investment.

Among other things, it has a very nice AI system coded into there. You can make your own enemies, and they’re really smart and interesting, they can fight in different ways, or just be static NPC’s or questgivers. It really is worth considering, and I bought it within one day of learning about it.

UNITY AI

Unity doesn’t have any AI built into it out of the box. If you want your enemies to do something, you have to code every little bit of it, like the movement, the raycasting, ballistics, damage, hit points, etc.

I coded a little game that was kind of like Hotline Miami if you had 7 lives, I correctly mimicked their AI patterns in full, and created a serviceable clone of it.

However, most people don’t go that route, and on a more professional game neither did I. So you are generally going to go for one of the AI packs on offer on the Unity Asset Store.

Here are a few of your options….

https://assetstore.unity.com/packages/tools/ai/emerald-ai-2-0-40199

Emerald AI 2.0

Pretty much the best AI solution for Unity, this is Emerald AI 2.X . It is a serviceable AI engine, which is to say, while it has it’s problems, it does a good job at what you need it to do.

Let’s go over some of the features. You have combat, both melee and ranged. You can create your own enemies with whatever humanoid rig you have available You can spawn hundreds of them, depending on your hardware setup. You can program in factions, so the enemies like or dislike each other based on their faction. You can create a reputation system if you know Emerald AI well. You have different behavior patterns, you can control aggressiveness, attack range, movement speed, create passive civilian AI, with Love/Hate you can even make a pokemon style breeding game if you want. Actually on it’s face this program has almost everything you could want in an AI resource.

So what’s the problem? – Stability

The issue with Emerald AI is that it can be quite unstable. Getting it to work with other asset packs can be a pain, and making your own enemies becomes so complex sometimes you just can’t tell why they broke.

Other times you will be discovering that if you put too many Emerald AI’s on screen at once, you have big performance hits in terms of framerate, and you also will discover the AI’s will, I don’t know how to put this, wait their turn before acting.

Often they will just stand there doing their idle animation, paralyzed and not moving…. Then all of a sudden out of the blue, they will run up to an enemy faction character and attack them.

If you position things in the middle, this will result in some slowdown, but most of the time someone is doing something interesting, and you will occasionally be attacked when passing an enemy.

I would encourage you to turn your enemies to ranged attackers, because this can cut down on the difficulty when attacking.

https://assetstore.unity.com/packages/tools/visual-scripting/behavior-designer-behavior-trees-for-everyone-15277

Behavior Designer

I haven’t worked with this one yet, Behavior Designer has integrations with Ultimate FPS Controller. Which I purchased, but I quickly learned my machine wasn’t up to the task of getting my Daz Characters imported into the game, it simply crashed with memory issues.

However, that said, it does look like an ok behavior designer, it works through behavior trees, you have all these nodes with preprogrammed behavior worked into them, then you use a hierarchical tree of connections to design everything you want your AI to do.

The issue?

As I understand it from others who have used this product, Stability is a BIG issue. I’ve heard horror stories of months of work being corrupted beyond repair by the use of this asset. I was going to ignore such naysayers, and try it for myself, but when UFPS turned out broken, I was unable to proceed further.

https://assetstore.unity.com/packages/tools/game-toolkits/ultimate-character-controller-99962

Opsive Ultimate Character Controller

This is a good controller, from what I got it to do, it really feels a lot like you’re making Half Life 2, it’s got every weapon you could need, it’s got cars, it runs beautifully, it looks beautiful, in third person or in first person, swappable, you can import your own characters, it’s VERY hard to set them up correctly, the game crashes on the use of my own imported characters.

I think I need a better PC, but I will still be sticking to Unreal anyway. Unreal outclasses Unity in every way.

BOLT

https://assetstore.unity.com/packages/tools/visual-scripting/bolt-163802

It is worth mentioning you can also program you AI in bolt, which is a visual scripting engine which was added to the UNITY Package Manager and shipped by default in all new versions of Unity. It is not an AI engine, but it can be used to build AI.

CONCLUSION

Overall Unreal is in a class of it’s own, not just when it comes to AI, but in everything. Unity is a nice program, and you won’t be wasting your time if you develop in it, but here at Gamedev.gg, we have a clear favorite.

Unreal.

Related Articles

Responses

Your email address will not be published. Required fields are marked *