Giving our AI choice

In this chapter, we focused on creating AI with multiple states using Behavior Tree. We also talked briefly about using EQS on the dog to randomly choose an area within its location. This particular example was simple, but when you begin to use filters, the power of EQS shines.

For example, you wanted to get all the enemies within 500 units of your location and eliminate those who aren't within the line of sight. Then, we cleared any enemies not within a 60-degree view angle. Lastly, we got the one closest to the character.

In Blueprint, this can be done, but it then requires you to put it in either Blueprint Library or a node. If we make it in EQS, we are only required to create the conditions in the UI. However, it's easier to share and doesn't require any scripting.

Let's compare using EQS and Blueprint to sense the environment.

The pros and cons of using EQS

The following is a pro:

  • No blueprint is required, and it is more intuitive to specify conditions

The following is a con:

  • It is limited to the available options in UI

The pros and cons of using Blueprint

The following is a pro:

  • There is maximum flexibility for implementation

The following are the cons:

  • You must create it from scratch
  • It is more difficult to reuse

EQS is a very powerful tool when the purpose of the tool is fully understood. It is capable of quickly and precisely querying a scene without the need to juggle any blueprint code. Paired with blueprint code, you can unlock its true purpose. You can create interfaces, which can be used in the EQS computations, and get the results you want, such as the safest unoccupied place for an AI to run for cover to.

..................Content has been hidden....................

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