Announcement

Collapse
No announcement yet.

Performance explanation sought-after - Skeletal mesh versus static mesh in AI movement

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

    Performance explanation sought-after - Skeletal mesh versus static mesh in AI movement

    Dear community,

    I was playing around with a simple AI and wanted to know how what performance an AI has on a mobile android game (Current testing device: Nokia 7).
    1. So I created a map with a simple landscape and a top-down character and it runs fine, no performance hits whatsoever (stable 60fps (Cap))
    2. Afterwards I created an AI: Character + Blackboard +etc. with a very simple task: Move to random point in radius: Litteraly: Get AI actor location -> Get randompoint in navigatable radius -> AI move to
      Click image for larger version

Name:	bt.png
Views:	1
Size:	43.9 KB
ID:	1629548
    3. So i started inserting the AI's into the world, I decided that I wanted to test different options with 200 AI characters which are only choosing a random point in radius and move to it.
      1. Character setup: Standard UE4 Mannequin ( with LOD, 2300 vertices)
      2. Result: Massive performance hit ~27 FPS
    4. So i Thought: Maybe too many bones? So i imported an "fake skeltal mesh". Just a cube with no bones Click image for larger version

Name:	cubeskeletal.png
Views:	3
Size:	294.3 KB
ID:	1629551
      1. Performance result: a lot better: 37-38 FPS (Apparently the bone structure (And probably collision structure) of the default mannequin is too much too handle for the phone (Or the animation blueprint, but do not expect any difference). But still, i want a lot more performance than 37 fps with only 200 boneless cubes roaming arround
    5. So i looked at this post (A question of mine years ago). And I saw that I can enable "navmesh walking", so i did: Click image for larger version

Name:	navmeshwalking.png
Views:	1
Size:	313.0 KB
ID:	1629552
      1. Performance result: ~ 37-38 FPS. No difference at all
    6. I also read about the pawn movement component instead of the character movement component. So I changed the class to default pawn, (Had no skeletal mesh within the default pawn, only the default sphere and I ran the project again
      1. Performance result 47-48-49 FPS. Holy moly, what a difference!
    7. But I thought, I am only able to insert an static mesh, lets set the static mesh to none, and add a boneless skeletal mesh (the cube). I expect to have no difference within the performance, since it is only a boneless cube:Click image for larger version

Name:	static-mesh-empty.png
Views:	2
Size:	401.5 KB
ID:	1629554
      1. Performance result: ~41 fps. Huh? 7 FPS difference for a boneless skeletal mesh instead of a static mesh?
    So my questions are:

    Can anybody explain this behavior to me?
    Apparently skeletal meshes (even tough with nearly no information) have a massive performance hit relative to static meshes. Why?!
    Enabling Navmesh walking changes nothing in my performance, Why?!
    Main goal here is: I want to have maximum performance, preferably with the character movement component (Due to replication). How am I able to achieve this?

    Attached Files
    Evolvation | HyperReuts

    #2
    The only thing that comes to mind is by default the movement component support replication by default so if you have no need for network features you could try turning it off.

    Normally I would suggest running a profile as FPS alone does not say much as to what is actually causing the performance hit. Since I'm not up on what can and can not be done as far as mobile goes I'm not sure of the process you would need to preform. If possible you could do a with and with out profile and see just whats causing the problem.
    Clarke's third law: Any sufficiently advanced technology is indistinguishable from magic.
    Custom Map Maker Discord
    https://discord.gg/t48GHkA
    Urban Terror https://www.urbanterror.info/home/

    Comment


      #3
      Originally posted by FrankieV View Post
      The only thing that comes to mind is by default the movement component support replication by default so if you have no need for network features you could try turning it off.

      Normally I would suggest running a profile as FPS alone does not say much as to what is actually causing the performance hit. Since I'm not up on what can and can not be done as far as mobile goes I'm not sure of the process you would need to preform. If possible you could do a with and with out profile and see just whats causing the problem.
      Hey Frank,

      Thank you for replying. I need the network features. I also turned the replication off, no difference whatsoever.

      I am also not sure how to profile on mobile (First mobile try-out with performance needs). Also, I am not able to find it on the first look. I will look into that.

      However, I am able to run commands so I know that the cause of the fps drop is the movementcomponent. For some reason it is way more expensive (also without replication). I would love to know why.

      I also would like to share the following improvement: Apprently "navmesh walking" is not enabled by clicking on the checkbox within the movement component. You should set the movement mode in the AI character via beginplay (Thanks to this post). Is increased my FPS rate to a stable 49 with the boneless cube.

      So I changed the skeletal mesh to the the UE4 mannequin. The thing was: It was still running on 49 FPS!. I figured out that that the animations where not enabled and that with the animations enabled it does have a massive performance impact (from 49 to 36 fps). Who figured that?!

      So now with navmesh walking enabled (properly) and a complex animated characther (default ue4, way too many bones for mobile) I am able to run a stable 200 AI's on the navigation mesh with tasks like random point in radius, move to homebase, move to specific actor location in the map (Querried via vector positions diffs relative to AI of all world objects) and have thousands of interactive objects with a stable 30-31 FPS on a mid-range mobile like a Nokia 7.

      I am quite happy with that If I disable the animations it runs a stable 37-38fps with 10k instanced trees.
      Click image for larger version  Name:	37fps.png Views:	1 Size:	540.7 KB ID:	1630105

      If anyone has any improvements or explanations I would love to hear them. Also, If someone knows how I am able to profile properly, please let me and others know.

      If I find anything new, I will make sure that I post it here.

      Kind regards,

      ERuts
      Evolvation | HyperReuts

      Comment

      Working...
      X