simple\advanced AI

  • so im making a game where the characters are npc's that wander randomly. i can make them wander im just wondering if there is a way to prioritize certain events. example below.

    i am using a player state engine to do this

    if "characters" thirst is below 40%

    set player state to "getwater"

    if "characters" hunger is below 40%

    set player state to "getfood"

    how can i, if both variables are true. prioritize the "GetWater" over the "GetFood". right now when both variables are true. the character just stops.

    thank you in advanced

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • If you add a check, if hunger is below 40 and thirst is greater than 40 to the same event then that will mean they only go to get food if thirst is fine.

  • thats how i have it set up right now. so the thirst lowers at a rate of random(1,5) every random(1,3) seconds where as the hunger lowers at a rate of random(1,3) every random(2,5) seconds. so if the character is both low on thirst and hunger i would like the character to prioritize getting water over getting food due to how much faster it depletes.

  • Well if you have it setup how I described then they will never go for food unless water is fine, is that the kind of priority you are talking about?

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)