Forum rules - please read before posting.

Using AC to create monster AI

edited April 11 in Technical Q&A

Hey
I want to create a monster that roams back and forth between point A and point B, and starts chasing the player once the player is detected. Is this something that can be done using Adventure Creator alone?

Here’s a simple breakdown of the intended logic:

  • The monster continuously moves between point A and point B.

  • There are several hiding spots in the room that the player can use to avoid detection.

  • When the monster spots the player, it roars first and then begins chasing.

  • The monster won’t follow the player into the next scene.

  • Once the monster starts chasing, all hiding spots become disabled.

  • If the monster catches the player, the Game Over menu is triggered.

Reference (check 2:55):

Comments

  • Another reference

  • edited April 12

    While AC isn't geared towards "AI" in the general sense, simple behaviour such as this is doable with the use of Triggers and Variables.

    • Firstly, the Monster can be a regular NPC with no Hotspot component
    • Their patrol route can be created using a Path object set to Loop, and then a Character: Move along Path Action to have them move along it
    • Place Triggers or Hotspots in the "hiding areas" that set a Global Bool Variable named e.g. "Player is hiding" to True
    • Attach a Trigger to the front of the Monster, marking out its "Line of sight" area, and have it chase the Player upon entering, provided "Player is hiding" is False. Use the Character: NPC follow Action to move the Monster. Set another Variable named "Monster is chasing" to True
    • Return to the hiding areas and only set "Player is hiding" to True if "Monster is chasing" to False
    • Attach another Trigger around the Monster, smaller than the last, and have it play an animation / execute the Game Over logic when the Player enters it
  • Thank you very much, Chris. I'll start working on it and let you know once it's finished.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.