Let's Talk Instances

I’ve got a rigid-body animation project that heavily relies on instancing. Everything is made of a set of ~500 meshes that are to be arranged manually to create scenes and characters. I would also like to merge static groups of instances to a single mesh for performance and back again for animation or simulation.

So with that simple concept I’ve found Unreal is just incredibly ill-equipped to handle extensive use of instances. These are my requirements, am I wanting something technically unreasonable?

  1. Quick manual placement of instances.
  2. Transform animation of instances, which would be translation, rotation, and scaling.
  3. Attachment of instances to skeletons, and animation of skeletons.
  4. Rigid-body transform simulation of instances, again translation, rotation, and scaling.
  5. Grouping of instances.
  6. Hiding of groups of instances, which should also be unloaded from memory.
  7. Copying of groups of instances.
  8. Conversion of groups of instances to a single mesh.

It’s definitely reasonable to do that, but you’ll need to build the system yourself. Unreal doesn’t have any pre-made tools for it.

I don’t see how any project could be done without these capabilities. Surely any rigid object that exists at least twice should be an instance, but that would be difficult without more extensive tools. My project is one-man show, so I don’t know if I have the resources to alter the current systems.
Are studios just going without strong instancing tools, or do many of them have in-house versions? I cannot believe that Epic Games would never need them.

There’s ways of doing instancing, but with animated objects that’s a different matter. You don’t typically deal with many animated objects that need to be instanced.

Have you checked out the instance tool?

It lets you easily switch between instance and mesh and its cheap - like $10.

Other things to keep in mind:

You can easily simulate rigid bodies in the scene, then choose “Keep Simulation Changes”.

So workflow would be:

Layout 100 meshes with simulate physics.
Simulate, “Keep Simulation Changes”.
Turn off Simulate Physics.
Use Instance tool to convert to instance.

Rinse and repeat…

**This assumes you want to use physics to position meshes at design time, not simulate at runtime.
If you want to simulate at runtime, instancing is not what you want.

Yes, I’ve seen that plugin, you can see the creator’s response to my requirements here:

I just need to use the sequencer to record the animation, so I don’t think there will be a runtime at all.

Well, considering it’s an animation and characters are literally made of copies of objects, it follows that to have a greater number of characters, or even swaying trees, that instances would be necessary.

Characters you don’t typically instance unless it’s a special case–like for example with crowds in Assassin’s Creed, but most games don’t need crowds. I believe though that instanced large numbers of animated characters was a feature added to Unreal 3, but I don’t know if there’s an equivalent in UE4.
As for trees–using Speedtree it has its own optimizations.

The characters as a whole would not be instanced, it would be the objects that make them up that would be instanced. This project uses a rigid-body world using basic shapes to build things, so the characters are just basic shapes parented to bones. There are no morphing of meshes, so I’m not sure it’s the same as Assassins Creed. Also, things like buildings and vehicles use skeletons as well for rigid joints that are not right-angles. All I need are general tools, not specific like the foliage editor for example.

And it’s not specifically trees, it everything, including things that can stack on top of each other. Not sure if Speedtree would help, but I will have a look at it.

Typically you would be able to instance a whole skeletal mesh, but you wouldn’t be able to instance components within the skeletal mesh. You could drive animation for instanced objects but I don’t think you could drive that with a skeleton.

Didn’t think going into the project it would be this difficult and there would be so few tools. It’s rigid-body, you would think that is as simple as it gets. If objects can be parented to sockets, then surely instances could too.