Forbidden areas

Where forbidden boundaries fail to keep the AI from going into certain locations, forbidden areas are used instead. This recipe will teach you how to utilize the forbidden areas to block off the areas that the AI entity should not go to.

Getting ready

  • Before we begin, you must have Sandbox 3 open
  • Then open My_Level.cry
  • Place down one Grunt AI
  • Place defaultprimitive_cube.cgf as a brush down near the Grunt AI

How to do it...

  1. In the RollupBar, click on the AI button.
  2. From the Object Type, select ForbiddenArea.
  3. With the Follow Terrain enabled, click four points roughly in a square around the primitive_cube.cgf.
  4. On the Forbidden Area Params, set DisplayerFilled to true.
  5. Generate the AI navigation.
    How to do it...

How it works...

You may have noticed that without the forbidden area present around the box, the AI Grunt takes a significantly longer time to find a path to the player and may even get stuck running up against it if the player is behind the box. This is because the AI does not know of the box's existence and needs to be told to navigate around this area. Once the forbidden area is marked up around the box, the AI will have very little trouble navigating around the object to find the player.

Similar to forbidden boundaries, forbidden areas act as a stronger barrier against the AI from entering into them. If the AI manages to enter these forbidden areas, then the default AI behaviour, if active, will alert them to seek the nearest edge of the forbidden area to exit the area as quickly as they can.

See also

  • The Forbidden boundaries recipe
  • The Debugging the AI triangulation recipe
..................Content has been hidden....................

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