Hey guys, New to unity so sorry if it’s a noob question. I’ve started developing with unity on a 2015 MacBook Pro. I know it’s quite old but it’s serving me quite well. Now, in editor mode, things are relatively smooth regarding performance but in play mode the laptop is pretty struggling with high cpu usage and annoying fan noise making it impossible to play the game for more than a few minutes. My question is, is it possible to reduce performance of the game in some way (rendering, resolution,...) during me development stage? Later, if I reach some point where I want to release the game, I’ll raise all the stuff back. It’s just for the development phase. thank you
Game dev often requires using decent hardware. But you may have other issues with your application, which you are not aware of. I suggest you look and learn using profiler. Then look into bottlenecks, what cost you most of CPU / GPU / Memory. Then optimize accordignly. Other than that, use low quality textures and run on small resolution (resize gameplay screen). But I doubt, that will solve your main problem here. Worth a shot however.
I immediately see the CPU jumping even on a simple scene with 5 items so bottlenecks are not the issue here. It looks like the laptop is indeed underpowered for unity development. I’ll try resizing the gameplay screen. Hadn’t considered that. Thank you
I work from a 2014 MBP, and have zero issues running fairly complex scenes, so I don't think that alone is your issue. Do you have code running, maybe something that's looping and doing complex stuff inside of Update functions?
Unity by default will attempt to hit the highest frame rate your hardware will allow. That often results in either 100% utilization of the CPU or the GPU, whichever one bottlenecks you first. You can try forcing a lower frame rate though. Also reducing quality settings, reducing camera view distance, reducing the complexity of the scene, etc, etc, etc. I'd first check the profiler, see what FPS it says you're getting. Then try capping it lower with targetFrameRate. https://docs.unity3d.com/ScriptReference/Application-targetFrameRate.html Also read what that link says about vSyncCount. Note that Apple laptops are notorious for having insufficient cooling, where you quickly get reduced performance under sustained high load from thermal throttling. They do better with short bursts of high load, but games aren't that way. Just a design choice Apple went with, as it makes the laptop otherwise thinner and sleeker for the same specs on paper and most users won't notice the limitations.
Thank you @Joe-Censored Reducing framerate did the trick. I saw it was around 60fps and set it in script to 30. Now process cpu is around 60%.
I'd probably wrap that in an #if UNITY_EDITOR preprocessor directive then. So whenever you run in the editor you get the low frame rate cap, but whenever you test the build it is uncapped automatically (or whatever is the default value for targetFrameRate on your target platform). Code (csharp): #if UNITY_EDITOR Application.targetFrameRate = 30; Debug.Log("Using Editor performance cap for my own sanity"); #endif https://docs.unity3d.com/Manual/PlatformDependentCompilation.html
Thank you for that tip, but actually, I haven't yet felt any difference when running in 30fps. Assuming my game is not that fast-paced, where would I feel this reduced FPS? Why not run with this in build as well?
Depends on the game. Also, people who pay good money for a higher end gaming machine are usually annoyed by games which arbitrarily limit frame rate. You can look up videos discussing the advantages of higher FPS in games, why high refresh monitors are growing in popularity, etc. Too big a topic to give justice in a forum post.
This, and it's only made worse by the fact that there are groups of people that will single out your game and make it known that it comes with a limit on frame rate. Just as one example I've linked the Framerate Police group which is one of the Top 10 curators on the Steam store meaning they get quite a bit of attention. Furthermore, like the Kotaku article points out, when a curator with a large presence adds your game to their list that game will list that curator on their store page. In the article one developer tried to remove the curator from their store page, and the fans of the curator spammed negative comments all over their game forum. They quickly added it back. https://steamcommunity.com/groups/frameratepolice https://kotaku.com/the-story-behind-steam-s-framerate-police-1732590111