Friday 22 January 2016

Coding - AI Sight - John Howard

Task

To create a sight script which allows the AI to recognize when the player is in sight.

Overview

To create this script I admit I took a lot from the stealth tutorial sight input. In fact is the exact same script modified. Using a collider to initialize the script and taking a slice of the collider to act as the cone of vision. This then turns on and off the playerinsight bool. This enables me to have a strong starting point to edit the code. The notion of vector3s along with angles towards the player have got me thinking about ways to set this up in a much better ways as this current setup has some vital flaws. For example the cone of vision is the only sight section so peripheral vision doesn't exist and the notion of a collider being dragged back and forth feels a tad outdated. But for now the code does the job and enables me to set up the statemachine and then chase/search scripts. Since this is such a temporary script I shall forgo sharing the script here, also because its available on the stealth site, however once i have researched into raycasts and angle finding much more I will present the newer sight model I have in mind.


No comments:

Post a Comment