Commit Graph

30 Commits

Author SHA1 Message Date
mieszko zielinski
d2e23f71dc [Mass][InstancedActors] The change adds a lot of comments and improves readability in multiple places
#rb mieszko.zielinski
#jira UE-219738

[CL 36754020 by mieszko zielinski in 5.5 branch]
2024-10-01 18:56:00 -04:00
mieszko zielinski
7234748e7e [Mass] late-summer cleaning:
* moved UMassProcessor's inlines to the end of the header to keep the API look clean
* moved the virtuals defined in the header over to the cpp
* comments spellig fixes and improvements.

#rb mieszko.zielinski

[CL 36426024 by mieszko zielinski in 5.5 branch]
2024-09-19 06:57:07 -04:00
mieszko zielinski
788c981498 [Mass] Added a way to clear out specific tag requirement from FMassFragmentRequirements
#jira UE-219738
#rb mieszko.zielinski

[CL 36383024 by mieszko zielinski in 5.5 branch]
2024-09-18 05:46:56 -04:00
mieszko zielinski
54dde11b4f [Mass] Added a flag to MassProcessor to mark processor instances as "dynamic", both for debugging purposes as well as special handling of dynamic processors by the Phase Manager.
Also:
* marking processors that were removed by the dependency solver as garbage, while WITH_MASSENTITY_DEBUG, which helps MassDebugger's processor view's readability
* minor touches to MassProcessor. Moved some bools around, converted them to bitfields, removed deprecated stuff.
    * this reduced the size of MassProcessor by 16 bytes.

#rb Yoan.StAmant

[CL 36381243 by mieszko zielinski in 5.5 branch]
2024-09-18 04:38:56 -04:00
mieszko zielinski
1d4a38d77f [Mass] Fixed an obvious mistake in FMassEntityManager::BuildEntity where const-shared-fragments were being added to archetype's composition as regular-shared-fragments.
#rb mieszko.zielinski

[CL 36335969 by mieszko zielinski in 5.5 branch]
2024-09-17 11:13:53 -04:00
Megafunk
0e8a206bef PR #12151: Mass GC reference cleanup to support gc.GarbageEliminationEnabled=False
#jira UE-219815
#rb mieszko.zielinski

[CL 35998848 by Megafunk in ue5-main branch]
2024-09-04 01:36:10 -04:00
yoan stamant
c68f23ee3e [MassEntityManager] deprecation cleanup
#rb jacob.wang

[CL 35982125 by yoan stamant in ue5-main branch]
2024-09-03 17:04:17 -04:00
yoan stamant
22e6f0fb6d [MassEntityManager] refactored GetOrCreateConstSharedFragment and GetOrCreateSharedFragment
#rb Mieszko.Zielinski

[CL 35976230 by yoan stamant in ue5-main branch]
2024-09-03 15:14:09 -04:00
mieszko zielinski
1d5d653c0e [Mass] Updated FMassArchetypeData::CompactEntities to reuse MoveFragmentsToNewLocationInternal rather than duplicate code.
#rb Yoan.StAmant

[CL 35920065 by mieszko zielinski in ue5-main branch]
2024-08-30 04:57:05 -04:00
mieszko zielinski
e1d3d26c3b [Mass] Minor spelling fixes
#rb mieszko.zielinski

[CL 35919295 by mieszko zielinski in ue5-main branch]
2024-08-30 04:35:39 -04:00
mieszko zielinski
75e7981a8c [Mass] Pulled in external Mass changes.
* FMassEntityView::HasTag(const UScriptStruct&) made public
* FMassArchetypeSharedFragmentValues.ReplaceSharedFragments added, allows replacing existing elements of FMassArchetypeSharedFragmentValues
* UMassActorSpawnerSubsystem.DestroyActor made virtual
* FMassArchetypeData.GetOrAddChunk added and existing code updated to reuse it
* FMassArchetypeData.SetSharedFragmentsData added, allows changing shared fragment values of a single entity, moving it to the appropriate chunk in the process

#rb Yoan.StAmant

[CL 35918314 by mieszko zielinski in ue5-main branch]
2024-08-30 04:09:41 -04:00
Sixze
93c148590b PR #12277: [Mass Entity] Fix mass.debug.SetDebugEntityRange and movement styles are not working as expected
#jira UE-222730
#rb mieszko.zielinski

[CL 35892690 by Sixze in ue5-main branch]
2024-08-29 06:15:02 -04:00
logan buchy
2851cd6317 Reduce fixed memory overhead from Mass with concurrent reserve enabled but Mass is not used
* Lazy initialize the first page of FEntityData and, by extension, the free index list

#rb Mieszko.Zielinski

[CL 35831026 by logan buchy in ue5-main branch]
2024-08-27 13:40:07 -04:00
yoan stamant
def6877068 [Mass] Fix for observers getting notified before the fragments values are set on entities created through 'CreateEntity' and 'BuildEntity'
#rb Maxime.Mercier

[CL 35406205 by yoan stamant in ue5-main branch]
2024-08-08 15:53:23 -04:00
logan buchy
6335a77f9e Mass Concurrent Reserve Everywhere
* Enable Mass Concurrent Reserve feature for general runtime
* CVars added to revert back to previous implementation and to control memory usage of entity lookup datastructure
- "Mass.ConcurrentReserve.Enable"
- "Mass.ConcurrentReserve.MaxEntityCount"
- "Mass.ConcurrentReserve.EntitiesPerPage"
* Allows deprecation/removal/cleanup of single threaded implementation

#jira UE-220885
#rb Mieszko.Zielinski

[CL 35287298 by logan buchy in ue5-main branch]
2024-08-02 16:47:31 -04:00
mieszko zielinski
f3639fadaa [Mass] Minor clean up after recent large CL. Converted a couple of FInstancedStruct::Make to FConstStructView::Make, which is a better fit in the context.
Also: [Main CIS] Issue 533091: Mac CIS fix

#rb Yoan.StAmant

[CL 35241853 by mieszko zielinski in ue5-main branch]
2024-08-01 08:49:41 -04:00
mieszko zielinski
44391d4c53 [Main CIS] Issue 533091: Mac CIS fix
#rb mieszko.zielinski

[CL 35241706 by mieszko zielinski in ue5-main branch]
2024-08-01 08:34:46 -04:00
mieszko zielinski
2981b0ac91 [Mass] Added a basic functionality for module-independent "debug event" observation. The point is to reduce inter-module dependencies while supplying very flexible way of distributing and handling of Mass debug events
#rb Yoan.StAmant

[CL 35240973 by mieszko zielinski in ue5-main branch]
2024-08-01 07:20:51 -04:00
logan buchy
31cc8df7d3 [TEDS] DynamicTags Feature
* DynamicTags are mechanism to add attributes to rows that are cheaply filterable without incurring the per-row memory and processing cost to perform the filtering.
* Current capabilities allow filtering on a single DynamicTag value or all values.
* DynamicTags are mutually exclusive on a row.  For example, a row can be assigned a `DynamicTag("Color") { "Red" }` and `DynamicTag("AssetType") { "StaticMesh" }` but cannot be subsequently assigned a DynamicTag("Color") { "Blue" }

* Under the hood, they are implemented using Shared Fragments in Mass.  TEDS generates a Shared Fragment type dynamically for each unique FDynamicTag that is given to it.  Each type contains an FName value which can be filtered.  The Shared Fragments are attributes of the chunk that the entities belong to rather than the entity data itself.  A special ChunkFilter function is crafted to skip whole chunks that do not conform to filters that TEDS has set up.

Debug commands have been added to test and explore the feature.
`Teds.Debug.CreateRow` - Creates a row and prints the row ID to the console
`Teds.Debug.DynamicTag.AddColumn Row Tag Value` - Adds a DynamicTag of type <Tag> to the given <Row>. Sets the tag's value to <Value>
`Teds.Debug.DynamicTag.RemoveColumn Row Tag` - Removes a DynamicTag of type <Tag> column from the given <Row>
`Teds.Debug.DynamicTag.RunQuery Tag [Value]` - Runs a query that matches all rows with <Tag>.  Optionally, will match only Tags with the given <Value>
`Teds.Debug.DynamicTag.AddWithEnum Row Value` - Adds a DynamicTag using the ETedsDebugEnum enum to the given <Row>. Sets the tag's value to <Value> - it must be one of the enums
`Teds.Debug.DynamicTag.RemoveWithEnum Row` - Removes a DynamicTag using the ETedsDebugEnum from the given <Row>
`Teds.Debug.DynamicTag.RunQueryEnum [Value]` - Runs a query that matches all rows with a dynamic tag generated from ETedsDebugEnum.  Optionally, will match only Tags with the given <Value>

#rb ronald.koppers
#jira UE-220130

[CL 35228563 by logan buchy in ue5-main branch]
2024-07-31 17:24:48 -04:00
dan oconnor
efb71d66be Fix incorrectly conditional include, needed for IMPLEMENT_MODULE macro
#rb dan.oconnor
#rnx

[CL 35090327 by dan oconnor in ue5-main branch]
2024-07-25 14:30:44 -04:00
bryan johnson
e7bdda6b95 [Backout] - CL35087217
[FYI] Bryan.Johnson
Original CL Desc
-----------------------------------------------------------------
[Backout] - CL35079176
[FYI] Mieszko.Zielinski
Original CL Desc
-----------------------------------------------------------------
Moved the rest of MassEntity modules over to the Engine's Source/ code.

#jira UE-216267

[CL 35087666 by bryan johnson in ue5-main branch]
2024-07-25 13:36:25 -04:00
bryan johnson
8571531689 [Backout] - CL35079176
[FYI] Mieszko.Zielinski
Original CL Desc
-----------------------------------------------------------------
Moved the rest of MassEntity modules over to the Engine's Source/ code.

#jira UE-216267

[CL 35087231 by bryan johnson in ue5-main branch]
2024-07-25 13:18:29 -04:00
mieszko zielinski
ec5752f92c Moved the rest of MassEntity modules over to the Engine's Source/ code.
#jira UE-216267

[CL 35079184 by mieszko zielinski in ue5-main branch]
2024-07-25 08:14:32 -04:00
mieszko zielinski
ec0c746e4a [Mass] Fixed FMassEntityManager::RemoveConstSharedFragmentFromEntity's return value in case where the entity doesn't have the given shared fragment type. The return value was inconsistent with the documentation and the other "failed" case when the given type doesn't represent a const shared fragment.
The issue also caused failure of the System.Mass.SharedFragments.RemoveFromEntity unit test.

#rb mieszko.zielinski
[FYI] logan.buchy

[CL 35078496 by mieszko zielinski in ue5-main branch]
2024-07-25 06:48:47 -04:00
logan buchy
4e04c2981b Add RemoveConstSharedFragment functionality to Mass
* Some care taken to remove null SharedStructs when removed from the MassArchetypeSharedFragmentValues class.   FMassArchetypeSharedFragmentValues::CalculateHash would return different hash value if nulls present resulting in unnecessary new chunks in FMassArchetypeData::AddEntityInternal

#rb Mieszko.Zielinski
#jira UE-220081

[CL 35059358 by logan buchy in ue5-main branch]
2024-07-24 13:37:08 -04:00