-
Notifications
You must be signed in to change notification settings - Fork 16
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
tutorial? #4
Comments
The only function you need to understand for using that addon is the "goap" function in player.gd in the example. That function reevaluates the goap algorithm whenever necessary to define the list of actions to be taken. Everything else in this file defines the actions themselves (running, picking up objects etc.). |
This probably isn't the place for it but I'm having the same issue. I'm incorporating it into my 2d project and the plan() function is not returning a plan so it dies there just idling. How are goals determined? I set mine to cut_tree as I just want him to simply cut a tree for testing purposes. A breakdown would be useful. Mine seems to be getting lost in the astar function. Yours iterates a few times but mine only iterates twice i believe. I have one action under action planner: cut_wood. |
OK, could you share your project or at least give me more details? You have only one action, but what are its preconditions and effect? Preconditions and effects describe how the "status of the world" changes. For your very simple example, you could say the status has 2 properties:
Your "cut_wood" action would have "player_sees_a_tree" as precondition, and "player_sees_wood" as effect. To use GOAP, you have to:
Hope this helps! |
BTW, when selecting the ActionPlanner node, there is an editor in the bottop panel. I never coded the "simulation" part, but the editor should work... Maybe I should fix that... |
here's my project: https://github.com/smccourtb/lore-torn are goals only established in the goap_get_current_goal() function? I'm sure when i can get the plan to return I can get a better idea on how the actions are implemented. I'm just stuck there as of right now. currently debugging yours and stepping through with breakpoints to figure out where ours diverge. Maybe i need a wait action like yours? I appreciate the time you're taking to explain. |
You don't have to debug or understand the plan function, it works. :D |
so it works if i set the goal to "sees_tree" *i think". at least if calls the use_nearest_object_function(). but if the goal is set to 'cut_tree' it does not. Seems wrong because my goal is to cut the tree down, not just see a tree. seems opposite to me. |
Just looked at your project. The goal should be sees_wood. sees_tree is the initial status. |
I just realized that. so the goal has to be part of some actions effects? is that correct? |
Hi there,
I'm not at the level to fully understand this by reading the code. Is there any chance a quick overview of the code and what it's doing? Maybe even just dialog as you browse over the relevant code so I can consider what that's doing and then implement it into my game? Thank you and I really look forward to understanding this further.
The text was updated successfully, but these errors were encountered: