You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i have a pathfinding agent that is trying to find food
my scorer computes a score for 'find-food', and puts in an intermediate component the position of the food to eat
then i have a sequence action consisting of 'FindFoodPath' (compute the path) and 'WalkOnPath' (just execute the path)
But what I would like is this:
the systems keep running, and if the FindFoodScorer gets a higher scorer than the original FindFoodScorer that started the sequence, then I cancel the current sequence and I start a new one.
I thought this is already what would happen (the scorer cancels the current action and executes a new one if the scorer becomes higher). But the problem is that this time the action chosen is the same one, just for a different parameter (different food to eat), so the Thinker doesn't cancel the existing FindFoodPath + WalkOnPath sequence.
I can probably find workarounds, but they are a bit clunky. It's just something to think about: how to allow the thinker to cancel the current action to re-start an action of the same type
let get_food = Steps::build().label("GetFood").step(FindFood).step(GoTo);Thinker::build().label("DefaultThinker").picker(Highest).when(HungryScorer, get_food)
HungryScorer: finds the closest food and assigns a score based on how close it is.
GetFood: find a path to the food chosen by HungryScorer and executes on the path
What i would like is:
if at some point HungryScorer finds a better food (closer food position, = higher score), then I cancel my current get_food action and start a new one
i.e. some kind of mode where the Action stores the original Score value that triggered it, and if the Scorer gets higher score, we restart the action (even if it's the same action-type)
Potential solutions
In Here, allow cancelling the current action if the new-score for the same action is higher than the original score (instead of only spawning a new action if its a different action-type)
For a given action A, add a way for A to constantly have access to the score that leads to action A + the original score that led to action A being picked. (maybe just a link the corresponding scorer entity?) -> might not be enough in the case of Steps, because a user can only access individual actions that compose steps, not steps itself, unless Steps is refactored a bit)
basically a HighestUnchanging picker, that remembers which Choice it picked, and then picks "None" if the score for that item has changed. Make sure that when None is picked, the current action is Canceled.
The text was updated successfully, but these errors were encountered:
I have another issue:
But what I would like is this:
What i would like is:
i.e. some kind of mode where the Action stores the original Score value that triggered it, and if the Scorer gets higher score, we restart the action (even if it's the same action-type)
Potential solutions
In Here, allow cancelling the current action if the new-score for the same action is higher than the original score (instead of only spawning a new action if its a different action-type)
For a given action A, add a way for A to constantly have access to the score that leads to action A + the original score that led to action A being picked. (maybe just a link the corresponding scorer entity?) -> might not be enough in the case of
Steps
, because a user can only access individual actions that compose steps, not steps itself, unlessSteps
is refactored a bit)basically a
HighestUnchanging
picker, that remembers which Choice it picked, and then picks "None" if the score for that item has changed. Make sure that whenNone
is picked, the current action is Canceled.The text was updated successfully, but these errors were encountered: