Game
Captive Audience

5 years ago

It Will Find You - Devlog 9: Monster AI Part 1 - The Core


Hey Folks,

So continuing last weeks discussion on the monster, and how its AI developed, I thought today i'd discuss the initial AI loop that was created as a foundation for the monster, and which laid the groundwork for the system to expand and become more complex. As this was my first experience creating an AI that worked in 3D, it was very much a learning process for me, and hopefully discussing that journey can help anyone else that's interested.

Fair warning in advance, the next few devlogs will be somewhat technical : )

As a core element of both the narrative and gameplay, it was important to ensure the Monster felt like a living entity to the player, as oppose to a generic basic AI.

The foundation of this monsters brain is a string-based state system built around the Nav Mesh Agent, that allows the monster to cycle through different states depending on what scenario it finds itself in. These states can also be referenced and called by external scripts, allowing the Master Event System to influence the monster’s behaviour as a secondary AI brain.

At the core of this system was a Nav Mesh Agent (NMA) attached to the creature, with an adjustable radius and height that could be altered as development continued to ensure the creature had free mobility throughout all environments. The NMA would then have its behaviour determined by the string state machine or external factors like collisions and behave accordingly. This presented a good base to build the AI on, as the inbuilt tools of the NMA and Unity’s navigation system meant the creature could navigate the space consistently without too many additional calculations needing to be made to compensate for tight spaces, with the baked mesh often providing all the navigation detail needed.

With this in place I began to create the core cycle the monster would work through during its active phase whilst hunting. The idea was to have an AI loop that it would move through, step by step, whilst exploring its environment that could then be deviated from when exceptions, like contact with the player, occurred. This took the form of an idle phase, a movement phase and a search phase. In the idle phase the creature would pick a random point inside of a unit sphere centred on itself, then set this as the navigation point. The movement phase would then set the NMA speed so that the creature could begin walking towards the selected point, and upon arrival it would search the spot for the player, rotating 360 degrees before returning to idle, choosing another point and repeating the process if the player was not detected. This loop was a simple but effective base on which to begin expanding, and with the creature able to move, it was time to give it the ability to chase and catch the player.

And that's where we'll leave it for this week, I hope this first insight into AI's basic foundation was interesting!

Tune in next week for more on the AI. and how it hunts the player,

Until then,

Nick

If you want to come discuss the game, have a general chat, or reminisce about Captive Audience, why not join our discord or Facebook pages, or follow us on twitter for more news!

Discord: https://discord.gg/bhgXgH

Facebook: https://www.facebook.com/ItWillFindYou/

Twitter: https://twitter.com/HeraldofLoco



0 comments

Loading...

Next up

After Captive Audience, I've worked to try and build upon the interaction system we created, improving clarity with highlighting and providing a reset option to rotation controls.

It Will Find You - Devlog 5: Environmental Effects

It Will Find you's stormy setting means there's a lot of rain, and vehicle windows needed to reflect that. Trying to get the rain drop distortion just right as the car drives into the night.

Some new environmental screenshots from the latest build of It Will Find you!

If you want to come discuss the game, why not join our community!

Discord: https://discord.gg/bhgXgH

Facebook: https://www.facebook.com/ItWillFindYou/

Twitter: https://twitter.com/HeraldofLoco

To complement the amazing voice work our actors have done, we're gradually implementing subtitles to It Will Find You. With over 50 pages of dialogue, we've got a way to go yet!

It Will Find You - Devlog 6: Interactivity PT2

It Will Find You - Devlog 7: Static and Attached Items

It Will Find You - Devlog 4: Interaction Systems

It Will Find You - From TV Set to Wild Woods

A comparative shot of It Will Find You's new environmental lighting and effects today! With a storm raging around her, Julia fights for survival against the environment, as well as the horrors within.