Skip to content
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

Need of more documentation on Actions #19

Open
deltamish opened this issue Jul 9, 2017 · 0 comments
Open

Need of more documentation on Actions #19

deltamish opened this issue Jul 9, 2017 · 0 comments

Comments

@deltamish
Copy link

Hey,

I just started using your library. Loved the Debug view and the sensors implementation.
I wanted to try out my first implementation of performing a waypoint follow. Decided to set Goal as Patrol and Actions were to be designed accordingly.
I went though the doc it looked simple. But the example got me quite confused.
in the FSM-Example Take GenericGoToAction.cs

The calss has something called IReGoapActionSettings<string, object>

public override IReGoapActionSettings<string, object> GetSettings(IReGoapAgent<string, object> goapAgent, ReGoapState<string, object> goalState)
    {
        settings = new GenericGoToSettings
        {
            ObjectivePosition = GetWantedPositionFromState(goalState)
        };
        return base.GetSettings(goapAgent, goalState);
    }

  public override ReGoapState<string, object> GetEffects(ReGoapState<string, object> goalState, IReGoapAction<string, object> next = null)
    {
        var goalWantedPosition = GetWantedPositionFromState(goalState);
        if (goalWantedPosition.HasValue)
        {
            effects.Set("isAtPosition", goalWantedPosition);
        }
        else
        {
            SetDefaultEffects();
        }
        return base.GetEffects(goalState, next);
    }

And these two Blocks of code just confused me. Could you caret o explain why are we overriding GetEffects and whats basically happening here

And could be kind enough to add a little more details on Actions in ReGOAP

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant