Hi, my name is Dennis Karlsson and I am the leader of the group of students that develops Project Smile with Unreal Engine 4. The project has now been in development in about a week so we have seven weeks left. All of us in the team will be writing devlogs here on Game Jolt about our progress on the project and how that progress has been achieved. First off, I would like to tell about our plans for the project.
Project Smile is a first-person horror game mainly inspired by Outlast and Alien: Isolation. Like those games Project Smile will feature an enemy that you can’t kill, an enemy that will try to find and kill you. You as the player will be able to hide in hiding spots: inside lockers, under beds, and behind curtains for example. You will also be able to defend yourself by scaring the enemy off with light.
What makes this game special is that the AI will learn from the player. If the AI finds you inside a locker, it will learn that the player prefers lockers and will then mainly search that type of hiding spot in the future. The AI will also get more used to the light if you use it too much, so you will need to be more aggressive if you want to scare it away.
In addition to being the group leader I will be programming the sole AI of the game. I’ve made some progress already that I will share with you below. I am also the lead story writer. There will be some pages to find in the game that tells the backstory and we are hoping to have enough time to add a couple of cutscenes and scripted events for opening and ending the game.
Now it’s time to tell you what I’ve done so far with the AI. Firstly, I wanted to make the AI be able to patrol a certain area by giving it points to go to and orders for what to do at the point. For now, the AI will rotate between two angles to scout for the player.
I have used Unreal Engine 4’s Behavior Tree and Blackboard systems for making it do tasks in a specific order. The blackboard also stores what path node it wants to go to next. Firstly, it moves to that path node that is placed on the map. It will find its own way with the NavMesh system in the engine.
When a node has been reached it will check what type of node that was reached. At the moment there only is two; a “room node” and a “search node”. The “room node” functions as a main node for an entire room that connects other nodes within it. When this type of node is reached the AI won’t have any specific task except wait for a second. When a “search node” is reached the AI will stop and rotate between two angles that is stored in the node.
When a task is completed it will set the next node to go to. All nodes store a reference to another node which represents what node the AI should go to next. The AI gets the reference and stores it in the Blackboard so it can know where to go next. The “room node” is a bit different since it stores both another “room node” and a “search node”. Therefor it will check if this “room node” already has been reached. If it hasn’t reached it the “search node” is selected. If it has, the next “room node” is selected.
At the moment the patrol system is almost finished and has two problems that needs to be solved. The most important problem is that when it scouts, it won’t rotate continuously. The rotation seems to be set to the first angle and then the other after a while, you can see this in the GIF below. This happens because I rotate the character in a while-loop that doesn’t show the rotation until it’s finished. I plan to fix this by making a custom event in AI controller that rotates it with a Timeline. Timeline is unfortunately not available in Behavior Tree Tasks.
The other problem is that when a “room node” is reached, the AI will choose to go to the another node than the one assigned. It is always the node that the first “search node” has stored so there is probably something obvious that I have missed. I’m sure I will find the reason soon. When all problems are solved with the patrolling I will make sure that the AI can detect and hunt the player.
So this is how far I’ve come so far personally with Project Smile. My fellow group members will also share their own progress too soon so be sure check it out!
Dennis Karlsson
0 comments