Could Someone Give me Advice on Implementing Advanced AI for Enemy Behavior in My GDevelop Platformer?

Hello there,

I am working on a platformer game using GDevelop; and I am aiming to create some more complex enemy behavior to make the gameplay more challenging and engaging. I have managed to implement basic AI; such as enemies moving back and forth or following the player; but I am now looking to take things a step further.

Specifically; I want to create enemies with different levels of awareness. For example; I would like to have some enemies that can detect the player from a distance and react by either fleeing or attacking, depending on the situation.

I am interested in setting up patrol routes for certain enemies; where they can stop and look around before continuing their patrol; adding an element of unpredictability to their movements.

How can I create and implement patrol paths for enemies? :thinking: Is there a way to make them pause at certain points or change direction based on the players position? :thinking:

What would be the best way to implement a vision cone or detection radius for enemies, allowing them to notice and react to the player from a distance? :thinking:

Also, I have gone through this post; https://forum.gdevelop.io/t/i-need-help-improving-my-enemy-ai-code-top-down-shooter-minitab/ which definitely helped me out a lot.

How can I create a system where enemies decide between fleeing or attacking based on certain conditions; like the players health or proximity?

Thank you in advance for your help and assistance. :innocent:

Thaz what i did in my game.
If you’re doing a platformer i suggest you to get confident with raycasts.
I’ve found nothing betterr than raycasts for enemies AI.

Basically you create a group for platformers object.
Then for each enemy you cast a raycast. (raycast have a lenght parameter).
The moment the player is hit the enemy exit from patrol and chase the plahyer as long the laser hit.

Next is all about simple disengages events.

But i worn you it’ll requires to use a lot of trigonometry formulas.(like the famous arc-tangent, just to says one)
The results are what you asked in the OP…i can confirm.