-
Notifications
You must be signed in to change notification settings - Fork 1
add max-depth parameter #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Thanks for your issue! I would imagine it's because of an infinite loop or similar; could you provide a test case? |
Might be tricky, but I will try. |
It seems it can be solved easily by tracking depth in state, and returning Example of an infinite search that is being limited by tracking depth in state: benjajaja@15c4728#diff-2ad10836ccce5ac2056d5679cc92449d9ff9094d4ff5c5803f65b5dd1d52ef19R137-R138 The pathfinding crate also doesn't have any max-depth kind of parameters, and in a discussion there it's more or less suggested to do something similar. |
@lixitrixi for your amusement, here is a video of my usage of this library: 2025-04-24.21-12-55.mp4The goals are reconnect-land-clusters, revenge(another player), or simply grow. The actions are series of steps. Finally I solved the too-broad search by constraining to only search from two distinct land-clusters, tracking the "starting points" in state and returning false from |
This is so cool, thanks for sharing! Really glad to see this library in use :) I realise the crate is quite small, but I welcome any more suggestions or PRs. I will see if there's a way to specify a max depth, but with the dynamic types it may be difficult. |
The depth tracking only solved some cases, the overall problem was having too many actions creating an "explosion" of combinations. First, I cut down the possible actions by "combining" some successive steps before planning. Second, I track in the state how many other actions are being applied, and constrain it to just two, as it doesn't make sense for the defined goals. It feels a bit like a leaky abstraction, doing this via the state and in |
When actions and goals get complex, I find it very tricky to give up early. I don't know much about GOAP, but the crate is using
astar
, so I think it would make sense. I have no idea if my states/actions/goals cause infinite loops, or are just too deep, but they stall sometimes.I suppose the max-depth option should go into the
Agent
.The text was updated successfully, but these errors were encountered: