Search Unity

Unity stutters and hitches even in empty scenes, Unreal does not

Discussion in 'Editor & General Support' started by rawalanche, Jan 9, 2019.

  1. rawalanche

    rawalanche

    Joined:
    Aug 26, 2017
    Posts:
    20
    Hi,

    I've been recently playing with both Unity and Unreal, comparing both for the use for realtime VFX. One thing that keeps bothering me is that my Unity editor constantly stutters and hitches, regardless of the scene complexity. The stuttering and hitches are equally severe in the empty 3D template scene, empty HDRP scene or full, complex scene.

    The reason this disturbs me so much is that there is no reason this should be happening. I have i7 5930k, 64GB of RAM and GTX1080Ti with latest drivers. I tried to disable every other windows program that was not completely essential to running windows, and even the, Unity editor still stutters even in empty scene. Alongside that, I can run UE4 editor with completely overkill scene intended for non interactive VFX, and it still runs butter smooth.

    I tried to record the difference on a 60FPS video, unfortunately I succeeded only partially. While the video does show stuttering and hitches of Unity editor, when it's showing UE4 editor, the recording is not nearly as smooth as the actual interaction I saw was.



    Does anyone know why this is happening and if there is a fix? Unity seems to have quite a few things going for it in my comparison, but unfortunately lack of workflow smoothness is a big downside.
     
  2. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    4,883
    At what point in the video should we be looking for the issue? All looks quite smooth to me!
     
    Joe-Censored likes this.
  3. Lurking-Ninja

    Lurking-Ninja

    Joined:
    Jan 20, 2015
    Posts:
    4,141
    @JeffDUnity3D my guess is that he's talking about around 0:18 when he's yanking the entire scene around, it's stuttering a little bit.

    @rawalanche I do not know what kind of camera control are you using, but you really should write a better one, Unity is capable of moving the camera perfectly smoothly, of course you need to actually develop it that way
     
  4. rawalanche

    rawalanche

    Joined:
    Aug 26, 2017
    Posts:
    20
    It's a bit harder to see on the video unfortunately, but it's just not smooth. It hitches all the time.

    @Lurking-Ninja
    It doesn't happen only in play mode. In fact it happens in play mode a lot less. It mainly happens when navigating scene view in editor. Obviously, I am not able to rewrite that :)

    Here's my attempt at better example. I have recorded the video at 120FPS, and then re-exported at 60FPS. So it still runs 60FPS at 50% the speed. It should be more obvious now.

    Unity:


    Unreal:


    On unity example, you can clearly see that while mouse cursor movement is perfectly smooth, the actual rendered scene movement framerate is inconsistent. It may be harder to see but it's very easy (and uncomfortable) to feel. Unfortunately, Unreal hides mouse cursor during scene view navigation, but you still can see it's significantly smoother.

    I am really confused about this, as my hardware is more than powerful enough, and I am at the end of my wits when it comes to eliminating any software interference. Especially when Blender, 3ds Max, Unreal and all the other similar 3D software runs absolutely fine.
     
    Storm4_, Quatum1000 and Lurking-Ninja like this.
  5. Peter77

    Peter77

    Joined:
    Jun 12, 2013
    Posts:
    3,896
    We experience the same problem, across several Windows 10 PC's and different Unity versions (5.6, 2017.4 and 2018). Enabling "Animate Materials" in the Scene View reduces the problem for us a little, but it's not fixing it.
     
  6. rawalanche

    rawalanche

    Joined:
    Aug 26, 2017
    Posts:
    20
    Alright, I was able to push it even further, and record at 240FPS, then re-export at 60, getting 4 frames out of one realtime frame. Now the issue is very obvious:

    Unity:


    Unreal:


    The difference of framerate consistency between Unity and Unreal is significant. Unity is really only piece of 3D software or a game on my PC that ever did anything like this.
     
    Storm4_, Quatum1000, konsic and 2 others like this.
  7. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    5,313
    you can also try profiling the editor, maybe it shows some spikes.
     
  8. rawalanche

    rawalanche

    Joined:
    Aug 26, 2017
    Posts:
    20
    I guess I could. Unfortunately I am not really a developer, just an artist. I know basics of profiling in UE4, but I've never used Unity profiler so I really don't know what to look for and how to interpret the data (yet). I tried just opening the profiler panel, clicking profile editor button and selecting one of the frames with the spike. I have no idea what what to read from it though. :/

    upload_2019-1-10_9-12-31.png
     
  9. rawalanche

    rawalanche

    Joined:
    Aug 26, 2017
    Posts:
    20
    Just shooting from the hip here: Do any of those computers have one of these?:

    GTX1080Ti
    Oculus Rift connected
    Mouse with 1000hz polling rate
    Sound Blaster sound card
    Google Backup and Sync client
     
  10. rawalanche

    rawalanche

    Joined:
    Aug 26, 2017
    Posts:
    20
    So I take it no solution?
     
  11. Atair

    Atair

    Joined:
    Oct 16, 2015
    Posts:
    42
  12. Peter77

    Peter77

    Joined:
    Jun 12, 2013
    Posts:
    3,896
    I have a NVIDIA Quadro K620 on this PC.

    No VR related hardware connected at all.

    It's a Logitech M-U0007, which seems to have 1000hz according to my research.

    No, Realtek High Definition Audio.

    No.
     
  13. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    5,750
    I think maybe this was a mac only issue but, what is the polling rate of your mouse?
     
    bjarkeck likes this.
  14. bjarkeck

    bjarkeck

    Joined:
    Oct 26, 2014
    Posts:
    243
  15. rawalanche

    rawalanche

    Joined:
    Aug 26, 2017
    Posts:
    20
    @Atair
    Hey. Unfortunately I can not test that. I do have 3ds Max, but only 2016. I ended by maintenance at that version, so I don't have access to any newer ones. That being said. I don't have HiDPI screen nor do I run any DPI scaling in windows. It's regular 1920x1200 screen with 100% scaling.

    @bjarkeck
    Yeah, I think it may be related. As @Peter77 wrote, he has also high polling rate mouse (1000hz). I wonder if unity is actually trying to process all those 1000 mouse events each second.
     
  16. Vectorbox

    Vectorbox

    Joined:
    Jan 27, 2014
    Posts:
    143
    I'd be surprised if it's the source of the problem, but just in case, does Logitech SetPoint offer control of the polling rate ?

    Logitech
    SetPoint (Windows / Mac)
     
    Last edited: Jan 14, 2019
  17. rawalanche

    rawalanche

    Joined:
    Aug 26, 2017
    Posts:
    20
    Storm4_ and Vectorbox like this.
  18. bjarkeck

    bjarkeck

    Joined:
    Oct 26, 2014
    Posts:
    243
    Yup you're right, can confirm as well. I have a steelseries keyboard and mouse, both was at 1000hz, lowered them to 250 and it felt a lot smoother.

    Even though this fixes it, there are still way more events than necessary firing in the editor IMO. Easy optimization for Unity to make in order to make the editor feel a lot more smooth on a lot of PC's .

    Here is how it looks at 125hz:
    125hz.png

    And already at 250hz it starts looking like this:
    250hz.png
     
    Last edited: Jan 14, 2019
    Quatum1000 likes this.
  19. rawalanche

    rawalanche

    Joined:
    Aug 26, 2017
    Posts:
    20
    Let's hope for a fix then :)
     
  20. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    5,750
    Nah, it's been that way for a while.
     
    joshcamas likes this.
  21. rawalanche

    rawalanche

    Joined:
    Aug 26, 2017
    Posts:
    20
    I'd like to think that it's because no one really bothered to notice, or noticed and did not bother to report, or noticed, and reported, but did not bother to investigate. Now that we exactly know what causes it, I don't see a reason why it wouldn't be fixed.
     
  22. Lurking-Ninja

    Lurking-Ninja

    Joined:
    Jan 20, 2015
    Posts:
    4,141
    I think it would be the best if you submit a bug report about the issue. You can incorporate @bjarkeck's findings as well. I'm pretty sure the devs will pay attention to it once they get a report of it with measurement and cause.

    And if you do and post the case number here, I'm sure @JeffDUnity3D would pass along to them.
     
    LeonhardP likes this.
  23. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    5,750
    Too lazy to look it up now, but I think it has been reported already. Like 9 months ago.
     
  24. Lurking-Ninja

    Lurking-Ninja

    Joined:
    Jan 20, 2015
    Posts:
    4,141
    Whatever then, I have a low-rate mouse, so it does not apply to me.
     
  25. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    5,750
    Exactly. That's an AMAAAZING attitude. In Greek we have a saying that roughly translates to "Do good and throw it in the sea". Seems appropriate for submitting bug reports to Unity.
     
    Last edited: Jan 15, 2019
    joshcamas and WildStyle69 like this.
  26. bjarkeck

    bjarkeck

    Joined:
    Oct 26, 2014
    Posts:
    243
  27. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    5,750
    Cool :)

    As a sidenote: You may not want to link to fogbugz directly. It's not a big issue, but we can see your other reported issues from there as well and you may have info in the bug report you don't want the public to see.

    Generally just the case number is enough.

    (and maybe later a link to the issue tracker. bugs usually get on the issuetracker after QA has confirmed the bug)
     
    LeonhardP and bjarkeck like this.
  28. bjarkeck

    bjarkeck

    Joined:
    Oct 26, 2014
    Posts:
    243
    Thanks for the heads up, good to know! Did it from an old account it seems, so luckily don't have anything in particular in there.
     
  29. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    1,487
    Thank you for submitting the bug report! QA was able to reproduce the behaviour and the devs are going to look into it.

    You can vote for the resolution of this issue and follow the resolution process here: https://issuetracker.unity3d.com/issues/input-polling-rates-drastically-decreases-editor-performance

    As far as I can tell it had not been reported before, although we recently fixed a similar issue in the Linux editor: https://issuetracker.unity3d.com/is...asset-pack-and-mouse-with-1000hz-pooling-rate

    Fortunately, there are quite a few fishermen here at Unity.
     
  30. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    5,750
    So it all works out in the end, cool :)
     
  31. rawalanche

    rawalanche

    Joined:
    Aug 26, 2017
    Posts:
    20
    They are apparently not very fast fishermen though. It's been a while, 2019 beta got out, but this is still not fixed :)
     
  32. rawalanche

    rawalanche

    Joined:
    Aug 26, 2017
    Posts:
    20
    Hi,

    I'd just like to congratulate to Unity Technologies for the 2 month anniversary of this (still unfixed) bug. Great job! Keep it up! :)
     
    nxrighthere and e199 like this.
  33. nxrighthere

    nxrighthere

    Joined:
    Mar 2, 2014
    Posts:
    522
    That's great what about the fish factory? 2 months of silence is not how we get tasty sushi.

    But seriously, it's impossible to switch the polling rate from 500Hz to 125Hz on my mice (as many other people can't do this I presume). These stutters are quite annoying.
     
  34. rawalanche

    rawalanche

    Joined:
    Aug 26, 2017
    Posts:
    20
    3 month anniversary coming up! :)
     
  35. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    1,487
    Some fish are bigger than others. But it looks like we have a potential fix in sight.
     
  36. rawalanche

    rawalanche

    Joined:
    Aug 26, 2017
    Posts:
    20
    According to the bug report it's now fixed, but the fix is still not even in 2019.1.0f2. Very disappointing :/
     
  37. Peter77

    Peter77

    Joined:
    Jun 12, 2013
    Posts:
    3,896
    The issue tracker says "Fixed in future release". In what release specifically is this fixed?
     
  38. K-ANator

    K-ANator

    Joined:
    Feb 25, 2017
    Posts:
    3
    Please for the love of all that is holy fix this please. I've been bashing my head against a wall for a week trying to figure out why my viewport and game are stuttering like mad.

    I took a long hiatus from development, and recently decided to continue my learning experience. I was quite confused as to why Unity was stuttering like mad on an OC'd Ryzen 1700 and GTX1080 with a game that could run on a ZX Spectrum.
    So it turns out that my Corsair KB/M @ 1000hz is the cause of the issue. Thankfully this is an easy fix via the physical switch on the keyboard and iCue, but my got it's going to be annoying when I want to start playing other games and need to keep switching things back and forth.

    Edit: So switching to 125hz has improved the issue, but key inputs still cause a stutter. Especially if I, for example, rapidly press the spacebar. CPU time rises as high as 100ms.

    I don't believe it's an issue with my code, all I'm doing is checking for inputs in Update, and modifying physics during Fixed Update, which unless things have changed, is what I'm supposed to be doing, yes?
     

    Attached Files:

    Last edited: Apr 23, 2019
    Storm4_ likes this.
  39. rawalanche

    rawalanche

    Joined:
    Aug 26, 2017
    Posts:
    20
    According to the bug report it's fixed in 2019.2. I just tried 2019.2a and it's definitely still not fixed there. 4 month anniversary of this bug is around the corner btw :)
     
  40. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    5,750
    It’s more like a year actually.
     
  41. rawalanche

    rawalanche

    Joined:
    Aug 26, 2017
    Posts:
    20
    I mean since being reported :)
     
  42. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    5,750
    Yes, that's what I meant too.
     
  43. rawalanche

    rawalanche

    Joined:
    Aug 26, 2017
    Posts:
    20
    The bug report has officially been made on Jan 15, 2019. How's that a year?
     
  44. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    5,750
    So roughly a year ago when I had this issue, I found a thread (or maybe it was answers? I do not remember), of someone having the exact same issue and saying that high polling rate was the problem. In that same thread/answers/whatever, he also said he submitted a bug report.

    I cannot be bothered to look it up now, so if it makes you happy, consider it reported 4 months ago.
     
  45. spvn

    spvn

    Joined:
    Dec 10, 2013
    Posts:
    35
    DUDE
    DUDE. POLLING RATE. THANK YOU. WOW. I've been doing all sorts of S*** like enabling/disabling gsync.

    For anybody else, open your Logitech or whatever manufacturer's app and adjust your polling rate down from 1000 to like 500. My Unity editor scene view was running at 30fps when I panned around the scene and was driving me nuts.
     
    AcidArrow likes this.
  46. nxrighthere

    nxrighthere

    Joined:
    Mar 2, 2014
    Posts:
    522
    This bug is no longer a thing for me (and some other guys) in Unity 2019.1.1f. Thanks.
     
    LeonhardP likes this.
  47. 5argon

    5argon

    Joined:
    Jun 10, 2013
    Posts:
    1,261
    I have looked it up for you because that might be me.. I have opened the bug on December 2017, so yes, over a year ago : P Glad it is finally fixed. Thanks.

    https://forum.unity.com/threads/extreme-lag-in-editor-ui-in-2018-3-0b7.574864/#post-3829594
    https://fogbugz.unity3d.com/default.asp?979190_ge68tpo5pv8m7sq4
     
    AcidArrow likes this.
  48. Fenrisul

    Fenrisul

    Joined:
    Jan 2, 2010
    Posts:
    465
    Exiting / force closing Unity Hub itself solved this for me in Unity 2018.4.6f1 ...
    Uninstalled Unity Hub after an hour of reading through all these reports.. Will not be reinstalling. Tried all the DPI/Reporting rate stuff first.
     
  49. Steve-Tou

    Steve-Tou

    Joined:
    Aug 4, 2018
    Posts:
    5
    I just started using 2019.2.0f1 Personal. I had previously been using 2017.1.0p4. I was getting the same horrible editor scene view lag- 3 small objects in scene. (I was also getting two objects using the same material/texture atlas with slightly varying colors.) I recalled having a similar issue when I went from a 2015 version to 2017. I remembered something with lighting settings, so I looked at the Lighting Settings and I unclicked the Auto Generate. It didn't seem to work- until I restarted Unity. I think my Logictech cordless trackman wheel also needed a new battery- I can't find settings for it to check/change the polling rate. It seems to be better now. Maybe this helps someone...