Announcement

Collapse
No announcement yet.

Collision performance cost?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Collision performance cost?

    For all the large rocks that make up the world on my map, I don't import collision meshes for them. I instead uncheck these boxes under the mesh collision settings:
    Code:
    UseSimpleBoxCollision = False
    UseSimpleLineCollision = False
    UseSimpleRigidBodyCollision = False
    I have thousands of these rocks on my map, each with around ~4000 poly's.

    These rocks don't seem to have any performance cost. If I delete them, I barely notice any difference in performance.

    I have always assumed that importing low-poly collision meshes was important for performance, so I've never understood how all these rocks perform so well.

    Can anyone give any insight on what the actual cost of collision is?

    #2
    I think that with collision, the pawn (or projectile or whatever) does an octree lookup to see what's nearby. So although you might have thousands of those rocks on your map, only the ones closest to the pawn are relevant to collision.

    Edit: Just to provide some additional info, I once had some meshes that somehow I screwed up the collision on. If you looked at the collision in mesh properties window, you would see the collision boxes stretching out infinitely. I could place those meshes in my game world, and they mostly seemed to work, but every time I selected one of them in the editor, the editor would hang for several seconds. You also couldn't see the meshes in the orthographic views. From those observations, I think that the editor caches all the static meshes into the collision octree, so there's an up-front calculation cost to save time on collision at run-time.
    Last edited by Nathaniel3W; 07-21-2020, 06:28 AM.
    Check out Himeko Sutori, the upcoming tactical RPG where you control armies of over 100 unique characters.

    Comment


      #3
      collision complexity has a performance cost when the collisions are queried. so if you have a fully static scene you won't notice anything (but you still have a higher memory cost because the meshes need to exist in the collision version of the scene which exists on CPU).
      you'll start noticing the performance cost depending on how many movable objects you have that make collision queries. so more characters, line traces, projectiles, rigid bodies or just moving objects.
      if you want to have a better idea of the cost it's probably good to make a stress test scene where you recreate the most costly scenario that your players might find while playing your game
      Follow me on Twitter!
      Developer of Elium - Prison Escape
      Local Image-Based Lighting for UE4

      Comment

      Working...
      X