Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
108 commits
Select commit Hold shift + click to select a range
02547f5
Add ConditionOperator enum to define comparison operators
konbraphat51 Apr 22, 2025
faf0b15
meta files
konbraphat51 Apr 22, 2025
45fe106
goap value
konbraphat51 Apr 22, 2025
06a7cdf
add condition class
konbraphat51 Apr 22, 2025
4b598c9
Refactor GoapValue to use ValueConverter for type conversions and add…
konbraphat51 Apr 22, 2025
64ea77a
Remove unnecessary using directive from GoapValue.cs
konbraphat51 Apr 22, 2025
6193bd3
satisfaction check by type
konbraphat51 Apr 22, 2025
69ae1ab
Add NotEqual operator
konbraphat51 Apr 22, 2025
5272318
dummy State
konbraphat51 Apr 22, 2025
b68d936
dummy value getter
konbraphat51 Apr 22, 2025
e6f6e90
Add Condition class and interface with comparison operators
konbraphat51 Apr 22, 2025
c16b1c9
Add ConditionAnd class to evaluate multiple conditions
konbraphat51 Apr 22, 2025
e74d1e7
Add ConditionOr class to evaluate conditions with logical OR
konbraphat51 Apr 22, 2025
0beb62b
Refactor foreach loops to use explicit type for conditions in Conditi…
konbraphat51 Apr 22, 2025
65b2140
Add ConditionNot class to negate conditions in the GOAP system
konbraphat51 Apr 22, 2025
42b0e20
values to independent struct
konbraphat51 Apr 22, 2025
7720bb1
Implement state vector storage and retrieval in State class
konbraphat51 Apr 22, 2025
b1dbc41
appropriately get values
konbraphat51 Apr 22, 2025
2219918
rename: GoapValue -> GoapValueInterface
konbraphat51 Apr 22, 2025
3b40d9d
condition logics to struct
konbraphat51 Apr 22, 2025
d5fbb3a
fix handler type
konbraphat51 Apr 22, 2025
0831855
value setting
konbraphat51 Apr 22, 2025
4c74a06
StateDiffSet
konbraphat51 Apr 22, 2025
218044e
GoapValue don't operate themselves
konbraphat51 Apr 22, 2025
2ff820a
state diff
konbraphat51 Apr 22, 2025
ec0890a
State copies itself
konbraphat51 Apr 22, 2025
7861212
Apply State Diff by set
konbraphat51 Apr 22, 2025
312a1a0
data of Action
konbraphat51 Apr 22, 2025
d6cd0c4
Add Available method to Action struct for condition satisfaction check
konbraphat51 Apr 22, 2025
fe2085e
rename
konbraphat51 Apr 22, 2025
a30d898
simulate action
konbraphat51 Apr 22, 2025
379982a
option for overwriting State
konbraphat51 Apr 22, 2025
da6cab0
setting action
konbraphat51 Apr 22, 2025
0b21739
code checker
konbraphat51 Apr 22, 2025
ddbb83e
move folder
konbraphat51 Apr 22, 2025
df03cc7
dummy Pathfinding
konbraphat51 Apr 22, 2025
77b2508
temp; rebase this
konbraphat51 Apr 22, 2025
8daac44
Add indices property to State struct for easier access to keys
konbraphat51 Apr 23, 2025
34cffd7
integrate GoapValue
konbraphat51 Apr 23, 2025
5d20431
numeric addition
konbraphat51 Apr 23, 2025
001c1a8
equitable value
konbraphat51 Apr 23, 2025
7a3d5b2
better typing
konbraphat51 Apr 23, 2025
6f3c17a
mapping operation
konbraphat51 Apr 23, 2025
db21869
integrate all values
konbraphat51 Apr 23, 2025
345405f
adapt
konbraphat51 Apr 23, 2025
9f8c49c
implement StateDiffMapping struct for state value mapping operations
konbraphat51 Apr 23, 2025
fc2500f
export diffs
konbraphat51 Apr 23, 2025
5db8ff3
refactor: implement ComputeCostWeights method for cost estimation
konbraphat51 Apr 23, 2025
ea24deb
AstarQueue
konbraphat51 Apr 23, 2025
c15f944
integrated conditioning
konbraphat51 Apr 23, 2025
bf4298b
fix: logic conditions use ConditionInterface
konbraphat51 Apr 23, 2025
23fc614
fix: update Solve method to use ConditionInterface for goal parameter
konbraphat51 Apr 23, 2025
4ab5ca9
distance estimation from condition
konbraphat51 Apr 23, 2025
4fb51d6
distance estimation for logic conditions
konbraphat51 Apr 23, 2025
53bf104
return 0 if already satisfied
konbraphat51 Apr 23, 2025
4e4a760
float to double
konbraphat51 Apr 23, 2025
c294be5
all cost to double
konbraphat51 Apr 23, 2025
acde42b
cost estimation
konbraphat51 Apr 23, 2025
ee97fd3
hashing State
konbraphat51 Apr 24, 2025
376002d
setting value
konbraphat51 Apr 24, 2025
e75aed0
fix type
konbraphat51 Apr 24, 2025
0b775a2
solving A*
konbraphat51 Apr 24, 2025
103e919
receiving costPerDiff dictionary
konbraphat51 Apr 24, 2025
3218f89
Passing cost weights
konbraphat51 Apr 24, 2025
90d7e8d
fix: update state setting method in StateDiffMapping
konbraphat51 Apr 24, 2025
ddf4914
constructor for State
konbraphat51 Apr 24, 2025
11a76a2
delete State constructor
konbraphat51 Apr 24, 2025
b470f43
rename State -> GoapState
konbraphat51 Apr 24, 2025
3a1317b
rename Action -> GoapAction
konbraphat51 Apr 24, 2025
a62aeee
create scripts directory
konbraphat51 Apr 24, 2025
462d3ed
condition that always true
konbraphat51 Apr 24, 2025
30eccb7
accept passing diff list directly
konbraphat51 Apr 24, 2025
86578f9
seperate ConditionOperator
konbraphat51 Apr 24, 2025
79e0aa7
intruitive order
konbraphat51 Apr 24, 2025
50783d7
test code
konbraphat51 Apr 24, 2025
3390e29
test settings
konbraphat51 Apr 24, 2025
3351599
rename func
konbraphat51 Apr 25, 2025
97293e6
null guard
konbraphat51 Apr 25, 2025
b40cb3a
fix type
konbraphat51 Apr 25, 2025
a9835a8
fix goal
konbraphat51 Apr 25, 2025
2cafb49
GoapResult
konbraphat51 Apr 25, 2025
b1101f9
use GoapResult
konbraphat51 Apr 25, 2025
febb3a0
swap params of AreEqual
konbraphat51 Apr 25, 2025
2596438
fix: check condition of the simulated state
konbraphat51 Apr 25, 2025
5d2da78
copilot documentation
konbraphat51 Apr 25, 2025
4127d34
larger -> greater
konbraphat51 Apr 25, 2025
b5c442c
smaller -> less
konbraphat51 Apr 25, 2025
6cebaa2
assume unknown struct diff as 1
konbraphat51 Apr 25, 2025
19545f6
comments for Condition
konbraphat51 Apr 25, 2025
922caee
comment GoapSolver
konbraphat51 Apr 25, 2025
0108ea4
comment GOAPValue
konbraphat51 Apr 25, 2025
5463a8b
comment StateDiff
konbraphat51 Apr 25, 2025
ecb88ef
comments
konbraphat51 Apr 25, 2025
6c11467
state diff as double
konbraphat51 Apr 25, 2025
bc14e25
rename IsAvailable
konbraphat51 Apr 25, 2025
1669892
add remarks
konbraphat51 Apr 25, 2025
bde2a70
class diagram
konbraphat51 Apr 25, 2025
89f3e56
meta files
konbraphat51 Apr 25, 2025
5c8dc49
refac
konbraphat51 Apr 25, 2025
d8880ea
quit optional overwrite params
konbraphat51 Apr 25, 2025
a4a1d39
refac curly braces
konbraphat51 Apr 25, 2025
f691475
add ClearActionPool method to manage action pool
konbraphat51 Apr 25, 2025
f7250cc
set readonly for constructor-only-fields
konbraphat51 Apr 25, 2025
2ad5cec
fix optional parameters for costPerDiffes
konbraphat51 Apr 25, 2025
f6d3be1
quit optional parameters
konbraphat51 Apr 25, 2025
f6510ca
fix protection
konbraphat51 Apr 25, 2025
86d14ce
refac: seperating result creation
konbraphat51 Apr 25, 2025
0d6fb13
seperate enquing
konbraphat51 Apr 25, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions Docs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added Docs/GOAP_ClassDiagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
117 changes: 117 additions & 0 deletions Docs/GOAP_ClassDiagram.png.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

