Open
Conversation
… ValueConverter class for consistent value handling
…onAnd and ConditionOr classes
There was a problem hiding this comment.
Pull Request Overview
This pull request introduces a new GOAP module with support for various condition types and operators for evaluating GOAP states. Key changes include:
- Implementation of multiple condition structs such as NoCondition, ConditionOr, ConditionAnd, and a generic Condition.
- Introduction of the ConditionInterface and ConditionOperator enum to standardize condition behavior.
- Updates to documentation and cost estimation logic across condition types.
Reviewed Changes
Copilot reviewed 42 out of 55 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| Scripts/Goap/Conditions/NoCondition.cs | A basic condition always satisfied, with zero cost estimation. |
| Scripts/Goap/Conditions/ConditionOr.cs | Implements a composite OR condition that returns the minimum cost. |
| Scripts/Goap/Conditions/ConditionOperator.cs | Introduces operators for state comparisons in conditions. |
| Scripts/Goap/Conditions/ConditionInterface.cs | Defines a standard interface for GOAP conditions. |
| Scripts/Goap/Conditions/ConditionAnd.cs | Implements a composite AND condition with cost estimation logic. |
| Scripts/Goap/Conditions/Condition.cs | Provides the generic condition implementation for state comparisons. |
| README.md | Adds badges to improve repository maintainability visibility. |
Files not reviewed (13)
- Docs.meta: Language not supported
- Docs/GOAP_ClassDiagram.png.meta: Language not supported
- Docs/GOAP_ClassDiagram.puml: Language not supported
- Docs/GOAP_ClassDiagram.puml.meta: Language not supported
- README.md.meta: Language not supported
- Scripts.meta: Language not supported
- Scripts/Goap.meta: Language not supported
- Scripts/Goap/Conditions.meta: Language not supported
- Scripts/Goap/Conditions/Condition.cs.meta: Language not supported
- Scripts/Goap/Conditions/ConditionAnd.cs.meta: Language not supported
- Scripts/Goap/Conditions/ConditionInterface.cs.meta: Language not supported
- Scripts/Goap/Conditions/ConditionOperator.cs.meta: Language not supported
- Scripts/Goap/Conditions/ConditionOr.cs.meta: Language not supported
Comments suppressed due to low confidence (4)
Scripts/Goap/Conditions/ConditionInterface.cs:27
- [nitpick] Consider renaming the parameter 'costPerDiffes' to a clearer name such as 'costPerDifferences' for enhanced readability.
public double EstimateCost(GoapState state, Dictionary<string, double> costPerDiffes = null)
Scripts/Goap/Conditions/Condition.cs:26
- [nitpick] Consider renaming 'stateIndex' to 'StateIndex' to follow C# naming conventions for public properties.
public string stateIndex { get; private set; }
Scripts/Goap/Conditions/Condition.cs:31
- [nitpick] Consider renaming 'valueComparing' to 'targetValue' or 'comparisonValue' for increased clarity.
public T valueComparing { get; set; }
Scripts/Goap/Conditions/ConditionOr.cs:13
- [nitpick] Consider renaming 'conditions' to 'Conditions' to align with C# public property naming conventions.
public ConditionInterface[] conditions { get; private set; }
SonarCSharp_S121
SonarCSharp_S2933
SonarCSharp_S2360
Collaborator
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Implementation Details
GoapSolver.Solve()GoapActionConditionStateDiffStateGoapValueConditionTsunagiModuleWhat is GOAP?
For Japanese: https://www.slideshare.net/slideshow/y-miyake-igdaaiseminar2nd2007210/36655381#53
For English: https://web.archive.org/web/20230713022726/https://alumni.media.mit.edu/~jorkin/goap.html
Developer experience
Registering GoapActions
TsunagiModuleUnity/Tests/GoapTest.cs
Lines 191 to 198 in 0d6fb13
Create GoapState
TsunagiModuleUnity/Tests/GoapTest.cs
Lines 168 to 172 in 0d6fb13
Solve
TsunagiModuleUnity/Tests/GoapTest.cs
Line 36 in 0d6fb13
How to PR?
Control
Commenting
Click at


Files ChangedDrag the area you want to comment and push
+buttonApproving
Push
Approveif you agree.What to comment?
EVERYTHING
Why to comment
Examples
Konbraphat51 reviewing
Konbraphat51 being reviewed
Guides
Japanese
English