Giter Club home page Giter Club logo

Comments (14)

fire avatar fire commented on August 25, 2024 1

If you have any ideas, we can github discuss it!

from hfsm2.

andrew-gresyk avatar andrew-gresyk commented on August 25, 2024

Very cool, I'm happy for you to use the library in Godot Engine, so long as it's done in line with the MIT license https://github.com/andrew-gresyk/HFSM2/blob/master/LICENSE.

from hfsm2.

fire avatar fire commented on August 25, 2024

See https://github.com/godotengine/godot/blob/master/LICENSE.txt.

You mentioned that planner part of this library isn't here. There are a lot of GPL3 or more restrictive licenses on github. It was very hard to find a HDDL library :( I think I'd have to work on one.

from hfsm2.

andrew-gresyk avatar andrew-gresyk commented on August 25, 2024

Yep, HFSM2 can execute plans but it doesn't have a planner.
I'm considering making a generic planner compatible with HFSM2 / FFSM2, however, the idea hasn't crystallized in my head yet.

from hfsm2.

fire avatar fire commented on August 25, 2024

@andrew-gresyk are you insistent on catch2? Godot uses doctest so I was curious.

from hfsm2.

andrew-gresyk avatar andrew-gresyk commented on August 25, 2024

Phil Nash recommended it, and it worked for me.
Is it https://github.com/onqtam/doctest you're using at Godot?

from hfsm2.

fire avatar fire commented on August 25, 2024

Yeah. We're using doctest. I was curious.

from hfsm2.

andrew-gresyk avatar andrew-gresyk commented on August 25, 2024

Switched to doctest BTW, for a x2 build speedup.
Thanks for the hint!

from hfsm2.

fire avatar fire commented on August 25, 2024

Since I got an email tracking this, I'm currently trying https://github.com/V-Sekai/godot-tfd based on the work by @debbynirwan

My unit tests show https://github.com/V-Sekai/godot-tfd/blob/main/tests/test_tfd_travel.h how to use tfd.

from hfsm2.

fire avatar fire commented on August 25, 2024

Reading backwards, I think you suggested we can combine a planner like TFD (Hierarchical Task Network Planner) with HFSM2.

from hfsm2.

andrew-gresyk avatar andrew-gresyk commented on August 25, 2024

Interesting, I'll have a look at TFD, ty.
Yeah, for an example of using plans, see https://github.com/andrew-gresyk/HFSM2/blob/master/test/test_plans.cpp

from hfsm2.

fire avatar fire commented on August 25, 2024

Dana wrote a great diagram explaining the problem.

image

http://www.cs.umd.edu/~nau/papers/nau2013game.pdf

from hfsm2.

andrew-gresyk avatar andrew-gresyk commented on August 25, 2024

Yeah makes sense.

A couple points about plans in HFSM2 and FFSM2:

  • plans are 'attached' to regions, and accessed via control.plan<Region>() or control.plan() for the current region
  • plan is a sequence of transitions, which can be appended to it using plan.change<TOrigin, TDestination>() or plan.change(originIndex, destinationIndex) (all transition types are supported)
  • if TOrigin state calls Control::succeed() - planning step (for that region) has succeeded and the FSM will transition to TDestination state
  • if TOrigin state calls Control::fail() - plan (for that region) has failed
  • Region::planSucceeded() and Region::planFailed() will be called when the plan 'attached' to that region succeeds or fails
  • if a region doesn't define planSucceeded() and planFailed(), they will propagate up the hierarchy, all the way to the root

With that, one can build hierarchical plans.

To integrate the planner with the FSM plan execution, a mapping between actions (methods?) and states has to be defined.

There's also a slightly different example in FFSM2: https://github.com/andrew-gresyk/FFSM2/blob/master/test/test_plans.cpp
Which would still work in HFSM2

from hfsm2.

fire avatar fire commented on August 25, 2024

Since I have stopped working on this. I'll close it and reopen later. Thanks.

from hfsm2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.