Commit Graph

57 Commits

Author SHA1 Message Date
mikko mononen
51aa286c45 State Tree: Added new selection behaviors for states
- Added selection behavior None (not selectable)
- Added selection behavior TryEnterState (enters the specific state, does not consider child states)
- Added selection behavior TryFollowTransitions (follows transitions when state is tried to be selected)
- Brushed up a bit the state representation in editor (added icons, cleaned up layout)

#preflight 6436843df12d5de705595942

[CL 25005118 by mikko mononen in ue5-main branch]
2023-04-12 07:59:16 -04:00
yoan stamant
1aafe8d726 [StateTreeDebugger] replaced debug serial number mappings by single global counter.
#rnx
#rb maxime.mercier
#preflight 64130c30290c6e5d77d528b9

[CL 24672052 by yoan stamant in ue5-main branch]
2023-03-16 11:43:35 -04:00
yoan stamant
64c8dca7cb [StateTreeDebugger]
Initial version of the debugger
- currently compiled by StateTreeModule and StateTreeEditorModule using WITH_STATETREE_DEBUGGER
- currently not exposed to UI by StateTree settings 'bUseDebugger'
- in this version only one instance per asset can be debugged
- using Trace services to read events generated by statetree instances.
- can connect to any traces (Editor, Client, Server) as long as the compiled statetree matches
#rb mieszko.zielinski
#preflight 641088a30e1f02786b509663

[CL 24639409 by yoan stamant in ue5-main branch]
2023-03-14 13:35:46 -04:00
mikko mononen
c828983bd3 State Tree: fix delayed transitions
- Fixed bug where delayed transitions from events were not triggered properly.

#preflight 6410735f5819afacafa78ce4

[CL 24635553 by mikko mononen in ue5-main branch]
2023-03-14 10:40:47 -04:00
stephen holmes
97766341ea Refactored FSructView and FConstStructView as per recent meetings. Both are now const correct in the same way TArrayView and TArrayConstView are (ie const FStructView and const FConstStructView) the view can not point at another view.
Also removed the Mutable named functions and replaced with the constness being part of the template.

#preflight 63ea4fbaec50523134d85665

[CL 24197313 by stephen holmes in ue5-main branch]
2023-02-13 20:06:02 -05:00
mikko mononen
653d387d74 StateTree: Revert clearing data views in UpdateInstanceData() as it was parameters and external data too.
#preflight 63e5f8aaf15c83b79301ac15

[CL 24116342 by mikko mononen in ue5-main branch]
2023-02-10 04:19:40 -05:00
mikko mononen
88b7fae0e7 StateTree: fix eval & global task dataviews after UpdateInstanceData.
#jira UE-176091
#rb Mieszko.Zielinski
#preflight 63e49a5004684547086aa714

[CL 24094032 by mikko mononen in ue5-main branch]
2023-02-09 04:20:59 -05:00
mikko mononen
e2fd3455a9 StateTree: Allow tasks to request transitions
- Added ability for tasks to request transitions
- Added buffered transition requests
- Added callback method to FStateTreeTaskBase which is called during transition triggering
- Allow FStateTreeStateLink to be added to tasks and conditions (resolved automatically during compile)

#jira UE-174250
#preflight 63ca7ee8977c62635603afcb

[CL 23815873 by mikko mononen in ue5-main branch]
2023-01-23 12:48:04 -05:00
henrik karlsson
9183978e29 [Engine/Plugins]
* Removed includes (using IWYU) in private files

#preflight 63c79978ac35a0e9dabbe408
#rb none

[CL 23770038 by henrik karlsson in ue5-main branch]
2023-01-19 00:48:07 -05:00
mikko mononen
57a0d8a492 StateTree: More graceful handling of GetStateTreeRunStatus()
- Calling GetStateTreeRunStatus() on unintialized instance is not error anymore, returns failed
- Made UStateTreeComponent::GetStateTreeRunStatus() to return failed instead of unset to be consistent with FStateTreeExecutionContext
- Allow to access execution state directly from instance data without exec context
- Do no crete exec context in UStateTreeComponent when sending events

#jira UE-173207
#preflight 63bfec4af02e72c08cab1811

[CL 23661828 by mikko mononen in ue5-main branch]
2023-01-12 09:00:45 -05:00
mikko mononen
ab3816dd30 StateTree: Added global tasks
- Added global tasks which are run at tree level similar to evals (will replace evals)
	- allows initial state selection to rely in calculated data (e.g. world conditions)
	- allows better reuse of existing logic
- Call evaluator stop in reverse order
- Use some uses of mutable instanced structs
- Copy bindings along with ST nodes
- Remove bindings when removing a ST node, so that undo can restore them

#rb Yoan.StAmant
#preflight 63bd2c7968068a8bd6395d2c

[CL 23632408 by mikko mononen in ue5-main branch]
2023-01-10 15:44:28 -05:00
foobit
7c8f7ac6fe PR #9830: [StateTree] StateTreeComponent.GetStateTreeRunStatus method and status delegate (Contributed by foobit)
#rb Mikko.Mononen
#preflight 639c374143330e63e5bb8fd0

[CL 23536754 by foobit in ue5-main branch]
2022-12-16 05:45:13 -05:00
mikko mononen
fe252a1f95 StructUtils: Renamed FInstancedStructArray to FInstancedStructContainer
#jira UE-170863
#rb Mieszko.Zielinski
#preflight 638debbb7e0feab0b7da3359

