Skip to content
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

Feature: v3 #120

Merged
merged 326 commits into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from 133 commits
Commits
Show all changes
326 commits
Select commit Hold shift + click to select a range
78efe30
Merge pull request #174 from crashkonijn/feature/capability-builders
crashkonijn Jun 25, 2024
7dd83d8
Start of agent project split
crashkonijn Jun 26, 2024
0104aed
Improved distance cost calculation in the planner, prepared the plann…
crashkonijn Jun 27, 2024
676133b
Update GraphResolverJob.cs
crashkonijn Jun 27, 2024
0a9f52d
Improved resolving heuristics
crashkonijn Jun 27, 2024
a295a89
Merge branch 'feature/v2.2' into feature/heuristic-improvements
crashkonijn Jun 28, 2024
ccbab87
Fixed merge conflicts, fixed tests
crashkonijn Jun 28, 2024
38e5592
Merge pull request #172 from crashkonijn/feature/heuristic-improvements
crashkonijn Jun 28, 2024
1886151
Merge branch 'feature/v2.2' into feature/split-agent-projects
crashkonijn Jun 28, 2024
154aa51
Fixed merge issues
crashkonijn Jun 28, 2024
5883592
Temp
crashkonijn Jun 28, 2024
7f66517
Fixes #129
crashkonijn Jun 28, 2024
84102bf
Formatted code
crashkonijn Jun 28, 2024
45c43cc
Fixed certain extension method usage, improved editor namespaces
crashkonijn Jun 28, 2024
cafb730
Merge pull request #175 from crashkonijn/feature/split-agent-projects
crashkonijn Jun 28, 2024
dab5e57
Fixes #145
crashkonijn Jun 28, 2024
aa2504c
Start of improved goal handling
crashkonijn Jul 1, 2024
147005d
Update package.json
crashkonijn Jul 1, 2024
e9fb842
Updates
crashkonijn Jul 1, 2024
f744cdb
Update AgentTypeBuilder.cs
crashkonijn Jul 1, 2024
178bbbe
Update package.json
crashkonijn Jul 1, 2024
0a0da18
Update AgentTypeFactoryBaseEditor.cs
crashkonijn Jul 1, 2024
6622193
Update GraphResolverJob.cs
crashkonijn Jul 1, 2024
f8778dd
Update ClassGenerator.cs
crashkonijn Jul 1, 2024
4d584cf
Merge branch 'master' into fix/scriptable-config-not-using-correct-go…
crashkonijn Jul 2, 2024
d424ae0
Forward port of fix for #177
crashkonijn Jul 2, 2024
f39b04f
Merge pull request #176 from crashkonijn/fix/145
crashkonijn Jul 2, 2024
cb5f8ae
Merge pull request #183 from crashkonijn/fix/scriptable-config-not-us…
crashkonijn Jul 2, 2024
83aaf9e
Merge branch 'feature/v2.2' into feature/improved-goal-handling
crashkonijn Jul 2, 2024
7b5f0df
Improved goal handling!
crashkonijn Jul 3, 2024
b9099a8
Merge pull request #189 from crashkonijn/feature/improved-goal-handling
crashkonijn Jul 3, 2024
e232383
Updated code gen templates. Fixes #178
crashkonijn Jul 3, 2024
51a760f
Added goap set config upgrader. Fixes #190
crashkonijn Jul 3, 2024
642b68b
Fixed namespace allowed to be empty in generator. Fixes #180
crashkonijn Jul 3, 2024
d6d66af
Fixed editor breaking with recursive actions. Fixes #179
crashkonijn Jul 3, 2024
809eea5
Merge pull request #191 from crashkonijn/fix/various-v3-improvements
crashkonijn Jul 3, 2024
e3a1b44
Couple fixes, start of v3 docs
crashkonijn Jul 3, 2024
8c7603d
Update package.json
crashkonijn Jul 3, 2024
ca4e4c0
Added more setup validations
crashkonijn Jul 4, 2024
677a161
Improved docs
crashkonijn Jul 4, 2024
5ea412b
Added backwards capability to action
crashkonijn Jul 4, 2024
c646455
Improved backwards compatibility
crashkonijn Jul 4, 2024
e491ecf
Added obsolete methods for easier upgrading
crashkonijn Jul 4, 2024
43fa3b0
Update AgentEvents.cs
crashkonijn Jul 4, 2024
be869c8
Added another obsolete event
crashkonijn Jul 4, 2024
e4a562e
Various improvements
crashkonijn Jul 4, 2024
b519bdb
Various fixes
crashkonijn Jul 4, 2024
264ad8d
Style fixes, more v3 docs!
crashkonijn Jul 4, 2024
8c6c9f6
Removed MonoBehaviour requirement from IComponentReference
crashkonijn Jul 4, 2024
4f1a9de
Merge branch 'master' into feature/v2.2
crashkonijn Jul 4, 2024
713ee93
Update version to 3.0.3-beta
crashkonijn Jul 4, 2024
90a6550
Updated demo
crashkonijn Jul 4, 2024
8bcf6b5
Merge branch 'feature/v2.2' into update-version-3.0.3-beta
crashkonijn Jul 4, 2024
57b9ac9
Merge pull request #192 from crashkonijn/update-version-3.0.3-beta
crashkonijn Jul 4, 2024
cc03852
Minor docs update
crashkonijn Jul 4, 2024
502919c
Merge branch 'feature/v2.2' of github.com:crashkonijn/GOAP into featu…
crashkonijn Jul 4, 2024
040a750
Updated demo
crashkonijn Jul 4, 2024
2742703
Merge branch 'master' into feature/v2.2
crashkonijn Jul 8, 2024
b1f011f
Re-fixes #193 for v3
crashkonijn Jul 8, 2024
245102d
Update ResolveHandle.cs
crashkonijn Jul 15, 2024
16917dc
Merge pull request #196 from crashkonijn/fix/picked-goal-not-being-in…
crashkonijn Jul 15, 2024
59323cf
Added option to disable demo build
crashkonijn Jul 15, 2024
389186c
Update version to 3.0.4-beta
crashkonijn Jul 15, 2024
d66223c
Merge branch 'feature/v2.2' into update-version-3.0.4-beta
crashkonijn Jul 15, 2024
1230c26
Merge pull request #197 from crashkonijn/update-version-3.0.4-beta
crashkonijn Jul 15, 2024
dd4c83e
Fixed: V3 build not working
crashkonijn Jul 17, 2024
5c30e2d
Merge pull request #199 from crashkonijn/fix/v3-build-not-working
crashkonijn Jul 17, 2024
c56333f
Style fixes
crashkonijn Jul 17, 2024
dcc33b9
Update update-package.yml
crashkonijn Jul 17, 2024
0434192
Update update-package.yml
crashkonijn Jul 17, 2024
7b68067
Update release-drafter.yml
crashkonijn Jul 17, 2024
92081a8
Update version to 3.0.5-beta
crashkonijn Jul 17, 2024
90fd82d
Merge pull request #202 from crashkonijn/update-version-3.0.5-beta
crashkonijn Jul 17, 2024
fcdfe33
Corrected a few minor errors on the V3 upgrade docs
Jul 18, 2024
e178e99
Fixed no action bricking action runner
crashkonijn Jul 18, 2024
136e509
Merge pull request #204 from crashkonijn/fix/no-action-bricking-actio…
crashkonijn Jul 18, 2024
b8019b1
Update version to 3.0.6-beta
crashkonijn Jul 18, 2024
5589601
Merge pull request #205 from crashkonijn/update-version-3.0.6-beta
crashkonijn Jul 18, 2024
668371c
Merge pull request #203 from Layla-P/feature/v2.2
crashkonijn Jul 18, 2024
f2270bb
Fixes #206
crashkonijn Jul 24, 2024
0d5f1d6
Removed debug logs
crashkonijn Jul 24, 2024
ef68e53
Disabled target sensor re-run during action validation. Should fix #208
crashkonijn Jul 24, 2024
b4763a2
Added target status indicator
crashkonijn Jul 24, 2024
59eff03
Added graph viewer shortcut
crashkonijn Jul 24, 2024
a3bc9e6
Merge pull request #209 from crashkonijn/fix/sensor-bricking-from-dup…
crashkonijn Jul 24, 2024
f0cd766
Merge pull request #210 from crashkonijn/fix/removed-target-from-run-…
crashkonijn Jul 24, 2024
ea47a07
Merge pull request #211 from crashkonijn/feature/added-graph-viewer-s…
crashkonijn Jul 24, 2024
c54327c
Merge pull request #212 from crashkonijn/feature/added-target-state-i…
crashkonijn Jul 24, 2024
123bff2
Added distance information to agent editor
crashkonijn Jul 24, 2024
f2575bc
Merge pull request #213 from crashkonijn/feature/added-range-informat…
crashkonijn Jul 24, 2024
5551a50
Update version to 3.0.7-beta
crashkonijn Jul 24, 2024
b580efa
Merge pull request #214 from crashkonijn/update-version-3.0.7-beta
crashkonijn Jul 24, 2024
22472f6
Fix: ActionBuilder breaking from custom base classes
crashkonijn Jul 26, 2024
2c2b6c4
Update ActionBuilder.cs
crashkonijn Jul 26, 2024
16cd1d8
Merge pull request #215 from crashkonijn/fix/action-builder-breaking-…
crashkonijn Jul 26, 2024
0f95dd5
Update version to 3.0.8-beta
crashkonijn Jul 26, 2024
4d59fb6
Merge pull request #216 from crashkonijn/update-version-3.0.8-beta
crashkonijn Jul 26, 2024
d75d1a2
Add TargetLost event
SlayerDF Jul 29, 2024
f50338b
Fixes #217
crashkonijn Jul 29, 2024
764e81f
Fixed agent state not resetting correctly
crashkonijn Jul 29, 2024
911f73d
Merge pull request #219 from crashkonijn/fix/resolver-picking-complet…
crashkonijn Jul 29, 2024
004cb88
Merge pull request #220 from crashkonijn/fix/action-state-not-being-r…
crashkonijn Jul 29, 2024
10c0020
Update version to 3.0.9-beta
crashkonijn Jul 29, 2024
7d08d39
Merge pull request #221 from crashkonijn/update-version-3.0.9-beta
crashkonijn Jul 29, 2024
28f6008
Move TargetLost invocation in UpdateTarget
SlayerDF Jul 29, 2024
0003c51
Removed else statement
crashkonijn Jul 30, 2024
25e51f5
Merge pull request #218 from SlayerDF/feature/added-target-lost-event
crashkonijn Jul 30, 2024
4ffacf9
Updated demo move behaviours
crashkonijn Jul 30, 2024
2c8f9fc
Added docs about OnTargetLost
crashkonijn Jul 30, 2024
4d6e291
Update version to 3.0.10-beta
crashkonijn Jul 30, 2024
2ba1c6b
Merge pull request #222 from crashkonijn/update-version-3.0.10-beta
crashkonijn Jul 30, 2024
f7c02e0
Fixed: Custom IsValid not working
crashkonijn Aug 22, 2024
9f13b0a
Update GoapActionBaseTests.cs
crashkonijn Aug 22, 2024
6aab4bb
Merge pull request #225 from crashkonijn/fix/custom-isvalid-not-working
crashkonijn Aug 22, 2024
71a8807
Update version to 3.0.11-beta
crashkonijn Aug 22, 2024
d7e74a4
Merge pull request #226 from crashkonijn/update-version-3.0.11-beta
crashkonijn Aug 22, 2024
8e3b870
Fixed recursive stack
crashkonijn Aug 22, 2024
57f8e81
Merge pull request #227 from crashkonijn/fix/recursive-stack
crashkonijn Aug 22, 2024
278f7b6
Update version to 3.0.12-beta
crashkonijn Aug 22, 2024
59e5f22
Merge pull request #228 from crashkonijn/update-version-3.0.12-beta
crashkonijn Aug 22, 2024
bd4fc62
Added target to GetCost method. Fixes #232
crashkonijn Sep 13, 2024
0e25697
Merge pull request #234 from crashkonijn/feature/target-in-get-cost-m…
crashkonijn Sep 13, 2024
7aee645
GITBOOK-1: No subject
Crash-Konijn Sep 13, 2024
969a7fd
Update version to 3.0.13-beta
crashkonijn Sep 13, 2024
d18c4ae
Merge pull request #235 from crashkonijn/update-version-3.0.13-beta
crashkonijn Sep 13, 2024
d9e7d28
Fixed #238
crashkonijn Sep 17, 2024
84f3031
Merge pull request #239 from crashkonijn/fix/node-viewer-target-indic…
crashkonijn Sep 17, 2024
f9cd3dc
Fixes #236
crashkonijn Sep 17, 2024
3c66f2a
Merge pull request #240 from crashkonijn/fix/agents-not-enabling-disa…
crashkonijn Sep 17, 2024
731c196
Re-provide the previous target instance to reduce GC. See #152
crashkonijn Sep 17, 2024
7633f89
Implemented smarter sensor running, local sensors now only run for th…
crashkonijn Sep 17, 2024
7e2dd97
Merge pull request #241 from crashkonijn/feature/provide-previous-tar…
crashkonijn Sep 17, 2024
a4f5ce9
Fixed tests
crashkonijn Sep 17, 2024
a92dbbf
Merge pull request #242 from crashkonijn/feature/only-update-sensors-…
crashkonijn Sep 17, 2024
15c8c53
GITBOOK-2: No subject
Crash-Konijn Sep 17, 2024
0b9e237
Updated docs
crashkonijn Sep 17, 2024
173f042
Update version to 3.0.14-beta
crashkonijn Sep 17, 2024
46a239c
Merge pull request #243 from crashkonijn/update-version-3.0.14-beta
crashkonijn Sep 17, 2024
14998eb
Partial docs update
crashkonijn Sep 18, 2024
8573c35
Partial docs update
crashkonijn Sep 18, 2024
1bf3d0e
Update Setup.md
crashkonijn Sep 18, 2024
701e23e
Update of setup docs
crashkonijn Sep 18, 2024
637274e
Update of tutorial
crashkonijn Sep 18, 2024
2a56c9a
Added gif
crashkonijn Sep 18, 2024
b955d8a
Scene update
crashkonijn Sep 18, 2024
64b16f4
Update AgentCollection.cs
crashkonijn Sep 18, 2024
e48e2b0
Fixed AgentCollection accepting disabled agents
crashkonijn Sep 18, 2024
dc2e2aa
Fixed updating graph when ActionProvider is disabled
crashkonijn Sep 18, 2024
62e29d8
Merge pull request #244 from crashkonijn/fix/get-cost-getting-called-…
crashkonijn Sep 18, 2024
57dffde
Style fixes
crashkonijn Sep 18, 2024
917ff5b
Update version to 3.0.15-beta
crashkonijn Sep 18, 2024
51fc996
Merge pull request #245 from crashkonijn/update-version-3.0.15-beta
crashkonijn Sep 18, 2024
bd3ec0c
Added missing assembly definition names to docs
crashkonijn Sep 19, 2024
2648d14
Extended tutorial
crashkonijn Sep 19, 2024
db983a7
Update SUMMARY.md
crashkonijn Sep 19, 2024
0087de9
Update SUMMARY.md
crashkonijn Sep 19, 2024
e3fe233
temp
crashkonijn Sep 19, 2024
5d05ac2
asset changes for docs
crashkonijn Sep 24, 2024
4387881
Added sensor timers!
crashkonijn Sep 24, 2024
f313653
Fixes #251
crashkonijn Sep 24, 2024
d83ff50
Fixes #249
crashkonijn Sep 24, 2024
c9f94c7
Fixes #248
crashkonijn Sep 24, 2024
1dd1bbc
Fixes the sensor runner breaking when switching agent types #252
crashkonijn Sep 24, 2024
c9a7d56
Merge pull request #253 from crashkonijn/fix/unity-editor-reference-i…
crashkonijn Sep 24, 2024
ba89e83
Merge pull request #255 from crashkonijn/fix/graph-viewer-zoom-inverted
crashkonijn Sep 24, 2024
cacf656
Merge pull request #256 from crashkonijn/fix/expose-proactive-control…
crashkonijn Sep 24, 2024
16c728d
Merge pull request #257 from crashkonijn/fix/sensor-runner-breaking-w…
crashkonijn Sep 24, 2024
dcfda43
Caches GoalRequest key used by the sensor runner. Fixes #258
crashkonijn Sep 24, 2024
b9ebb96
Merge pull request #259 from crashkonijn/fix/sensor-runner-producing-gc
crashkonijn Sep 24, 2024
844285f
Fixed tests
crashkonijn Sep 25, 2024
7d080bc
Merge pull request #254 from crashkonijn/feature/add-timing-controll-…
crashkonijn Sep 25, 2024
a989ed3
Merge branch 'feature/v2.2' into fix/gc
crashkonijn Sep 25, 2024
597c263
Merge branch 'feature/v2.2' into fix/gc
crashkonijn Sep 25, 2024
bc37a8d
Lowered GC
crashkonijn Sep 25, 2024
758d3ee
Fixed tests
crashkonijn Sep 25, 2024
409ee0d
Reverted name change, removed commented code
crashkonijn Sep 25, 2024
a81c13d
Merge pull request #260 from crashkonijn/fix/gc
crashkonijn Sep 25, 2024
4ed64fc
Update version to 3.0.16-beta
crashkonijn Sep 25, 2024
e9d4d4a
Merge pull request #261 from crashkonijn/update-version-3.0.16-beta
crashkonijn Sep 25, 2024
30266e5
Hotfix
crashkonijn Sep 26, 2024
ff12a26
Update version to 3.0.17-beta
crashkonijn Sep 26, 2024
2726b03
Merge pull request #262 from crashkonijn/update-version-3.0.17-beta
crashkonijn Sep 26, 2024
b686754
Create .editorconfig
crashkonijn Sep 26, 2024
2829709
Chore: applied code-style
crashkonijn Sep 26, 2024
00628e4
Merge pull request #263 from crashkonijn/chore/code-style
crashkonijn Sep 26, 2024
4d13e00
Fix: Added readme.md
crashkonijn Oct 2, 2024
93bc60f
Merge pull request #265 from crashkonijn/fix/added-readme-md
crashkonijn Oct 2, 2024
a3ac13b
Fix: Re-added 2021 support
crashkonijn Oct 2, 2024
de147f8
Merge pull request #266 from crashkonijn/feature/re-add-2021-support-…
crashkonijn Oct 2, 2024
0a9df4b
Merge branch 'master' into feature/v2.2
crashkonijn Oct 2, 2024
924b413
Update version to 3.0.18-beta
crashkonijn Oct 2, 2024
ea3798c
Updated demo
crashkonijn Oct 2, 2024
cb02d70
Merge pull request #267 from crashkonijn/update-version-3.0.18-beta
crashkonijn Oct 2, 2024
3be945f
Removed UserSettings
crashkonijn Oct 3, 2024
49b0b99
Update .gitignore
crashkonijn Oct 3, 2024
65ff864
Fixed: GraphViewer throwing null error when selected object was destr…
crashkonijn Oct 3, 2024
2d3e10b
Trying to remove case differences in folders
crashkonijn Oct 4, 2024
d0aba33
Changed folder name back to Documentation
crashkonijn Oct 4, 2024
6180b0d
Disabled native leak detection during tests
crashkonijn Oct 4, 2024
3a3c9a0
Merge pull request #270 from crashkonijn/fix/pipeline-breaking
crashkonijn Oct 4, 2024
045088f
Merge pull request #268 from crashkonijn/fix/graph-viewer-null-when-s…
crashkonijn Oct 4, 2024
42ee82c
Merge branch 'master' into feature/v2.2
crashkonijn Oct 4, 2024
97d03c8
Fix #271
crashkonijn Oct 8, 2024
c6ec8a0
Merge pull request #272 from crashkonijn/fix/null-agent-type-config-f…
crashkonijn Oct 8, 2024
3807e21
Update version to 3.0.19-beta
crashkonijn Oct 8, 2024
0ac12e7
Merge pull request #273 from crashkonijn/update-version-3.0.19-beta
crashkonijn Oct 8, 2024
039b2af
Fixes #274
crashkonijn Oct 9, 2024
4ff2431
Fixes missing target warning with RequiresTarget set to false
crashkonijn Oct 9, 2024
5dbc79e
Fixes #250
crashkonijn Oct 9, 2024
2aeca39
Merge pull request #275 from crashkonijn/fix/goal-start-event-called-…
crashkonijn Oct 9, 2024
1103be6
Merge pull request #276 from crashkonijn/fix/target-missing-warning-w…
crashkonijn Oct 9, 2024
6622c69
Merge pull request #277 from crashkonijn/feature/added-config-callbacks
crashkonijn Oct 9, 2024
829e154
Update version to 3.0.20-beta
crashkonijn Oct 9, 2024
cd2941f
Updated demo
crashkonijn Oct 9, 2024
8639d56
Merge pull request #278 from crashkonijn/update-version-3.0.20-beta
crashkonijn Oct 9, 2024
70fde07
Docs update
crashkonijn Oct 11, 2024
ecc3830
Docs update
crashkonijn Oct 11, 2024
9f1f1f9
Docs update
crashkonijn Oct 11, 2024
320cb14
Fixes #284
crashkonijn Nov 6, 2024
9f1b33c
Added config to disable target validation. Fixes #285
crashkonijn Nov 6, 2024
b33e58d
Added various null checks. Fixes #287
crashkonijn Nov 6, 2024
88d4da4
Added docs about multi sensors and sensor timer control
crashkonijn Nov 6, 2024
31a56e3
Merge pull request #288 from crashkonijn/fix/added-various-null-checks
crashkonijn Nov 6, 2024
2f1936a
Merge pull request #289 from crashkonijn/feature/disable-target-valid…
crashkonijn Nov 6, 2024
948ffbd
Merge pull request #290 from crashkonijn/fix/graph-viewer-keeps-dragg…
crashkonijn Nov 6, 2024
f2bc77d
Merge pull request #291 from crashkonijn/docs/added-multi-sensor-docs
crashkonijn Nov 6, 2024
a51e878
Update version to 3.0.21-beta
crashkonijn Nov 6, 2024
16abeb1
Merge pull request #292 from crashkonijn/update-version-3.0.21-beta
crashkonijn Nov 6, 2024
bb91926
Update Sensors.md
crashkonijn Nov 6, 2024
08fd2d9
Removed Unity from display name
crashkonijn Nov 7, 2024
f7cf91c
Fixes multi-sensor missing keys warning
crashkonijn Nov 7, 2024
ffa8bd7
Merge pull request #293 from crashkonijn/fix/multi-sensor-missing-key…
crashkonijn Nov 7, 2024
6d66cda
Fixed tests
crashkonijn Nov 7, 2024
a8cf6ef
Merge pull request #294 from crashkonijn/fix/multi-sensor-missing-key…
crashkonijn Nov 7, 2024
95d450c
Actions can now be (temporarily) disabled per action instead of actio…
crashkonijn Nov 13, 2024
665074a
Merge pull request #295 from crashkonijn/feature/better-action-disabler
crashkonijn Nov 13, 2024
6b77091
Implemented IActionRunstate.MayResolve logic
crashkonijn Nov 13, 2024
b5b4574
Update version to 3.0.22-beta
crashkonijn Nov 13, 2024
341d286
Updated demo
crashkonijn Nov 13, 2024
d8d39a9
Update AgentTypeJobRunnerTests.cs
crashkonijn Nov 13, 2024
84be1b2
Merge pull request #296 from crashkonijn/feature/mayresolve
crashkonijn Nov 13, 2024
fa53a5d
Merge pull request #297 from crashkonijn/update-version-3.0.22-beta
crashkonijn Nov 13, 2024
0f2b692
Added turn based example
crashkonijn Nov 13, 2024
6c3bc8a
Merge pull request #298 from crashkonijn/feature/turn-based-example
crashkonijn Nov 13, 2024
90dd1cf
Fixed SetDistanceMultiplierSpeed with 0 breaking the resolver
crashkonijn Nov 14, 2024
14faa34
Merge pull request #299 from crashkonijn/fix/distance-multiplier-spee…
crashkonijn Nov 14, 2024
85e69e1
Update version to 3.0.23-beta
crashkonijn Nov 14, 2024
2c34c46
Merge pull request #300 from crashkonijn/update-version-3.0.23-beta
crashkonijn Nov 14, 2024
9e257d2
Updated sponsoring info
crashkonijn Nov 14, 2024
d9b39a6
Merge pull request #302 from crashkonijn/feature/sponsoring
crashkonijn Nov 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 4 additions & 0 deletions Demo/Assembly-CSharp-Editor.csproj.DotSettings
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=assets_005Ccrashkonijn/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=assets_005Ccrashkonijn_005Cgoap/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=assets_005Ccrashkonijn_005Cgoap_005Cdemos/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=assets_005Ccrashkonijn_005Cgoap_005Cdemos_005Ccomplex/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=assets_005Cpackages/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
4 changes: 4 additions & 0 deletions Demo/Assembly-CSharp.csproj.DotSettings
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=assets_005Ccrashkonijn/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=assets_005Ccrashkonijn_005Cgoap/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=assets_005Ccrashkonijn_005Cgoap_005Cdemos/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=assets_005Ccrashkonijn_005Cgoap_005Cdemos_005Ccomplex/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=assets_005Cpackages/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
using System.Linq;
using CrashKonijn.Goap.Behaviours;
using CrashKonijn.Goap.Classes;
using CrashKonijn.Goap.Classes.References;
using CrashKonijn.Goap.Enums;
using CrashKonijn.Goap.Interfaces;
using Demos.Complex.Behaviours;
using Demos.Complex.Classes.Items;
using Demos.Complex.Goap;
using Demos.Complex.Interfaces;
using System;
using System.Linq;
using CrashKonijn.Agent.Core;
using CrashKonijn.Agent.Runtime;
using CrashKonijn.Goap.Demos.Complex.Behaviours;
using CrashKonijn.Goap.Demos.Complex.Classes.Items;
using CrashKonijn.Goap.Demos.Complex.Goap;
using CrashKonijn.Goap.Demos.Complex.Interfaces;
using CrashKonijn.Goap.Runtime;
using UnityEngine;
using Random = UnityEngine.Random;

namespace Demos.Complex.Actions
namespace CrashKonijn.Goap.Demos.Complex.Actions
{
public class CreateItemAction<TCreatable> : ActionBase<CreateItemAction<TCreatable>.Data>, IInjectable
public class CreateItemAction<TCreatable> : GoapActionBase<CreateItemAction<TCreatable>.Data, CreateItemAction<TCreatable>.Props>, IInjectable
where TCreatable : ItemBase, ICreatable
{
private ItemFactory itemFactory;
Expand All @@ -30,60 +30,50 @@ public override void Created()

public override void Start(IMonoAgent agent, Data data)
{
data.Timer = 5f;
data.RequiredWood = this.GetRequiredWood();
data.RequiredIron = this.GetRequiredIron();
data.WaitState = ActionRunState.Wait(5f);
}

public override ActionRunState Perform(IMonoAgent agent, Data data, ActionContext context)
public override void BeforePerform(IMonoAgent agent, Data data)
{
if (data.State == State.NotStarted)
this.RemoveRequiredResources(data);
}

public override IActionRunState Perform(IMonoAgent agent, Data data, IActionContext context)
{
if (data.WaitState.IsRunning())
{
data.State = State.Started;
this.RemoveRequiredResources(data);
return data.WaitState;
}

data.Timer -= context.DeltaTime;

if (data.Timer > 0)
return ActionRunState.Continue;

var item = this.itemFactory.Instantiate<TCreatable>();
item.transform.position = this.GetRandomPosition(agent);

return ActionRunState.Stop;
return ActionRunState.Completed;
}

public override void Stop(IMonoAgent agent, Data data)
{
}

public override void End(IMonoAgent agent, Data data)
public override void Complete(IMonoAgent agent, Data data)
{
var item = this.itemFactory.Instantiate<TCreatable>();
item.transform.position = this.GetRandomPosition(agent);
}

private void RemoveRequiredResources(Data data)
{
for (var i = 0; i < data.RequiredIron; i++)
for (var i = 0; i < this.Properties.requiredIron; i++)
{
var iron = data.Inventory.Get<Iron>().FirstOrDefault();
data.Inventory.Remove(iron);
this.instanceHandler.QueueForDestroy(iron);
}

for (var j = 0; j < data.RequiredWood; j++)
for (var j = 0; j < this.Properties.requiredWood; j++)
{
var wood = data.Inventory.Get<Wood>().FirstOrDefault();
data.Inventory.Remove(wood);
this.instanceHandler.QueueForDestroy(wood);
}
}

private int GetRequiredWood()
{
return this.Config.Conditions.FirstOrDefault(x => x.WorldKey.Name == "IsHolding<Wood>")!.Amount;
}

private int GetRequiredIron()
{
return this.Config.Conditions.FirstOrDefault(x => x.WorldKey.Name == "IsHolding<Iron>")!.Amount;
}

private Vector3 GetRandomPosition(IMonoAgent agent)
{
Expand All @@ -92,22 +82,20 @@ private Vector3 GetRandomPosition(IMonoAgent agent)
return agent.transform.position + new Vector3(pos.x, 0f, pos.y);
}

[Serializable]
public class Props : IActionProperties
{
public int requiredWood;
public int requiredIron;
}

public class Data : IActionData
{
public ITarget Target { get; set; }
public int RequiredWood { get; set; }
public int RequiredIron { get; set; }
public State State { get; set; } = State.NotStarted;
public float Timer { get; set; }
public IActionRunState WaitState { get; set; }

[GetComponent]
public ComplexInventoryBehaviour Inventory { get; set; }
}

public enum State
{
NotStarted,
Started
}
}
}
46 changes: 23 additions & 23 deletions Demo/Assets/CrashKonijn/GOAP/Demos/Complex/Actions/EatAction.cs
Original file line number Diff line number Diff line change
@@ -1,25 +1,23 @@
using System.Linq;
using CrashKonijn.Goap.Behaviours;
using CrashKonijn.Goap.Classes;
using CrashKonijn.Goap.Classes.References;
using CrashKonijn.Goap.Enums;
using CrashKonijn.Goap.Interfaces;
using Demos.Complex.Behaviours;
using Demos.Complex.Goap;
using Demos.Complex.Interfaces;
using Demos.Shared.Behaviours;
using CrashKonijn.Agent.Core;
using CrashKonijn.Agent.Runtime;
using CrashKonijn.Goap.Demos.Complex.Behaviours;
using CrashKonijn.Goap.Demos.Complex.Goap;
using CrashKonijn.Goap.Demos.Complex.Interfaces;
using CrashKonijn.Goap.Runtime;
using UnityEngine;

