top of page
Search
Writer's pictureFox Forge

Procedural Content: Developing complex AI for a Horror Game | C#

Updated: Apr 25

After starting this project in my first year of university, I have learned many techniques independently during this project which have helped me grow as a game engineer.

Being a horror game, it is staged in an asylum where there is one very smart Agent who is trying to find the player. The aim of the game is for the player to find the exit and escape before they have gone insane, or before they have been hunted down by the AI. I took a lot of influence from games such as Alien isolation and Slender: The Arrival when designing this game.


The game went through a few different names in it's time (since it's quite an old project now) but was mostly named as "Are You Sane" with the frighting agent being called "Little Annie" taking the form of a psychotic young girl.





I identified that many horror games fail to give players the same feeling when replayed. This is simply due to players knowing what will happen at various points throughout the game with scripted events and similar scenarios where they cannot feel the same fright and emotions they once had. Therefore I chose the core concept of my game to revolve around procedural generation and to make the player fear the unknown as everything within the game can change around them. Although this was daunting, I have a good understanding of what games are missing for their ideal target audience and I set about learning the ways to achieve the features I wanted.


Demo


For the demo, I have increased the lighting levels, because of this you will also be able to see the dynamic occlusion I made. Since I had control of every structural piece of the building, I took advantage of it and created a system to phase in and out pieces without affecting the agents path finding. This could potentially mean that while using high quality textures and assets, I might maintain a stable frame rate, if I were to create this into a full game.


For demonstration, I run around the building using keyboard input to regenerate the building. Ideally, the AI would do this but I am just showing a demonstration of it working. I will also bump into the agent and show how the path-finding works smoothly with the random generation. I attempt to run away from the agent, followed by regenerating the floors, and then proceed to find the agent still attempting to find me. (I have kept the demo in editor view so you can see the building regenerating in scene)


Currently as it stands, the game is functional as a proof of concept. The building can dynamically change around the player and gives the AI some tools to manipulate the building to its advantage. This generally comes in the form of deception, where the AI can block stairwells with a wall; making the player believe they are either on the top floor or bottom floor. Alternatively, the AI can also do this to trap a

player on a floor with them.


The building was constructed with my own set of logical steps. When regenerating, the floors can change size, layout and path from one stair case to the next. The construction blocks were created in a modular fashion and it's very easy to choose which "type" of room and scenery to use, and so this was also added into the random generation.


The AI architecture


I knew that my agent would need some type of architecture to deal with complex behaviour. As a result, I went about learning the ins and outs of behaviour trees and developed my own with some additional useful features. In the end, my behaviour tree could deal with priority tasks and even apply weights, which could have some type of function to select which branch of tasks to choose.


Before I lay the project to rest, I had a bit of fun with putting VR into the game. It amazed me how much more intense the gameplay was combined with random generation.


VR and Procedural Content Influence on Horror Games


Personally, I found it was thought provoking about the ethics of VR horror games. All VR games show warnings and hazardous enquires about simulation sickness and physical concerns of falling over and hurting yourself in real life. However, I have yet to see many VR games which address the mental and psychological concerns that some gameplay elements may entail.


If it wasn't for the ethical issues and the scale of project to take on, I would consider a research project into traumatic experiences created through VR horror games, and how far they can be pushed before they are restricted on the market.


With the increase in immersion and realism which the industry is heading towards, I believe it's only a matter of time before this issue is raised, but I look forward in anticipation to the solutions and possibly even some crazy games to try for myself!

30 views0 comments

Recent Posts

See All

Comments


bottom of page