[CL 23389832 by mikko mononen in ue5-main branch]
2022-12-05 09:16:27 -05:00
Stephen Holmes
2f18773caa Addressing the remaining AI numeric conversion issues.
#jira UE-166285
#review
#preflight 638a031b35192facc1c0fd77

[CL 23372606 by Stephen Holmes in ue5-main branch]
2022-12-02 10:07:29 -05:00
mikko mononen
df359ce99e StateTree: Transition improvements
- Removed gated delay (transition will be delayed until it has been "pressed" for N seconds)
- Delay now triggers after the delay duration has passed (single trigger, not "pressed", works with events too)
- Added random variation for the delay
- Tick/Event transitions has precedence over completion transitions (that is, they are handled before completion transitions)
- Removed delay and blocking from completion transitions
- Small improvements for transitions UI

#rb Mieszko.Zielinski
#preflight 6389e0b435192facc1b95cdb

[CL 23371519 by mikko mononen in ue5-main branch]
2022-12-02 07:57:31 -05:00
mikko mononen
1cc286a596 StateTree: Add indirection to FStateTreeInstanceData so that it can be bitwise relocated.
#rb Mieszko.Zielinski
#preflight 63872b0d3377450900b579a6

[CL 23325782 by mikko mononen in ue5-main branch]
2022-11-30 07:17:26 -05:00
mikko mononen
e450d18a9f StateTree Fixes and Improvements
- Use hierarchical GamplayTag match when matchin transition event tags
- When returning succeed/failed fomr a subtree, handle it as if the linked state was completed
- Call Stop() before initializing the instance data on Start() to avoid the instance data to be overritten by Stop()
- Early out Stop() if the tree is not running
- Fixed failed transition not setting OutTransition.CurrentActiveStates correctly

#preflight 637e12ee8b12eb83a71bb694

[CL 23248889 by mikko mononen in ue5-main branch]
2022-11-23 09:22:14 -05:00
mikko mononen
2c797f2adb StateTree: Changed completion transitions to trigger at the state that was first completed.
- record the first completed state on EnterState() and TickTasks()
- returning succeeded on any node in EnterState() now behaves the same as returning succeeded on Tick()

#rb Mieszko.Zielinski
#preflight 637caf2df514e1ded9f280e4

[CL 23233890 by mikko mononen in ue5-main branch]
2022-11-22 08:13:54 -05:00
mikko mononen
0bc7b2da87 StateTree
- restored deprecation (was comments out due to submitting code via multiple CLs)
- cleaned up logging
- skip property binding to not take place when task is not ticked

#rb Mieszko.Zielinski
#preflight 636373961608da6ba1c3a8f2

[CL 22959061 by mikko mononen in ue5-main branch]
2022-11-03 14:21:53 -04:00
mikko mononen
186e03b32e StateTree: Improved event handling
- Moved event queue to it's own struct
- Changed the SendEvent() API to accept struct view to prevent instanced struct copy in common cases
- Fixed event handling in case EnterState() fails.
- Added option for Tasks to disavble ticking, or to be ticked only when there are events
- Added option for Tasks handle when properties are copied
- Changed DebugText to use external Actor reference
- Changed DelayTask to use the new GetInstanceData which does not need type
- Added TStateTreeInstanceDataStructRef which can be used to access struct instance data in delegates

#rb Maxime.Mercier Luciano.Ferraro
#preflight 6360dd302b5338aceb2d0343

[CL 22888708 by mikko mononen in ue5-main branch]
2022-11-01 15:11:19 -04:00
mikko mononen
f7c48b982d StateTree: Change Task EnterState/ExitState signature
- Removed change type from EnterState/ExitState and moved it to transition result
- Added bShouldStateChangeOnReselect which allows to configure a task to behave more like state
- Updated existing tasks

#jira UE-156544
#rb Mieszko.Zielinski
#preflight 6333f6dca907d7192f5f0ccc

[CL 22221382 by mikko mononen in ue5-main branch]
2022-09-28 09:55:53 -04:00
bryan sefcik
50d4fac9e0 Updated ../Engine/Plugins/... to inline gen.cpp files
Before:
3548 unity files
Total CPU Time: 47343.578125 s
Total time in Parallel executor: 494.60 seconds

After:
3445 unity files
Total CPU Time: 46044.671875 s
Total time in Parallel executor: 468.51 seconds

#jira
#preflight 63336159b20e73a098b7f24f

[CL 22218213 by bryan sefcik in ue5-main branch]
2022-09-28 01:06:15 -04:00
luciano ferraro
230999d8ed Fixed crash when a task fails and one of its children instance data does not get updated anymore because of that, resulting in nullptr access during on completion
#jira
[REVIEW] [at]Mikko.Mononen
[FYI] Loic.Devaux, Josselin.Francois, Nicolas.Bonnelly, Phil.Cole
#preflight 6332c326e11ae0b19c033708

[CL 22206229 by luciano ferraro in ue5-main branch]
2022-09-27 10:55:54 -04:00
mikko mononen
b24ef66a2f StateTree: Removed internal instance from StateTree execution context.
#rb Mieszko.Zielinski
#preflight 632d72ca1003050806b168c2

[CL 22163646 by mikko mononen in ue5-main branch]
2022-09-23 20:02:42 -04:00
mikko mononen
ab1b7f80cf StateTree: fix test and empty parameters
- handle empty subtree parameters
- changed a compiler check() to an error
- fixed tests

#jira UE-164541
#rb Mieszko.Zielinski
#preflight 632c4e77671a1a24b5ff67a6

[CL 22163478 by mikko mononen in ue5-main branch]
2022-09-23 19:58:36 -04:00