Skip to content

Feature: Dynamic conditions (code only)#370

Merged
crashkonijn merged 7 commits intomasterfrom
feature/value-condition
Dec 11, 2025
Merged

Feature: Dynamic conditions (code only)#370
crashkonijn merged 7 commits intomasterfrom
feature/value-condition

Conversation

@crashkonijn
Copy link
Owner

@crashkonijn crashkonijn commented Nov 6, 2025

This pull request introduces a major refactor to the condition system in the GOAP framework, adding support for both value-based and reference-based conditions. It also updates the capability and goal creation logic to leverage these new condition types, and adds a new world key and sensor for "LowHunger". The editor and runtime logic are updated to handle these changes, improving flexibility and extensibility for defining agent behaviors.

Condition System Refactor

  • Replaced the old Condition class with two new types: ValueCondition for conditions comparing against a constant value, and ReferenceCondition for conditions comparing against another world key's value. Corresponding interfaces IValueCondition and IReferenceCondition are introduced, and all builder methods and scriptable conversions are updated to use these types.
  • Updated ConditionObserver and WorldDataBase to support reference-based condition checking, allowing comparisons between different world keys.

Capability and Goal Builder Updates

  • Extended ActionBuilder and GoalBuilder to allow adding reference conditions, enabling actions and goals to depend on relationships between world key values rather than just fixed thresholds.
  • Updated the hunger capability logic to use a reference condition comparing Hunger with LowHunger, and registered the new LowHungerSensor and LowHunger world key.

Editor and Visualization Improvements

  • Enhanced the editor extension and condition graph viewer to properly display both value and reference conditions, showing dynamic values and names for reference conditions.
  • Added automatic issue fixing and validation in CapabilityConfigScriptable to improve asset integrity.

Sensor System Changes

  • Updated the sensor runner logic to ensure sensors for reference keys are included when reference conditions are present, improving world state tracking for agents.

Minor Configuration Updates

  • Added validateTarget property to the wander capability asset for improved configuration.

Fixes #364

@crashkonijn crashkonijn changed the title Basic setup of value-condition Feature: Dynamic conditions (code only) Dec 11, 2025
@crashkonijn crashkonijn merged commit 99772be into master Dec 11, 2025
3 checks passed
@crashkonijn crashkonijn deleted the feature/value-condition branch December 11, 2025 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature: Dynamically changing condition amounts

1 participant

Comments