namespace Demos.Complex.Actions
namespace CrashKonijn.Goap.Demos.Complex.Actions
{
public class EatAction : ActionBase<EatAction.Data>, IInjectable
public class EatAction : GoapActionBase<EatAction.Data>, IInjectable
{
private InstanceHandler instanceHandler;

public void Inject(GoapInjector injector)
{
this.instanceHandler = injector.instanceHandler;
}

public override void Created()
{
}
Expand All @@ -30,28 +28,30 @@ public override void Start(IMonoAgent agent, Data data)
data.Inventory.Hold(data.Eatable);
}

public override ActionRunState Perform(IMonoAgent agent, Data data, ActionContext context)
public override bool IsValid(IActionReceiver agent, Data data)
{
if (data.Eatable == null)
return ActionRunState.Stop;
return false;

return true;
}

public override IActionRunState Perform(IMonoAgent agent, Data data, IActionContext context)
{
var eatNutrition = context.DeltaTime * 20f;
data.Eatable.NutritionValue -= eatNutrition;
data.Hunger.hunger -= eatNutrition;
data.ComplexHunger.hunger -= eatNutrition;

if (data.Hunger.hunger <= 20f)
return ActionRunState.Stop;
if (data.ComplexHunger.hunger <= 20f)
return ActionRunState.Completed;

if (data.Eatable.NutritionValue > 0)
return ActionRunState.Continue;

if (data.Eatable == null)
return ActionRunState.Stop;

data.Inventory.Remove(data.Eatable);
this.instanceHandler.QueueForDestroy(data.Eatable);

return ActionRunState.Stop;
return ActionRunState.Completed;
}

public override void End(IMonoAgent agent, Data data)
Expand All @@ -62,7 +62,7 @@ public override void End(IMonoAgent agent, Data data)
if (data.Eatable.NutritionValue > 0)
data.Inventory.Add(data.Eatable);
}

