Optimize Your Games In Unity To 60 FPS And Above!

แชร์
ฝัง
  • เผยแพร่เมื่อ 1 พ.ย. 2024

ความคิดเห็น • 64

  • @norskalearn
    @norskalearn ปีที่แล้ว +23

    3:50 Vector3 is a struct (value type), it's instances as a local variables do not produce heap allocations. This code is perfectly performant. By caching the value in a field you actually made it worse, because that way you've permanently reserved X bytes of memory that a Vector3 takes + it takes more time to write a value from stack to somewhere in a heap.

    • @mehmedcavas3069
      @mehmedcavas3069 ปีที่แล้ว

      yes!! was about the comment the same thing. creating a struct in a method is just shifting the stack index a bits all. but changing the value in the heap memory takes more process. as far as I know

    • @itsbarbaric
      @itsbarbaric ปีที่แล้ว

      Indeed, doing this for a class would make sense of course :D

    • @dertobbe1176
      @dertobbe1176 6 หลายเดือนก่อน

      I am grateful for comments like this. I am not a Software expert in any way. Just a dude making his own game. Like a piece of Art. Input like this makes it easier to keep things organized. So thank you

  • @Gears2Game
    @Gears2Game 2 ปีที่แล้ว +1

    man, I don't remember that I unsubscribed from your channel until now., so that's why I am not seeing your videos anymore. I just resubscribed, I have always followed a system I heard once from you in my gamedev journey. it made me able to produce games easily. Thanks for that. I learned that the game development space is huge specially going solo and indie. I just have to pick one hat, learn it,be good in it. then everything else outsource, outsource, outsource.

  • @clamum9648
    @clamum9648 3 ปีที่แล้ว +7

    Excellent video man, with very clear explanations. Thanks game developer gangster man

  • @eliorubenmc
    @eliorubenmc 2 ปีที่แล้ว +2

    I'm back to say: the gameplay of my game uses about 5ms cpu average before, and doing almost everything I see in this video and what I read in the blog, now it is 3ms cpu, and now run smoothly as never before... Still need to optimize my textures and all materials but this information is gold!!! Thanks again!!
    By the way ma game is "escape from marble's monster" very early development process is you are curious, there is only 3 videos about on TH-cam

  • @nihil75
    @nihil75 2 ปีที่แล้ว +1

    Great tips man, good to get some code focused suggestions beyond the usual "bake your lights, change to vertex" stuff (which is useful as well ofc)

  • @shiv-iwnl8188
    @shiv-iwnl8188 3 ปีที่แล้ว +2

    The new unity logo is nice

  • @bindum7178
    @bindum7178 3 ปีที่แล้ว +3

    The One dislike is from an empty callback function...

  • @TYNEPUNK
    @TYNEPUNK 3 ปีที่แล้ว +2

    good tips, I didnt know about the transform one! :o

  • @ali_kara
    @ali_kara 3 ปีที่แล้ว +3

    Good tips thank you!

  • @bhautikranpara7664
    @bhautikranpara7664 3 ปีที่แล้ว +7

    Very knowledgeable tutorial we want more like this

  • @nihaanali7719
    @nihaanali7719 3 ปีที่แล้ว +6

    Very informative

  • @diliupg
    @diliupg 3 ปีที่แล้ว +1

    what is up guys? Fantastic tips! 100%!

  • @supertenchoo4271
    @supertenchoo4271 3 ปีที่แล้ว +5

    great video

  • @Kathayne636
    @Kathayne636 2 ปีที่แล้ว

    Great tutorial!! (BTW @2:20, you were correct in saying "latter". )

  • @raploky
    @raploky 2 ปีที่แล้ว

    Wooooow - that is extremely useful tutorial! Thank you a lot!

  • @stephenkentperez7705
    @stephenkentperez7705 2 ปีที่แล้ว

    those empty call backs was an "oh shit" moment for me... i recently shipped an mvp game demo with 200+ scripts that mostly have those empty callbacks...

  • @TacticalAssaultOfficial
    @TacticalAssaultOfficial ปีที่แล้ว +2

    Cool video! Thanks for the tips. You mentioned you used the profiler to find that specific line of code that was eating up performance. Do you have any videos on how to read the profiler to narrow down lines of code like that?

    • @reaporofdragon744
      @reaporofdragon744 ปีที่แล้ว +1

      in the Unity script at the top you add using
      using UnityEngine.Profiling;
      Profiler.BeginSample("Name");
      //Your Code
      Profiler.EndSample();
      and it would show the Name in the Profiler

  • @mahmoudelboshy4033
    @mahmoudelboshy4033 ปีที่แล้ว

    YOU ARE A GREAT MANNNNN!!!

  • @marcoseliasmep
    @marcoseliasmep ปีที่แล้ว +1

    Nice tips! I would never imagine that just calling transform.something would be bad for performance. I use it in many places, many times, for vehicles and pedestrians. I’ll check it later with a cached variable.
    By the way on the last thing you mentioned I don’t think it would be great. How are you loading those prefabs?
    If you place them inside a Resources folder that could slow down the startup of the app.
    I do prefer using asynchronous scene loading (sometimes additive, sometimes not).

  • @carlabalos3884
    @carlabalos3884 2 ปีที่แล้ว

    Great tips man. Thanks!

  • @eliorubenmc
    @eliorubenmc 2 ปีที่แล้ว

    genial, gracias!!! also the blog is en mis favoritos como referencia!

  • @ReikoTennosaar
    @ReikoTennosaar 3 ปีที่แล้ว +5

    Thanks!

  • @chamssidinechams4222
    @chamssidinechams4222 ปีที่แล้ว

    great video thank you

  • @thehyper4288
    @thehyper4288 3 ปีที่แล้ว

    What a quality video, nicely done man.

  • @regys9521
    @regys9521 3 ปีที่แล้ว +1

    Amazing tips

  • @Pixelsheartstudio
    @Pixelsheartstudio ปีที่แล้ว

    you make the same mistake when you did " Vector3 temp = mainCam.transform.position;" I`m just kidding ... really thanks a lot about your effort this helps a lot keep it up ☺️

  • @ADifferentGamingChannel
    @ADifferentGamingChannel 2 ปีที่แล้ว

    Do you recommend using the Async Library instead of the Coroutine stuffs? I like your web btw :D

  • @greekdevtutorials
    @greekdevtutorials 2 ปีที่แล้ว +1

    Amazing!!!!!!!

  • @itookaonabookanyway7385
    @itookaonabookanyway7385 2 ปีที่แล้ว

    My simple toon shader Unity game that uses only 20 MB to install and run performs horribly, any tips for having a toon shader run on URP? or a toon shader that is best for mobile experiences
    I will refine my code again for the sake of optimization because I really need to make my game work efficiently on the phone

  • @notagamedev5494
    @notagamedev5494 3 ปีที่แล้ว

    More Optimization Tips And Tricks blog link is broken

  • @shinronitgaming486
    @shinronitgaming486 3 ปีที่แล้ว +1

    How AAA studios are creating huge world games for mobile? Without any performance issuses?
    Like if i put a empty terrian in my scene with nothing at all more than a camera the fps goes 60 to 20-24

    • @diliupg
      @diliupg 3 ปีที่แล้ว

      reduced draw calls, LOD, URP, ;-)

  • @random_precision_software
    @random_precision_software 3 ปีที่แล้ว

    I'll hold my hands up,I make 99% of everything public is that bad or should I see the light and start to use serializefield ?

    • @clamum9648
      @clamum9648 3 ปีที่แล้ว +3

      The problem with Public variables is you can modify them in other objects you don't really intend to and the results can be unexpected and possibly hard to track down.
      You're free to do what you want, but I highly suggest you make everything Private by default and if you need it in the Inspector put SerializeField on it. It's just a good habit to get into.
      There's a reason this is stressed to programmers. It was drilled into our heads in my intro Computer Science classes in college.

    • @random_precision_software
      @random_precision_software 3 ปีที่แล้ว +2

      @@clamum9648 yea, I'll start doing it,I was self taught so have loads of bad habits lol

    • @clamum9648
      @clamum9648 3 ปีที่แล้ว

      @@random_precision_software It's all good, we're always learning. I definitely am no expert myself. I've worked professionally for about 13 years doing software development and the best developers I've worked with have a genuine passion for software development and continually try to better themselves and learn new skills, often working on their own personal projects here and there. Good luck bro

    • @random_precision_software
      @random_precision_software 3 ปีที่แล้ว

      @@clamum9648 thank you. 👍

    • @Eckster
      @Eckster 3 ปีที่แล้ว +1

      When coding by yourself on a short-term project you'll likely never run into issues, encapsulation (making things private where you should) matters a lot more in team settings and larger projects where limiting the scope of what state can be updated by external methods and by what means makes it a lot harder to step on each other's toes, and on your own toes on accident.

  • @reaporofdragon744
    @reaporofdragon744 ปีที่แล้ว

    I used the profiler to check how much my scripts are using in my 2D game and its 0.01 the game is running on 800 fps on pc and 300 on my old Pentium 4 laptop but its running 20 fps on my phone XD

  • @TalhaRiaz197
    @TalhaRiaz197 3 ปีที่แล้ว

    Can we get you Games Link or your Id Link Please

  • @dakshsharma2963
    @dakshsharma2963 3 ปีที่แล้ว

    Today's video without intro 😮😮😮

  • @animationart5755
    @animationart5755 3 ปีที่แล้ว

    dude would u make an awesome tut about implementing a stamina script into mobil touch script. 2 days and it stil not work how it should work i red every articel and did every tut about it but nothing worked for me for them it worked not for me though so please help me a little

  • @4xh9
    @4xh9 4 หลายเดือนก่อน

    mu bro 🔥🤍

  • @mussabrafiq5698
    @mussabrafiq5698 ปีที่แล้ว

    Nice pic dear

  • @syluxdev
    @syluxdev 3 ปีที่แล้ว

    The most important thing is you can copy the code 😂

  • @s6huskic30
    @s6huskic30 3 ปีที่แล้ว

    Please make a game 'where is third gentleman?'

    • @awesometuts
      @awesometuts  3 ปีที่แล้ว

      😂😂😂😂😂😂😂😂

  • @Area_GnC
    @Area_GnC 2 ปีที่แล้ว

    Yandere Dev should watch this video.

  • @abdulahadtayyab7384
    @abdulahadtayyab7384 10 หลายเดือนก่อน

    worst tutorial I 've ever seen
    just he was beating about the bush

  • @Jimaniki
    @Jimaniki 2 ปีที่แล้ว +1

    Thanks you !

  • @krishnansubramoni7801
    @krishnansubramoni7801 3 ปีที่แล้ว

    Thanks!