Jump to content

World spatial update performance


photo

Recommended Posts

Every time we look in the microprofile when running our simulation, the "world spatial update" appears as a huge block. The bottleneck seems to appear when there are lots of moving object in the scene, and these objects consist of many individual nodes (cause of moving parts and logic nodes all residing within the NodeReference that we move around). When the nodes are not moving the update time is almost zero, but once they start moving we easily get above 10ms update time on this even with just 25 moving objects (each containing a few dozen nodes).

I've created a test world to demonstrate the bottleneck, it consists of three .node files, world.node being the main one, the other ones are included within through NodeReferences. For this sample (due to the lack of logic nodes) I increased the number of moving objects to 500 to make the problem more obvious. If you disable the WorldExpressions the sample runs well above 70fps, but when they are enabled and the nodes are moving it drops to below 20fps. Microprofiler reports over 40ms being spend in the world spatial update for this scene:

MicroProfile.png.e09e138693f0875e759901e4a4817cc7.png

Test scene is made in Unigine 2.5, but I ran it in (unmodified) 2.7.1 as well and it's just as slow over there. When I run the Visual Studio profiler on it (on 2.5) it reports update_world_trigger_bound and update_world_sector_bound functions are the biggest bottlenecks. We aren't using any WorldSector or WorldTrigger nodes within our code, but those functions are run regardless each time an object is moved, only to determine it's not in any sector or trigger.

Are there any ways to improve this with some setting on the nodes, or would this require optimizations within the engine to improve this?

world.node

boat.node

logic.node

Link to comment

Hi Bemined,

yes, there are some issues with spatial tree update. We're aware of them and implemented a couple of optimizations in the upcoming 2.7.2 release. Your test scene showed that there's still a room for improvements.

What can be done now:

  • Disable "Visibility by Sectors/Portals" for all the moving nodes and their childs
  • Reorganise your world hierarchy with world and mesh clusters, mesh clusters are the fastest. It is better to keep all static objects in a separate cluster
  • Using NodeLayers for keeping Clusters also could be helpful
  • Keeping dynamic objects in a separate hierarchy should ease CPU load
  • Transform update for node reference is slower than for simple mesh. It worth checking

Actually, your test was very helpful and we have some thoughts on further improvements.

Thanks!

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Link to comment
  • 2 weeks later...

Hi @Bemined,

we have progress regarding this issue. With new engine optimizations your test scene is running much faster (80 - 100fps). It can be even pushed up after changing mesh dynamic to mesh static.

This is still in development, will be available in the next release.

Thank you!

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Link to comment
×
×
  • Create New...