School Project 3:

He from the pines

Solo horror story game where you, a storybook author looking for new inspiration for a new book. You wander around in a forest and follow the wisps that bring you to your next picture location. As you take more pictures of supernatural anomalies the guardian of the forest gets mad and tries to hunt you down.

Info

   

    Role: AI Programmer


    7 weeks


    12 team members


    Engine: Unreal Engine


    Programming Language: C++ / Unreal Engine Blueprint


    Device: PC


My Contribution


AI Pathfinding

For the AI I created a character and used the AI MoveTo function to simply move to an actor in the world. Since we wanted multiple control points for the AI I had to make an array and put all the actor locations into it. I'm using an incrementing loop to change the AI MoveTo target each time it reaches it's goal. Since it's incrementing the value until the length of the array is reached, it means that you can edit the array to any length.


AI State Machine

The state of the AI depends on the Unreal Engine character component "PawnSensing". The component adds alot of senses to the character. The senses includes sight and hearing. I had it set up so that while the player was in the vision cone of the AI, it would go towards the player. But if you broke direct line of sight, the AI would go to the last known location of the player. The same would happen if the player took a photo, this would alert the monster and make your position known. And after roaming the spot for a while it goes back to patrolling the control points. So the state machine functioned like the flowchart I'm showing on the side.


AI Behaviour

The AI flies up in the sky and travels to the first patrol point on the map, flies down and starts doing two things, it either starts looking around randomly or walks straight in different directions. After it has done those two tasks it flies to the next patrol point and so on. 


When or if the AI loses sight of the player and has finished patrolling the area of where the player was last seen, it goes back to the current task. 


The AI starts moving faster and faster when the player completes tasks until eventually the player can't keep up with the speed of the AI and loses. The player can escape but has to play more strategically to avoid the AI. 


Extra Features

The AI does one of three screeches randomly during the game. This could alert the player about the AI's whereabouts. When the AI is chasing the player it crawls on the ground using its wings, which gives out a crunching grass noise. 

What I learned

During this game project I got to familiarize myself with Unreal Engine for the first time. At first it felt more complicated than Unity, but as you got more and more familiar with Unreal Engine it became much easier to solve different tasks. I feel like during this project, I refined my communication skills by interracting alot with the other programmer. I also learned more about statemachines and Unreal Engine's Blueprint coding system.