public class Data : IActionData
{
public ITarget Target { get; set; }
Expand All @@ -72,7 +72,7 @@ public class Data : IActionData
public ComplexInventoryBehaviour Inventory { get; set; }

[GetComponent]
public HungerBehaviour Hunger { get; set; }
public ComplexHungerBehaviour ComplexHunger { get; set; }
}
}
}
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
using CrashKonijn.Goap.Behaviours;
using CrashKonijn.Goap.Classes;
using CrashKonijn.Goap.Classes.References;
using CrashKonijn.Goap.Enums;
using CrashKonijn.Goap.Interfaces;
using Demos.Complex.Behaviours;
using Demos.Complex.Goap;
using Demos.Complex.Interfaces;
using System;
using CrashKonijn.Agent.Core;
using CrashKonijn.Agent.Runtime;
using CrashKonijn.Goap.Demos.Complex.Behaviours;
using CrashKonijn.Goap.Demos.Complex.Goap;
using CrashKonijn.Goap.Demos.Complex.Interfaces;
using CrashKonijn.Goap.Runtime;
using UnityEngine;
using Random = UnityEngine.Random;

namespace Demos.Complex.Actions
namespace CrashKonijn.Goap.Demos.Complex.Actions
{
public class GatherItemAction<TGatherable> : ActionBase<GatherItemAction<TGatherable>.Data>, IInjectable
public class GatherItemAction<TGatherable> : GoapActionBase<GatherItemAction<TGatherable>.Data, GatherItemAction<TGatherable>.Props>, IInjectable
where TGatherable : ItemBase
{
private ItemFactory itemFactory;
Expand All @@ -27,40 +27,51 @@ public override void Created()
public override void Start(IMonoAgent agent, Data data)
{
// There is a normal and slow version of this action
// based on whether or not the agent is holding an (pick)axe
// We use the cost as a timer
data.Timer = this.Config.BaseCost;
// based on whether the agent is holding a (pick)axe
data.WaitState = ActionRunState.Wait(this.Properties.timer);
}

public override ActionRunState Perform(IMonoAgent agent, Data data, ActionContext context)
public override IActionRunState Perform(IMonoAgent agent, Data data, IActionContext context)
{
data.Timer -= context.DeltaTime;

if (data.Timer > 0)
return ActionRunState.Continue;
if (data.WaitState.IsRunning())
return data.WaitState;

var item = this.itemFactory.Instantiate<TGatherable>();

item.transform.position = this.GetRandomPosition(agent);

if (this.Properties.pickupItem)
data.Inventory.Add(item);

return ActionRunState.Stop;
}

public override void End(IMonoAgent agent, Data data)
public override void Stop(IMonoAgent agent, Data data)
{
}


public override void Complete(IMonoAgent agent, Data data)
{
}

private Vector3 GetRandomPosition(IMonoAgent agent)
{
var pos = Random.insideUnitCircle.normalized * Random.Range(1f, 2f);

return agent.transform.position + new Vector3(pos.x, 0f, pos.y);
}

[Serializable]
public class Props : IActionProperties
{
public bool pickupItem = false;
public float timer = 3f;
}

public class Data : IActionData
{
public ITarget Target { get; set; }
public float Timer { get; set; }

public IActionRunState WaitState { get; set; }
[GetComponent]
public ComplexInventoryBehaviour Inventory { get; set; }
}
Expand Down
Loading
Loading