-
Notifications
You must be signed in to change notification settings - Fork 0
GOAP module #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
GOAP module #1
Conversation
… ValueConverter class for consistent value handling
…onAnd and ConditionOr classes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
Summary
Implementation Details
GoapSolver.Solve()
GoapAction
Condition
StateDiff
State
GoapValue
Condition
TsunagiModule
What 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 Changed
Drag the area you want to comment and push
+
buttonApproving
Push
Approve
if you agree.What to comment?
EVERYTHING
Why to comment
Examples
Konbraphat51 reviewing
Konbraphat51 being reviewed
Guides
Japanese
English