Sunday, February 18, 2018

Top Down Stealth Toolkit FAQ #2

Q: I want to change the size of the vision arcs. Where can I find the variables that control it? Is there a way to do it from the editor window?

A: You can customize the radius & angle of vision arcs for all types of AI through their perception components. The toolkit uses a custom AI Perception system (BPC_AIPerception) that enables the AI bots to perceive different types of stimuli. It basically allows for four different types of perception (for further details, check out Top Down Stealth Toolkit Basics: AI Perception), out of which the Visual Perception system is responsible for hosting the parameters that determine how far & wide a bot can see. And these include the 'VisionRange' & 'HalfVisionAngle', which among other things, also control the size of the Vision Arcs.

Ideally, these variables could be made public (instance editable) and thus enable customization directly through the editor. However, due to an engine bug (https://issues.unrealengine.com/issue/UE-46795) that automatically resets public struct values stored in components, I had to revert it back to being editable only from the parent blueprint to which the component is attached. So this means that the aforementioned attributes will require editing through the details panel of perception components in AI blueprints (as shown in the screenshot below). Doing so will instantly apply the changes to all actors of that particular AI class.



I understand that this is a bit tedious compared to directly editing these attributes from the editor details panel, but Epic has marked the bug as fixed for the v4.19 release. So if the fix does make it into the final release, it should then be possible to set the variable to public and directly test out changes through the editor itself.