Top 10 Tips To Optimize Your Mobile Game - Unity 3D

Поделиться
HTML-код
  • Опубликовано: 25 ноя 2024

Комментарии • 86

  • @dancogames12332
    @dancogames12332 Год назад +9

    You can also change the settings of quality to low in Edit > project settings > quality from that you can disable shadows if you set it as low

    • @CGDealers
      @CGDealers  Год назад +4

      It's better to put all those settings in your game.
      Settings -> Graphics and let the user tweak them manually.
      Also you will need to detect the phone/tablet hardware when the game runs and set the quality to match the hardware.

    • @DARK_AMBIGUOUS
      @DARK_AMBIGUOUS Год назад

      You can also set the resolution to 50%. I don't know how to do it with coding but with visual scripting, you use the unit called "Screen, Get Height" and "Screen, Get Width", then divide them by 2, then use "Screen, Set Height" and "Screen, Set Width". It will make your game more blurry but it will run sooooooo much better. I mean modern phones have super high resolutions so it's no that bad. The iphone XS Max has a 1242x2688. That is higher than 1080p and think about this. The Nintendo Switch is only 720p. Your game doesn't need to run at full 1242x2688 resolution considering how small the screen is compared to PC monitors and the size of the switch screen

  • @t0xangames207
    @t0xangames207 Год назад +7

    1:53 I advise you to use lightmap compression when baking light, and set it to High or Normal Quality. This will significantly reduce the weight of the lightmap.

    • @CGDealers
      @CGDealers  Год назад +2

      It depend on what kind of game you are making. Compressing lightmap for FPS is not a good option. Better to reduce the size than compressing. By compressing you will get a lot of artifacts and color incorrections which in an FPS game is very, very noticable and unplesent for the player. For top down games - sure!

    • @t0xangames207
      @t0xangames207 Год назад

      @@CGDealers at very low compression quality there are artifacts, at normal or high levels they are not noticeable. For example, my lightmap without compression weighs 20.7 megabytes, and after High Quality compression it began to weigh 2.7 megabytes. There were no artifacts to be seen.

    • @CGDealers
      @CGDealers  Год назад

      @@t0xangames207 At high there are still artifacts in the color spectrum. If you are making FPS game and you literally can stand in front of that wall and cover you entire screen it's very visible.

  • @AetherXIV
    @AetherXIV Год назад +3

    Excellent! Very specific and helpful

  • @watercat1248
    @watercat1248 2 года назад +6

    i have few more tips as well
    1. use less polygon wean you can
    2. use lod in the order to lower the quality in the far away objects
    3. wean your object is not moving adding this as statics objects
    4. use less polygon wean you can
    5. have the option to lower your quality
    stuff that im not so sure
    1. 3:17 use always mobiles shaders wean you can
    yes in theory that will be good idea if you create i mobile game but what if created a game for pc or other platforms or use if use URP ?
    2. 2:35 always use sprite atlas wean you can
    i don't know if that is good idea because you do that the texture resolution i going large that means if you change the texture i will become even blurrier

    • @CGDealers
      @CGDealers  2 года назад

      I'm talking only about mobile games. So the stuff that you are not sure 1. and 2. works for mobile not for PC. For PC you have a lot more resources, so you don't need to do that.

    • @watercat1248
      @watercat1248 2 года назад +1

      @@CGDealers yes pc and consoles have way more resources that is for true but i still believe the tips but to increased your performance also heavin better performance is effective every platform like for example if do good optimization for my game they will be able to play the with less powerful computer and the powerful computer i will able to play with better performance or with better performance in the max settings
      this for PC ass for console the have very specific hardware unlike computer and mobile so i thing the best way for consoles is to know research the console architecture for the specific console you want to create the game in that way will able to take advantage in the order to take advantage for full protection

    • @CGDealers
      @CGDealers  2 года назад

      True that.

  • @praisethesun2612
    @praisethesun2612 Год назад +1

    VERY useful! Thanks!

  • @Dyzinel
    @Dyzinel 2 года назад +2

    Excellent video!

  • @dimka_dev
    @dimka_dev 2 года назад +2

    Such a good video, thank you for the advice.

  • @rainwingp
    @rainwingp 6 месяцев назад

    Great tutorial! Thank you so much.

    • @CGDealers
      @CGDealers  6 месяцев назад

      You're very welcome!

  • @VarunAiyar
    @VarunAiyar 12 дней назад

    Very helpful, thank you

  • @GamLopStudio
    @GamLopStudio 2 года назад +1

    First video i got to explain perfectly... Thanks 😃

    • @CGDealers
      @CGDealers  2 года назад

      Tried to explain as much as possible in few minutes. Keep in mind that those are very broad but it gives you idea where to touch in order to boost the performance. I've been developing Counter Attack for the last 5-6 years. Did tons of tests until I've reach to that point. Of course this is indie optimizations with the tools you have out of the box in Unity.
      You always can get further with custom rendering pipeline etc., like in COD Mobile, but you need big team for that :)

  • @Jimaniki
    @Jimaniki 2 года назад +2

    Thank you so much for this video ! That should help me to improve performance from 25-40 to ??? (i will write the result after finish all your tips :)

    • @CGDealers
      @CGDealers  2 года назад

      Good luck! Let me know once you've tried it how it boosted your performance!

  • @manupaliwal9248
    @manupaliwal9248 11 месяцев назад

    Please can u make video on same topic but for unreal engine mobile game optimization. Pls!!😊

  • @82Lead82
    @82Lead82 6 месяцев назад +3

    Epic games should take notes lol

  • @lockin222
    @lockin222 Месяц назад

    good advice thanks

    • @CGDealers
      @CGDealers  Месяц назад

      Glad it was helpful!

  • @Jimaniki
    @Jimaniki 2 года назад +4

    3:36 And what about URP Shaders ?

    • @CGDealers
      @CGDealers  2 года назад

      I'm using built-in rendering as a lot of tests on the Unity Forum shows that Built-in in some cases (Which is ours) has slightly better performance than URP on mobile. However I'm sure with the new unity 2022+ you can have better performance with URP if you tweak the shaders right for your mobile device!

  • @raploky
    @raploky Год назад

    Extremely helpful!

  • @BulletGames-official
    @BulletGames-official Год назад +3

    Screen Scale is a type of blur or pixeled texture? Hope will you answer 🎉

  • @user-uk9er5vw4c
    @user-uk9er5vw4c Год назад +1

    great video

  • @flurinjenal374
    @flurinjenal374 9 месяцев назад +1

    Nice, top!

    • @CGDealers
      @CGDealers  9 месяцев назад

      Thank you! Cheers!

  • @omkarpatil2094
    @omkarpatil2094 Год назад +2

    These are great suggestions. Thank you.
    I do 1 question regarding the last tip.
    Suppose for my game I have TWO UI elements that update regularly, eg. I have a timer UI updating every second, and a score UI updating every frame, along with some static UI like a pause button and mute button.
    Do I here make 3 canvas, 1 for Score, 1 for timer and 1 for buttons? Or do I just make 2 canvases, 1 with regularly updating UI and 1 with static UI?

    • @CGDealers
      @CGDealers  Год назад +1

      Make 1 combined for Score and Timer and the buttons will be on separate one. So two in total.

    • @omkarpatil2094
      @omkarpatil2094 Год назад

      thank you so much@@CGDealers

  • @XadegamerOfficial
    @XadegamerOfficial Год назад +1

    Did you enable shadow?

    • @CGDealers
      @CGDealers  Год назад +1

      I've baked them. Also for the character shadow I'm using fake circle with script that make it small/big based on the distance if the player jumps.

    • @XadegamerOfficial
      @XadegamerOfficial Год назад

      @@CGDealers Okay thanks, after backing my character is dark, please how can i solve it

  • @hodlgang4906
    @hodlgang4906 2 года назад +2

    How did you implement the screen scale ?

    • @CGDealers
      @CGDealers  2 года назад

      You need to write it custom for your game. We've created a custom solution for our game Counter Attack.

    • @GameOnBudget
      @GameOnBudget Год назад

      @@CGDealers can you share ?

    • @BulletGames-official
      @BulletGames-official Год назад

      ​@@CGDealers How custom it ?

  • @arunachalpradesh399
    @arunachalpradesh399 Год назад +1

    2k resolution for texture is too high, i only keep 1k max if targetting for high end phone and generally 512 for targetting mid range phone. the biggest problem of texture size is not fps but overall size of the game. going from 512 to 1024 texture size increase almost 30% of the size of the game. for short game its ok .

    • @CGDealers
      @CGDealers  Год назад +1

      The best way is to use auto detection of the users hardware and setup the texture resolution based on it.

    • @arunachalpradesh399
      @arunachalpradesh399 Год назад

      @@CGDealers how to do it, what is the name of the process, does unity support it

  • @nwotyzarc
    @nwotyzarc Год назад +1

    How to set up the lighting in a game where everything is baked and no object or player gets real time lighting?
    Just put light probes all over the place so illuminate my object from every angle and then hit bake?

    • @CGDealers
      @CGDealers  Год назад +1

      Yep light probes are for non static objects. You need to combine them with Reflection probes too.

    • @nwotyzarc
      @nwotyzarc Год назад

      I'm making a 3d stylized game. The assets already have the shadows drawn into the cracks etc.
      I just want to illuminate them evenly 100% because the textures look perfect like that.
      How would you set this up?

  • @TripsoftNgoNghiaNgoc
    @TripsoftNgoNghiaNgoc 11 месяцев назад

    my bake data occlusion is always missing when i play game how to fix it

  • @Ez-_-69.
    @Ez-_-69. Год назад +1

    How should I add shadows to my game with as much less performance decrease as possible, i am making a cooking 3d game, it has only one room but even then when I turn on shadows it gets like 20-30 fps in my realme 6

    • @CGDealers
      @CGDealers  Год назад +1

      You need to bake the shadows and after that use shadow mask feature with mixed lightning baked/realtime and setup distance for the shadows. In that case you will have realtime shadows + baked shadows.

    • @Ez-_-69.
      @Ez-_-69. Год назад

      @@CGDealers thank you very much! Appreciate it

  • @J.g12344
    @J.g12344 Год назад +1

    bro can you make a asset for your fps controller 🎮 please...

    • @CGDealers
      @CGDealers  Год назад

      No sorry our assets are copyrighted.

  • @Lucas-tx5bn
    @Lucas-tx5bn 3 месяца назад

    How do you add this lighting effect to the glove? When you move the camera the glove has a specular effect.

    • @CGDealers
      @CGDealers  3 месяца назад +1

      You put a directional light to lit only a specific object by using layers.

    • @Lucas-tx5bn
      @Lucas-tx5bn 3 месяца назад

      @@CGDealers I understand, in this case this directional light is in real time? Do you use this same technique on the weapon? I downloaded your game and the graphics are great and well optimized. Thanks for answering.

    • @CGDealers
      @CGDealers  3 месяца назад +1

      @@Lucas-tx5bn yes the light is working on the weapon and gloves only for optimization. The rest is baked and i use lightprobes for third person characters.

    • @Lucas-tx5bn
      @Lucas-tx5bn 3 месяца назад

      @@CGDealers I hadn't thought about it, but in this case are you using a shader that unity already provides, or a custom shader?

  • @neilfosteronly
    @neilfosteronly Год назад +1

    How do you do tip 7?

    • @CGDealers
      @CGDealers  Год назад

      Search the unity forums it has all the answers how to code this.

    • @neilfosteronly
      @neilfosteronly Год назад +1

      @@CGDealers Ok I figured it out, but couldn't find on any forums.
      In URP you need to add using UnityEngine.Rendering.Universal; to a script.
      Then you can add [SerializeField] private UniversalRenderPipelineAsset myPipeline;
      With myPipeline you can set the render scale. I use a Slider for this example:
      myPipeline.renderScale = renderScaleSlider.value;
      Using UnityEngine.Rendering.Universal and then having at least one UniversalRenderPipelineAsset to edit is the main thing. Each Low, Medium, and High Quality settings are a UniversalRenderPipelineAsset .

    • @GameOnBudget
      @GameOnBudget Год назад +1

      @@neilfosteronly built-in render can work >?

    • @neilfosteronly
      @neilfosteronly Год назад

      @@GameOnBudget No it has to be URP. Maybe HDRP not sure I have never used.

  • @fizzypeaches5611
    @fizzypeaches5611 Год назад

    In the Screen Scale part, do you directly change Screen.SetResolution or do you use Dynamic Resolution?

    • @CGDealers
      @CGDealers  Год назад

      We change it dynamic depending on the FPS and Hardware.

    • @PNKnews
      @PNKnews 10 месяцев назад

      I think this might be the way to do it: ruclips.net/video/R7922Pchiq4/видео.html&ab_channel=MattMirrorFish

  • @victor.novorski
    @victor.novorski Год назад

    How do I make the screen scale resolution? I can only find Canvas related videos not pixel reduced videos

    • @CGDealers
      @CGDealers  Год назад

      Screen scale is % based which is pixel related. For example if your game is running on 1920x1080 and it's 30FPS due to the rendering, you can make it /2 and boost the fps. Only if the problem is due to the GPU taking too much time to render a lot of pixels for weak mobile device.

    • @victor.novorski
      @victor.novorski Год назад

      @@CGDealers I know how it works, but I can't find a way to make it work. Like is it the Resolution & Presentation DPI changed or is it an overlay camera? How do I make that happen?

  • @Hamo0odi96
    @Hamo0odi96 9 месяцев назад

    I cannot buy the course for Unity on the Udemy website because it is not available on the Unity engine, only on the Unreal Engine. Can you give me this course that you explained in the video, but it is specific to the Unity engine?

    • @CGDealers
      @CGDealers  9 месяцев назад

      You can get it on Skillshare: www.skillshare.com/en/r/user/coldwave?gr_tch_ref=on
      The subscription is for the complete website. So you will be able to watch other unity courses too.

  • @DARK_AMBIGUOUS
    @DARK_AMBIGUOUS Год назад

    How do I make it so the graphics are better/worse depending on which device you are playing the game on. But how do I do it where the player cannot change the graphics, but where they are pre-set for each device so that they all run the game at 60FPS

    • @CGDealers
      @CGDealers  Год назад

      You need to detect the hardware and setup your game settings based on that.

  • @luluskuy
    @luluskuy Месяц назад

    how to do screen scale man?

    • @CGDealers
      @CGDealers  Месяц назад

      Just ask ChatGPT and it will write a script for you. :)

  • @flurinjenal374
    @flurinjenal374 9 месяцев назад +1

    How do we set the resolution of our game as game developer? I'm thinking of having 80% resolution as standard.

    • @flurinjenal374
      @flurinjenal374 9 месяцев назад

      I think I found it in your answer below, let me check and test it out.