Search Unity

Can't Get Past 30 FPS... = (

Discussion in 'General Discussion' started by jonkuze, Mar 2, 2014.

  1. jonkuze

    jonkuze

    Joined:
    Aug 19, 2012
    Posts:
    1,709
    OK so my current game project consists of a small open world environment, 11 Unique Character Assets all with their own unique diffuse textures; in total I have about 2,800 (re-usable) environment assets populating 1x terrain, and they all use one shared diffuse texture.

    At run-time I have 64 characters in the game at all times, 8 players and 56 enemy characters roaming about the world.

    Using Unity Free Version, I have tried using this tool InstantOC Dynamic Occlusion Culling:
    https://www.assetstore.unity3d.com/#/content/6391

    also Simple Mesh Combine to decrease draw calls:
    https://www.assetstore.unity3d.com/#/content/8748

    I have tried Turning Off Shadows, Using Compressed Textures (Lowering Down to the Lowest Possibly Quality), Reduced Graphic Quality in Unity Setting, Remove any Unnecessary Particles Effects, Set Camera Draw Distance to 100, and even played with Fixed Update TimeStamp, lowing the amount of times Fixed Updates are called per Milisecond to Increase Performance Since I'm not using any Physics...

    NONE OF THIS HAS GOTTEN ME PAST 30 FPS!!!

    What am I missing here...? Anyone have some amazing Optimization Tips that I don't know about?

    NOTE: only way I can get past 30 FPS is if I remove all Content... if I just have my Player Character Running around on a Plane with nothing else... I can get 60 FPS or More... What Gives!?
     
    Last edited: Mar 2, 2014
  2. squared55

    squared55

    Joined:
    Aug 28, 2012
    Posts:
    1,818
    What are your specs? Have you tried turning off V-Sync (which locks the FPS)? Have you tried using the profiler? If so, post the results. What about using differed rendering? Have you tried lightmapping, and removing dynamic lights? What image effects are you using? Which shaders? How many drawcalls do you have?
     
  3. ZimM

    ZimM

    Joined:
    Dec 24, 2012
    Posts:
    963
    He said that he is using free version of Unity, so profiler, deferred rendering, and image effects are non-existant...
     
  4. Kondor0

    Kondor0

    Joined:
    Feb 20, 2010
    Posts:
    601
    He can still see his drawcalls. Come on, dude, take a look at your stats... or maybe your computer sucks? (jk)
     
  5. Photon-Blasting-Service

    Photon-Blasting-Service

    Joined:
    Apr 27, 2009
    Posts:
    423
    Post a screenshot. It's probably the design of your level.

    If your level has a lot of narrow streets or paths with buildings tightly packed (or trees or whatever) and overlapping you will have a lot of overdraw. If you widen your streets/paths, you will push the overlapping buildings to the far sides of the screen, so much less will be rendered. Change your two lane streets to four lane streets. Draw less in the middle of your screen.

    Optimizing individual assets will help but nothing causes a more dramatic change than the design and layout of your level.
     
  6. jonkuze

    jonkuze

    Joined:
    Aug 19, 2012
    Posts:
    1,709

    Interesting, I actually do recall hiding the level, and with 56 other characters in the game and I got around 50 FPS, so maybe your right about alot if overdraw. I need to check the draw count, I'll post it once I know what I get home today. Hmm maybe that Occulation tool is just not working as expected, and I probably need Unity Pro's Occulation.
     
  7. HolBol

    HolBol

    Joined:
    Feb 9, 2010
    Posts:
    2,887
    It's called occlusion culling. ;)

    And check your draw call numbers. Use LOD whenever you can. And so on.
     
  8. Arowx

    Arowx

    Joined:
    Nov 12, 2009
    Posts:
    8,194
    Just a thought but if the 50+ npcs are scripted and their scripts are active then that can be quite an overhead. Have you linked the occlusion system to the NPC's scripts, for instance an out of view character does not need to be animated/rendered and just needs to know where they are and where they are going.
     
  9. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
  10. Hikiko66

    Hikiko66

    Joined:
    May 5, 2013
    Posts:
    1,304
    60 fps with nothing sounds like more of a problem to me than 30 fps with everything.
     
  11. jonkuze

    jonkuze

    Joined:
    Aug 19, 2012
    Posts:
    1,709
    I typed occlusion from an iphone, and that's what i got for auto-correction i think lol, LOD yea wish i could but I don' think any of my assets have other LOD models included because they are already Optimized for Mobile Games.


    actually i tried using occlusion on all the NPCs and this still did not help performance at all... ofcoarse if i hide, pause all the NPCs (scripts) from running then yes I can see a performance increase. So I guess need to figure out some smart way of optimizing the scripts of these NPCs; note this is for a Multiplayer Game so this gets even trickier because I can't just turn off some NPC Scripts from working temporarily until they apear in my line of sight as the player, as there are other players in the game at the same time who may be near those NPCs...


    Thanks! I actually have used the Timestep trick from one of the articles, but didnt try the other 2 memory savers, will give it a go. And also the first article is confirmation that i need Unity Pro now lol! I'm not so sure Unity Assets can replace the power of Unity's Built in Occlusion.

    Well I did say 60 FPS or more... I'm typing away from my computer right now, so 60 FPS is definitely a sure thing, and i'm pretty sure it went much higher than that but not sure how high, so i'll have to recheck that.
     
  12. Arowx

    Arowx

    Joined:
    Nov 12, 2009
    Posts:
    8,194
    Well if it's multi-player and there is one server, then you do need to update the NPC's movement but each players client only needs to have the NPC's drawn that they can see.

    If you have a more peer to peer network then you might be able to subdivide the NPC's so that each players client gets a share of them to process.

    Are you using threading? If you aren't then you could try setting the NPC's AI routines to run in a separate thread and therefore reduce their impact on the players main thread. Note that this is no simple undertaking but there are assets and information on the forum that should help you. Unfortunately Unity does not support multithreading out of the box so you need to write stand-alone classes and structures to work on a separate thread.
     
  13. makeshiftwings

    makeshiftwings

    Joined:
    May 28, 2011
    Posts:
    3,350
    You must have VSync turned on. (Edit -> Project Settings -> Quality -> VSync Count -- change it to "Don't Sync") If you have just a character and a plane and you're on a desktop computer, you should be getting way more than 60FPS. With VSync off I get like 12000FPS on a super-simple scene.

    Edit - Some graphics drivers have an override to force VSync on, make sure that's turned off as well.
     
  14. yuriythebest

    yuriythebest

    Joined:
    Nov 21, 2009
    Posts:
    1,125
  15. Arowx

    Arowx

    Joined:
    Nov 12, 2009
    Posts:
    8,194
    Out of interest,what are the specs of your development rig and what cube mark does it get?
     
  16. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    Good to see this program still available to benchmark my system :)
     
  17. jonkuze

    jonkuze

    Joined:
    Aug 19, 2012
    Posts:
    1,709
    I tried playing with VSync, tried all settings and didn't find a difference in performance at all...



    That's pretty interesting, so trying to force a framerate, does this mean Unity is trying ask the computer for more processing power?

    Although interesting to try it, not 100% sure if i'd want to try and force FPS, i'd like to know first that my game is as optimized as possible... then maybe I can add this in for an extra boost. Thanks for the info...


    I'll give it a try soon... and let you know = )

    BTW, No i'm pretty sure we are not doing any threading, so this could be something to look into also... thanks for this idea.
     
    Last edited: Mar 3, 2014
  18. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    No, you can't have more CPU power than already exists.

    You can't force a framerate that's higher than the maximum your system can do, and it's not there for a "boost", it's there to limit the framerate to a lower value. e.g., you want to limit the framerate to 60 regardless of vsync being on or not.

    Sounds like something is fairly broken with your drivers or something.

    --Eric
     
  19. jonkuze

    jonkuze

    Joined:
    Aug 19, 2012
    Posts:
    1,709
    I'd much rather find out if it's just my Graphic Drivers broken lol! if I can get my game to push 60 FPS or more on broken graphic drivers that means it will fly on working drivers if that's the case lol. But i'll look into updating my drivers see if that helps anything.
     
    Last edited: Mar 3, 2014
  20. jonkuze

    jonkuze

    Joined:
    Aug 19, 2012
    Posts:
    1,709
    Well it seems as though I was doing a whole lot of things all wrong... :mad:

    I was Mesh Baking all the wrong Parent Game Objects, I did not tweak the Quality Settings properly (I found putting Pixel Light Count to 0 helped performance), also turning off Shadows now completely is showing performance increase (not sure why it didn't before), we optimized some of the NPC Scripts by not having them Update as Frequently, and now I am able to push 57 - 60 FPS, probably more if I cut back on the number of NPCs I have in the game but that would make the game much less fun as this is a Multiplayer RPG an i need those NPCs to populate the world and Hunt them lol...

    I think it was helpful to be reminded about the Draw Calls, that's another big mistake I was not paying anymind to Draw Calls... previous I had about 1400+ Draw Calls, Now it's down to about 300, and much better FPS! :D