Multiplayer animation and optimization.

Résultat de la traduction

Hello everyone, I would like some help with a problem I am currently experiencing and wanted to know if anyone has ever faced a similar situation.

I have about fifty NPCs on a relatively small map, who can walk, run, sit, and perform other simple animations.

These NPCs navigate the map using a function that uses AI move to random positions.

The project is low poly, similar to Minecraft, but the animations of the 50 NPCs cause a significant loss of FPS. I have seen several things such as animation sharing and the animation budget allocator. I wanted to know what would be appropriate in my situation? Does anyone have any other ideas? Or other solutions? Thank you

Hey @camerone95 how are you?

With ~50 NPCs In think the best you can do is to combine Animation Sharing and Animation Budget Allocator. So you will drasticaly reduce the load of the NPCs.

I’d go first with Animation Sharing since it has the most dramatic effect when animations are simple and repetitive like in your low poly with probably all of them using the same animations.

Then I’d add a layer of Animation Budget Allocator, which is built exactly for throttling animation updates based on distance from the camera and screen visibility.

I think this is the best approach because you are using a small map and probably you won’t get a significant performance improvement by only using Animation Budget Allocator, but it will add really well to Animation Sharing.

Hope this helps you!

You might look into the AnimToTexture plugin… allows you to run animation on static meshes on GPU using a Material rather than the CPU with animbps . It’s more setup, but the performance is much better for large numbers of actors.

1 Like