• Register
Post news Report RSS Fursan al-Aqsa Dev Blog #8 - Enhanced Artificial Intelligence for Enemies

In this article I discuss the technical details of how I created various AI algorithms for my game entirely in Kismet, the Visual Programming Language of Unreal Engine 3.

Posted by on

Creating compelling Artificial Intelligence on games can be a very challenging task, as a well done AI system can make a big difference (good) for your game, whereas a bad and dumb Artificial Intelligence (many call Artificial Stupidity lol) can completely break your game.

In the last 40 years gaming technology evolved immensely in all aspects, especially in regards to Artificial Intelligence.

We can say that enemies evoluted from small pixels moving into a simple line of the screen trying to "touch" the player, or shooting some pixels against the player "spaceship", in games like Space Invaders:

To real life human behaviour in games like Tom Clancy’s Splinter Cell: Blacklist, which is considered by many a revolution. Splinter Cell is an action-adventure game that relies on stealth and strategy in the gameplay. Splinter Cell: Blacklist is a trully gem of the Stealth Genre. The opponent AI gets into the details. AI responds to every move made by the player and acts accordingly. Be it the different maneuvers in the game, the “Guard AI” is simply exceptional:

I know that for just one person, a solo developer, is almost impossible to create a very advanced AI System (in the same level of Splinter Cell) for a game. But we can do something very similar.

So it took for me almost one month of intense work, research, tutorials, and headaches :D to be able to complete the creation of the Enemies AI for my game, using Kismet, the Visual Programming Language of Unreal Engine 3.

The first step is to recognize your limitations. Because of that I decided to nail down the enemies AI behaviour to just 3 kinds of AI, which I call Enemies AI Types: Cover & Shoot, Patrol Move and Patrol Idle.

I always try to make things simple for me, as I am not by any means a professional programmer, just a crazy dude diving into the world of game development. I prefeer to make simple features which work perfectly rather than making too complex features which are broken.

The second step was to study these series of tutorials from Digital Tutors, about Creating AI Algorithms in Kismet:

Pluralsight.com

The third step, and the hardest one, was to get my dirty hands on it :D

I can't give all details, step by step of the creation of the enemies AI, but I will try to summarize it, so anyone can understand and have an idea of how it works.

The basic behaviour pattern of the Cover & Shoot AI is to move to the closest cover object as soon as it spawns (I placed manually these cover objects on the map). Then he crouches by some seconds (random value between 1 to 2.5s), then he stands up and looks for the player. If the player can be seen, he shoots at the player by some seconds (random value between 1 to 2.5s), then he crouches again. If the player can't be seen whenever the enemy is standing, the enemy randomly moves to another cover point. I can make the enemy move to as many cover points as I want, however, for the sake of simplicity, I decided to stick to 2 cover points for each enemy.

But for increasing the challenge, as I want to make my game HARD, I added a shooting function to the enemy whenever he is moving from one cover point to another. So in this translation, if the player can be seen, the enemy shoots at the player. That's very important otherwise, the player could kill the enemy by simply awaiting the soldier move to another cover point.

And the Patrol Move Behaviour is more simple. The enemy walks, patrols between two, three or four points going forth and back, walking, and if he sees the player, he shoots at him while moving to another patrol point (like evading from the player).

The last AI Behaviour, Patrol Idle, as the name says, the enemy does not move from his point. He stays idle waiting to see the player, and whenever the player can be seen, he shoots at the player, without moving from his spawn point. This AI Behaviour is to facilitate the perform of knife kills by the player, as it is hard to do the knife kills while the enemy is moving, because the knife kills code needs that the player be at a specific distance from the enemy. So with the enemy idle, it helps for this effect to work.

Last but not least, is that each AI Behaviour needs some specific character animations sets, and the setup of the enemy properties, like speed. Patrol Move has a slow speed, as it walks, does not run. It needs aswell walking locomotion animations, which is different from Cover and Shoot, which runs instead of walking (so it needs running locomotion animations), and also have the crouching and standing up animation. The Patrol Idle Behaviour has a looping patrolling idle animation.

I hope have been able to at least explain the basic idea of the enemies AI on Fursan al-Aqsa Game.

Cheers and until next update.

Post comment Comments
Bambacha
Bambacha - - 87 comments

From summary:
"a young Palestinian Student who was unjustly tortured and jailed by Israeli Soldiers for 5 years, had all his family killed by an Israeli Airstrike and now after getting out from the prison he seeks revenge against those who wronged him, killed his family and stolen his homeland."

Big oof. Don't make a tense political situation the setting for your game and dress it with the 'eye for an eye' revenge scheme.

That is the first game I've heard of that makes me hate the protagonist and root for his demise. Well done.

Reply Good karma Bad karma+1 vote
udkultimate Author
udkultimate - - 232 comments

Hello dude. I am happy, because at least the protagonist of my game caused some feelings on you. I am sure if you play the game, you will hate the protagonist even more, because you will see how bloody and thirsty for revenge he is on the way he kills his enemies, without any kind of mercy lol.

I am sure you will enjoy this game.

Cheers!

Reply Good karma+1 vote
Serygala
Serygala - - 548 comments

Haha! The blue print screenshots scare me :D
But you seem to got it down! Best luck with this further :)

Reply Good karma Bad karma+1 vote
udkultimate Author
udkultimate - - 232 comments

Hello dude! Yeah, I was also scared at first, but then, you get used to it lol. I am doing a lot of things in Kismet, instead of Unreal Scripting. Sometimes I create some unreal scripts functions and call them in kismet.

Kismet is very intuitive, and excelent tool. All the gameplay logic is done directly on kismet (blueprints).

I still remember the old times of FPI Scripts and states. By the way, my first contact with game programing was with FPI Scripts. Now it changed to LUA, right.

Good old days of FPS Creator. I miss it too much.

Cheers :D

Reply Good karma+2 votes
Guest
Guest - - 688,627 comments

Great work! I can't wait to buy the game! Free palestine

Reply Good karma Bad karma0 votes
udkultimate Author
udkultimate - - 232 comments

Thanks my friend for your interest in support me, that means a lot for me. Stay connected, untill march I will release a first playable build of this game. Cheers!

Reply Good karma+1 vote
Post a comment

Your comment will be anonymous unless you join the community. Or sign in with your social account: