Hi everyone,
I’m working on an open-world project with a large number of customizable NPCs, and I’m currently running into a serious memory issue when compiling my Customizable Object.
My current setup is:
-
All of my characters use the same Skeleton.
-
I have one base Skeletal Mesh.
-
The base mesh has around 150 Morph Targets, where each Morph Target represents a different character/body shape. For example, activating the “Laura” Morph Target transforms the base body into Laura’s proportions and appearance.
-
On top of the body, I use Mutable Child Objects for clothing, hair, accessories, and other appearance variations.
-
I have hundreds of these Child Objects available across the different categories.
-
At runtime, I use a single Customizable Object and create a separate Customizable Object Instance for each NPC, selecting the appropriate character Morph Target and the desired clothing/accessories.
The problem is the compilation of the Customizable Object itself.
When I compile it, Unreal/Mutable can consume more than 128 GB of system RAM. In some cases the machine gets extremely close to running out of memory.
I’m not sure what is causing the memory usage to become so high.
Initially I suspected the ~150 Morph Targets, but I also have hundreds of Child Objects containing different meshes, materials, LODs, and appearance variations, so I’m wondering if the large number of Child Objects or the combination of Morph Targets and Child Objects could be causing a combinatorial explosion during compilation.
My main questions are:
-
Is this architecture appropriate for an open-world game with many NPCs?
-
Is having hundreds of Child Objects inside a single Customizable Object expected to cause very high compilation memory usage?
-
Are there recommended ways to structure/split the Customizable Object to avoid this problem while still allowing all NPCs to share the same system?
-
Does Mutable have any specific recommendations for handling a large number of character variations using Morph Targets?
-
Is there a way to identify which part of the Customizable Object is responsible for the majority of the compilation memory usage?
-
Once the Customizable Object is compiled, should the number of runtime instances/NPCs be mostly independent from the large memory spike I’m seeing during compilation?
I would prefer to keep a single shared Customizable Object if possible, since all characters use the same base mesh and Skeleton and the NPCs only differ through their body shape and appearance configuration.
Any advice on how Mutable is intended to handle this kind of large-scale NPC setup would be greatly appreciated.