Narrowing the AI's FOV to allow attacks from behind

In this recipe, we will be showing you how you may be able to manipulate the AI's primary and secondary FOVs to allow the player to have an easier time to sneak up on the AI from behind.

Getting ready

  • Before we begin, you must have Sandbox 3 open
  • Then open My_Level.cry
  • Complete the Placing the Enemy AI recipe

How to do it...

  1. Change the following entity parameters on the AI Grunt that is placed:
    • awarenessOfPlayer = 0
  2. Perception sub rollout
    • FOVPrimary = 40
    • FOVSecondary = 80

How it works...

  • awarenessOfPlayer handles if the AI knows where the player is at all times. Making sure this value is false makes the AI do perception checks to see if it can find the player.
  • FOVPrimary handles the main FOV of the AI and uses a quick reaction system if the player is caught within this FOV.
  • FOVSecondary handles the peripheral vision, which uses a slower reaction system to investigate the location of where the AI spotted suspicious activity within that area.

There's more...

ai_DrawAgentFOV = 1 allows the designer to see the AI's FOV and sight range within the viewport (this must also have ai_DebugDraw = 1 turned on as well).

There's more...FOVs, AIFOVSecondary, working

See also

  • The Placing the enemy AI recipe
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.146.37.250