Skip to content

Version 0.1

Pre-release
Pre-release
Compare
Choose a tag to compare
@ptrefall ptrefall released this 30 Jul 07:10
· 58 commits to master since this release
  • Total order forward decomposition planner algorithm implemented.
  • Generic domain builder class, that makes it easy to define HTN domains, and to extend them.
  • Early rejection through method traversal record.
  • Partial planning.
  • Splicing of domains at build-time.
  • Splicing of domains at run-time through slots declared at build-time, adding support for smart objects.
  • Planner class that handles all the complexities of managing tasks in plans, when to re-plan a domain, etc.
  • Only re-plan when a plan completes/fails, or when the context state change.
  • Uses a generic factory pattern internally to support custom memory management and pooling.
  • Extensive decomposition logging support, for debugging.
  • Simple Unity support through package modules.
  • Separate extension library and example projects.
  • Unit tests.

This release has some small breaking changes with the introduction of decomposition logging.

Stack<string> DecompositionLog;

is now

Queue<IBaseDecompositionLogEntry> DecompositionLog { get; set; }

Additionally, in your custom conditions, you might want to extend your IsValid() implementation with something like

if (ctx.LogDecomposition) ctx.Log(Name, $"MyCondition.IsValid:{result}", ctx.CurrentDecompositionDepth+1, this, result ? ConsoleColor.DarkGreen : ConsoleColor.DarkRed);

In your custom effects, you might want to extend your Apply() implementation with something like

if (ctx.LogDecomposition) ctx.Log(Name, $"MyEffect.Apply:{Type}", ctx.CurrentDecompositionDepth+1, this);

Please refer to the debug section of the readme file for more details on using the decomposition logger.

This project still needs more usage in real-life applications before it can be declared as something other than pre-release, but it is more or less feature-complete.