63 changes: 63 additions & 0 deletions Docs/GOAP_ClassDiagram.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
@startuml

interface GoapValueInterface {
+Type type
}

class GoapState {
-Dictionary<string, GoapValueInterface> values
+GoapValueInterface GetValue(string stateIndex)
+void SetValue(string stateIndex, GoapValueInterface value)
+GoapState Clone()
}
GoapState o-- GoapValueInterface : consists of >

interface ConditionInterface {
+bool IsSatisfied(GoapState state)
+double EstimateCost(GoapState state, Dictionary<string, double> costPerDiffes)
}
ConditionInterface ..> GoapState : reads >

interface StateDiffInterface {
+string stateIndex
+GoapState Operate(GoapState state, bool overwrite)
+double diff
}
StateDiffInterface --> GoapState : operates on >

class StateDiffSet {
-StateDiffInterface[] stateDiffs
+GoapState Apply(GoapState state, bool overwrite)
}
StateDiffSet o-- StateDiffInterface : delegates to >

class GoapAction {
+string name
+ConditionInterface condition
+StateDiffSet stateDiffSet
+double cost
+bool IsAvailable(GoapState state)
+GoapState Simulate(GoapState state, bool overwrite)
}
GoapAction *-- ConditionInterface : delegates to >
GoapAction *-- StateDiffSet : delegates to >

class GoapResult {
+GoapAction[] actions
+double cost
+int length
+bool success
}
GoapResult o-- GoapAction : has >

class GoapSolver {
-GoapAction[] actionPool
+GoapResult Solve(GoapState stateCurrent, ConditionInterface goal, int maxLength)
+void AddAction(GoapAction action)
}
GoapSolver --> GoapResult : Generates >
GoapSolver --> GoapState : uses >
GoapSolver --> ConditionInterface : uses >
GoapSolver o-- GoapAction : stores >

@enduml
7 changes: 7 additions & 0 deletions Docs/GOAP_ClassDiagram.puml.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@

[![Codacy Badge](https://app.codacy.com/project/badge/Grade/b5fe6529e18f4843876976907689c563)](https://app.codacy.com/gh/tsunagi-ai/TsunagiModuleUnity/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)

[![Maintainability](https://qlty.sh/badges/8bcac4c3-7aeb-4c26-b2e1-6aa8b3cf8843/maintainability.svg)](https://qlty.sh/gh/tsunagi-ai/projects/TsunagiModuleUnity)
7 changes: 7 additions & 0 deletions README.md.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Scripts.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Scripts/Goap.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Scripts/Goap/Conditions.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading