An addon for Godot 4 that copycats Fluid HTN by @ptrefall. The latest checked version is 500e692
See Fluid HTN's Features for more details.
Please share your feedback and use case in Issues.
See Fluid HTN's Getting started for more details.
- fluid_htn_tests : test cases of Fluid HTN implemented in GDScript.
- fluid_smart_objects : a simplified Fluid Smart Objects implemented in GDScript.
- fluid_text_adventure : a simplified Fluid Text Adventure implemented in GDScript.
- All names are following GDScript naming conventions.
Because GDScript doesn't support :
- Namespace : so all classes are added a prefix
Htn
. - Interface : so all C# interfaces are replaced by a class with assertions.
- Properties Access Modifier : so all C# properties are replaced by access functions.
- Function Overloading : so type names are added to functions.
- Generic : so Script objects are being used to check the IContext type in debug builds. (checking class info hurts performance)
- Globally Accessible Enum : so all eunm types are moved into
Htn
class. - Nullable Typed Array : so all array variables are initialized with an empty array rather than null.
- Advenced Data Structure : so
Array
is being used to present List, Queue, Stack and KeyValuePair. - Exception Handling : so
HtnError
is being used to record error message and test assertion.
- Remove Factory : because object pooling might not be useful in Godot.
- Remove ConsoleColor from log functions : because Godot doesn't have such things.
Queue<ITask>
: repalced byHtnPlan
, for better abstraction.IDecomposeAll
: merged intoICompoundTask
, because checking class info hurts performance.IOperator
- Stop : return false if action failed.
- Aborted : return false if action failed.
IEffect
- Apply : return false if action failed.
ITask
- Use
TaskType
to check task type rather than use class info. - Stop : return false if _operator is null.
- Aborted : return false if _operator is null.
- Use
IPrimitiveTask
- set_operator : return false if _operator isn't null.
BaseDomainBuilder
CompoundTask<P>(string name, P task)
: renamed to add_subtask
DecompositionLogEntry
- depth_to_string : add the
indent
parameter
- depth_to_string : add the
HtnBaseContextTests
: renameinitinitialize_collections__expected_behavior
toinit_initialize_collections__expected_behavior
HtnPlannerTests
: renamefind_plan_if_world_state_change_to_worse_mrt_and_operator_is_continuous__expected_behavior
tofind_plan_if_world_state_change_to_worse_mtr_and_operator_is_continuous__expected_behavior
HtnSequenceTests
: changeDecomposeRequiresContextInitFails_ExpectedBehavior
todecompose_without_context_init__expected_behavior
, because GDScript can't init _world_state_change_stack as null
DomainTests
: deleteMTRNullThrowsException_ExpectedBehavior
, because GDScript can't setArray
to null
HtnBaseContextTests
:is_script__expected_behavior
HtnFuncOperatorTests
:aborted_does_nothing_without_function_ptr__expected_behavior
HtnFuncOperatorTests
:aborted_throws_if_bad_context__expected_behavior
HtnFuncOperatorTests
:aborted_calls_internal_function_ptr__expected_behavior
HtnPrimitiveTaskTests
:aborted_with_valid_operator__expected_behavior
HtnPrimitiveTaskTests
:aborted_with_null_operator__expected_behavior
- contexts
- IContext
- BaseContext
- PartialPlanEntry
- debug
- DecompositionLogEntry
- conditions
- IContext
- FuncCondition
- operators
- IOperator
- FuncOperator
- effects
- EffectType
- IEffect
- tasks
- TaskStatus
- ITask
- IPrimitiveTask
- PrimitiveTask
- DecompositionStatus
- IDecomposeAll
- PausePlanTask
- ICompoundTask
- CompoundTask
- Selector
- Sequence
- TaskRoot
- Slot
- domain
- IDomain
- Domain
- planners
- Planner
- domain_builder
- BaseDomainBuilder
- DomainBuilder
- fluid_htn_tests
- MyContext
- MyDebugContext
- BaseContextTests
- FuncConditionTests
- FuncOperatorTests
- ActionEffectTests
- PrimitiveTaskTests
- SelectorTests
- SequenceTests
- DomainTests
- PlannerTests
- BaseDomainBuilder
- Minor optimization : remove while loop, remove temp array, add HtnIPlannerState bool functions, etc
- Add extended selectors from Fluid HTN Extension library.
- Add examples : Fluid Goap Coffai
- Remove debug info when exporting project by putting related code into
assert()