lla-dane / Jack-in-the-wild

0 stars 5 forks source link

Implement Enemy Patrolling AI #12

Open kmtGryffindor20 opened 5 months ago

kmtGryffindor20 commented 5 months ago

Description

We need to develop a patrolling AI for enemy characters in our game. This AI should enable enemies to move along predefined paths, respond to player presence, and return to their patrol routes if the player is no longer detected. The implementation should be flexible enough to allow for different patrol patterns and behaviors based on specific enemy types.

Requirements

  1. Patrol Paths:

    • Define patrol routes for enemies using waypoints or path nodes.
    • Ensure enemies can follow these paths smoothly and loop back to the start if needed.
    • Support various patrol patterns, including linear, circular, and random routes. (Ideally...)
  2. Detection and Response:

    • Implement a detection system that allows enemies to notice the player when within a certain range or line of sight.
    • Define enemy behavior when the player is detected, such as chasing, attacking, or alerting other enemies. (This has been done... You can improve or change if you like)
    • Ensure enemies return to their patrol route if the player is no longer detected after a certain period.
  3. Behavior States:

    • Create different behavior states for the enemy, such as patrolling, chasing, and returning to patrol.
    • Ensure smooth transitions between these states based on game events and player actions.
  4. Visual Feedback:

    • Add visual indicators for enemy states (e.g., alert animations or icons when the player is detected).
  5. Customization:

    • Allow for easy customization of patrol routes, detection ranges, and behaviors for different enemy types.
    • Ensure the system is modular and can be extended with new behaviors or states in the future.
    • This is something to be done ideally and is not a necessity for now but would cause issues later.

Tasks

phantomgithub commented 5 months ago

please assign this issue to me @kmtGryffindor20 @darshi1337

darshi1337 commented 5 months ago

@phantomgithub assigned https://www.youtube.com/watch?v=jnETyJUiCiM&pp=ygUOZW5lbXkgYWkgdW5pdHk%3D This can help

darshi1337 commented 5 months ago

@phantomgithub Any progress here?

phantomgithub commented 5 months ago

@phantomgithub Any progress here?

@darshi1337 Yes its done, will create PR today

phantomgithub commented 5 months ago

@darshi1337 I wanted to ask that once the player is spotted, should the enemy chase the player until the player kills the enemy or till the player is in the enemy's patrol region?

kmtGryffindor20 commented 5 months ago

@darshi1337 I wanted to ask that once the player is spotted, should the enemy chase the player until the player kills the enemy or till the player is in the enemy's patrol region?

You can do either of the two:

Do not make the enemy to continue the chase once aggravated. There should be a condition where the enemy can return to the patrol state.

phantomgithub commented 5 months ago

@darshi sorry for the delay, please un assign this issue as although i am able to implement the patrol and aggro behaviour but i am unable to make it work with the FSM.

kmtGryffindor20 commented 5 months ago

You could come back to this issue at a later stage if you find some way of making it work. You can work on some other issue till that time.