Wednesday 27 January 2016

Coding - Patrol Revamp - John Howard

Task

To overhaul the patrol into a better format

Overview

Overhauling the patrol code was something I mentioned previously. Now as of the moment the patrol code is running as a simple void function. However the function updates itself upon reaching different destination and needed a wait time. So it made sense to bring the code out of a void function and into a coroutine. By doing this I have allowed the patrol to be called once and therefore allow the calling to travel through each component one at a time. This allows it to update only when necessary and provide a pause at the end for the AI to stand before carrying on its assigned path. Furthermore this means I can call the routine once from the TranstoNoAlert state and thus maintain minimal constant calls. This overhaul is a very strong iteration I feel and development is most likely not going to be required on this script as it is already rather well laid out.
Code

No comments:

Post a Comment