Forum rules - please read before posting.

Performance issues

Hi,

I'm having a problem were I got 6 NPCs and they make the game going at very low frame rate (20-25 fps).  I got around a solution where I started the game with each NPC deactivated, then when the game started I turned them on by script. Doing this seemed to work really good, i was getting over 150 fps. But now I realized that doing this alters the comunication with the mecanim animations, the signal for the variables IsTalking is not being send. 

Other similar problem is that I tried to remove an object (a simple mesh) using an action list, but when I did this the frame rate decreased the same way that NPCs did (dropped more than 100 fps).

I've searched through the forums but I haven't find anything like this yet.

I'm using the version 1.53d

Comments

  • Welcome to the community, @solidmax.

    First of all, please back up your project and update to the latest version of AC v1.55c.  Any issues reported must be confirmed to exist in the latest version before any fix can be made.

    For the NPCs, we will need to see if this is an issue with AC, or a performance issue with Unity / Mecanim.  Create a new scene and place them in it, but without any of AC's scripts.  Does the framerate improve?

    We will also need to know more about them.  What are they all doing in the AC scene?  How complex are their Animators?  The more info / screenshots you can provide, the better we can advise.

    For the object removal, does the frame-rate decrease permantently from then on, or is it just temporarily?

    You can use Unity's Profiler while running your game to help determine the source of the slowdowns.  If you find that this is linked to an AC process, please post a screenshot showing the full Profile window so that we can examine it.
  • edited February 2017
    Hi Chris, thanks for the welcome and for the quick response, I've been sick so today I just returned to development.

    I updated AC but the problem still persists.
    I also tried to ´put the NPCs  (6 characters in scene, about 5 animations each) in a new scene, the framerat didn't suffer any noticeable alteration. 
    This is a screenshot of my solution (NPCs turned off at the start of the game, then turned on by script) 
    image

    And this screenshot is when all the NPCs start active:

    image

    The fps drop for the object removal is permanent.
    This is a screenshot before object removal:
    image

    And a picture after:

    image
    My guess for this one is that some array in AC saves all the elements, but if I remove the element the array and other objects linked to it search for the element deleted. 

    Thanks for the tip of unity's profiler, I never used it before


  • edited February 2017
    AC does store arrays for performance - but this is for AC elements such as characters.  What is on the GameObject you're removing, exactly?

    I'm afraid I'm having trouble viewing the images - would you mind posting them on imgur.com?
  • edited February 2017
    Of course, here are the new links:

    NPCs turned off at the start of the game, then turned on by script:

    NPCs start active:

    Before object removal:

    After object removal:

    The object removed is a simple mesh with a highlight script:

    I forgot something, 4 of the six npcs have like 5 animations each, and the other characters have like 10, but I really don't think this is the issue.

    (it didn't post the photos with the image tool, so I just posted the links)

  • edited February 2017
    Thanks.

    The NPC issue appears to be because AC is outputting messages to the Console window - these are likely warnings about something wrong with your NPCs.

    If necessary, you can disable AC's messages from the top of the Settings Manager, but you should open the Console to see what the messages are.

    For the object issue, we'll need to do a bit more profiling.  First, however, temporarily remove the Highlight component so that we can see if this is affecting it or not.

    In this shot, you can see that the BehaviourUpdate is the issue - but you'll need to expand the field so that we can see what inside it is the issue.  Try to dig down as deep as you can - you can use the "Total" and "GC Alloc" values to find the largest contributor.
  • I fixed it!!!, you were right, the console showed a lot of warning because I didn't add the "Speed" and "IsTalking" variables to every character, just the ones they needed. I never though that could be an issue.

    Oddly, after I did that I tried again the object issue but this time the game didn't suffer any frame drops, like if the two problems were somehow related.

    Thank you so much for your help, soon I'll be posting what we're working for.


Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.