How to optimize your Unity game for Mobile, PC & WebGL: from 230MB to 3.7MB

  Рет қаралды 92,875

GameDevLuuk

GameDevLuuk

Күн бұрын

Пікірлер: 148
@FileTh1rt3en
@FileTh1rt3en Ай бұрын
Took my game from 2.6 GB to 0.7GB, loads about 4 times as fast now and of course is much smaller. Very great and informative video actually.
@GameDevLuuk
@GameDevLuuk Ай бұрын
Thanks for the comment and very happy for your result :)
@CROXoDyLE
@CROXoDyLE 4 жыл бұрын
alright boys we gotta gas his channel up. This man is wayyyy too underrated. best game dev out there by far.
@ziasher4190
@ziasher4190 4 жыл бұрын
ik
@DiegoSLTS
@DiegoSLTS 4 жыл бұрын
Hey, I have some comments: - You mention using POT textures is the most important part, but that's only true in some setups. At some point you had a warning saying that it couldn't compress the texture because it's width or height we're not a multiple of 4, so that's also an option too in some cases. - Related to that and atlases, you don't need to worry about POT or multiples of 4 if you put sprites in an atlas. You kind of mentioned that, but then at the end you added a new sprite and made it POT while you could have made it of any size and put it inside an atlas. Those 2 points are really important for artists, it's better to let Unity do the annoying work and remove that step from the artists' task. Also, this is REALLY usefull whey using sprites for UI, since you usually want sprites to stretch and stuff like that. Having extra invisible space makes it harder to place them consistently. - When you created the atlas you mentioned that since you had some big images, they took all the space and some other images didn't fit in. You don't need to remove them, when you create an atlas it'll automatically create multiple textures to fit everything. You can see these other textures if you press the "#1" button in the preview header. I'd suggest you keep everything in the atlas to save more space. - The 40MB atlas can be imported as individual images and let Unity put them in an atlas. May seem redundant, but if you compare your handmade atlas with Unity's you'll see they pack sprites a lot tighter, you might save some more space if Unity's packaging removes enough empty space to use a smaller POT size But anyway, this was a really good video, lots of people don't know about this stuff and it's nice to see real world examples of the benefits of using good import settings.
@GameDevLuuk
@GameDevLuuk 4 жыл бұрын
Thanks for your in-depth feedback, I totally agree with the points mentioned, keep it up!
@EveryoneFknSucks
@EveryoneFknSucks Жыл бұрын
What is this about? > Also, this is REALLY usefull whey using sprites for UI, since you usually want sprites to stretch and stuff like that. Having extra invisible space makes it harder to place them consistently. I don;t understand what you mean here. Sprites can be tiled and 9-sliced all the same regardless of whether they're in an atlas or alone or NPOT texture
@yurinativo
@yurinativo Жыл бұрын
Really impressive! I just reduced my build from 46mb to 12mb and still have more assets to change.
@xdeathknight72x
@xdeathknight72x 3 жыл бұрын
I just got my project down from 107mb to 14.9mb! This video is great, thank you!
@5q11
@5q11 4 жыл бұрын
You can actually create something like two pixel image to use as gradient to save even more memory. Top pixel would be lighter green, bottom one darker green in this case. If you apply it to an image component stretched across your screen Unity will blend these colors (filtering mode needs to be set to bilinear or trilinear).
@GameDevLuuk
@GameDevLuuk 4 жыл бұрын
Hi there, this is very true, thanks for pointing it out!
@CyberAngel67
@CyberAngel67 4 жыл бұрын
Two colors don't make a gradient though, as gradients have many variants of those two colors. On very small screens you might get away with a 2 pixel image for this, but not in a webgl screen.
@marshmallow_fellow
@marshmallow_fellow 4 жыл бұрын
@@CyberAngel67 I think you miss understand. you aren't using the 2 pixels as the gradient. you're generating a gradient by up scaling the image. then sampling the up scaled version
@CyberAngel67
@CyberAngel67 4 жыл бұрын
@@marshmallow_fellow I understand, but upscaling you still only have two colors, do you not.
@marshmallow_fellow
@marshmallow_fellow 4 жыл бұрын
@@CyberAngel67 nope. Most upscale algorithms try to make a gradient between pixels to make them appear to have more information than they do. Unity by default uses nearest neighbour upscale which creates a pixel which is the average of the surrounding neighbours. If you do this with 2 pixels, 1 you will get a linear gradient between the two initial colours as it tries to add detail. This is also the reason pixel art is blurry when you first put it into unity
@tpaslou
@tpaslou 3 жыл бұрын
This is gold. Great video, saved my team in the final build stages. Thank you
@GameDevLuuk
@GameDevLuuk 3 жыл бұрын
Awesome, thanks and gl with the release🙏
@GarageCreativity
@GarageCreativity 3 жыл бұрын
Your lesson about unity optimization is the most usefull I have ever watched on youtube ! I have been looking for such video for a long time. Thank you so much, liked and subscribed to your channel. You made my day!
@GameDevLuuk
@GameDevLuuk 2 жыл бұрын
Thanks for the kind words, glad it helped you and keep making (optimized 😂 ) games!
@Primu
@Primu 11 ай бұрын
6:00 You should increase the game preview scale to 1.0 to get an actual representation of what your assets will look like in the specified resolution.
@orwell235
@orwell235 2 жыл бұрын
My Lord, this man just got another subscriber
@vivienlynn2585
@vivienlynn2585 3 жыл бұрын
@12:20 this is a nice tip! You can go even more crazy and have the sprite only consist of 2 pixels (1 wide, 2 high). Unity will then create a gradient for you. I think that leaves you with a file size of 8 Byte ;)
@samyam
@samyam 4 жыл бұрын
Great video!
@aljosaskorjanc1475
@aljosaskorjanc1475 3 жыл бұрын
Wow man i really hope your channel succeeds! It is so awesome, keep up the good work!
@thepolygonpilgrimage
@thepolygonpilgrimage 3 жыл бұрын
Thank you so much for this great information! I really hope you keep making great videos like this one. Subbed and I've told all my subs (currently 9,700+) about it. Well done sir!
@GameDevLuuk
@GameDevLuuk 3 жыл бұрын
Thanks for the kind words Matt! And keep going too :D
@ConcreteJungleGames
@ConcreteJungleGames 3 жыл бұрын
great video Luuk - definitely going to refer to this in my next project, cheers!
@GokdenizCetin
@GokdenizCetin Жыл бұрын
Best texture size optimization video ever
@NevRS32
@NevRS32 Жыл бұрын
Duude! That was awesome! Thank you!
@darkkinght6677
@darkkinght6677 Жыл бұрын
very appreciated your hard work and understandable tutorial thank you so much
@PyroPhysicsGames
@PyroPhysicsGames 4 жыл бұрын
Never thought about sprite sizes since i had all the power of pc. This info will deffinately be worth a while exporting for webgl and mobile. Thanks! Subscribed!
@GameDevLuuk
@GameDevLuuk 4 жыл бұрын
Good to have you :D
@LaCreArthur
@LaCreArthur 3 жыл бұрын
Nice and simple tips to apply in your game, took me 5 minutes to halve the build size!!! Thanks
@GameDevLuuk
@GameDevLuuk 3 жыл бұрын
Amazing result!
@eriknastesjo843
@eriknastesjo843 3 жыл бұрын
Holy crap. Wish I had this info before my texture size went up to 3.4 gb but thanks!!!
@GameDevLuuk
@GameDevLuuk 3 жыл бұрын
That's nothing compared to Warzone, right? 😅
@Luffydaman91
@Luffydaman91 4 жыл бұрын
This was so helpful! Thank you!
@GameDevLuuk
@GameDevLuuk 4 жыл бұрын
Glad to hear this!
@equalique1
@equalique1 2 жыл бұрын
Thanks a lot for sharing!
@r3mus89
@r3mus89 3 жыл бұрын
This is awesome! Thank you very much!
@aurelianobuendia24
@aurelianobuendia24 3 жыл бұрын
Actually very usefull , thanks for the tips
@dreamer_0001
@dreamer_0001 8 күн бұрын
Yoo Thank you so much you are the best!!
@MohammadFaizanKhanJ
@MohammadFaizanKhanJ 3 жыл бұрын
One thing you must do after watching the video! The Thumbs up! Geate thing
@mke344
@mke344 Жыл бұрын
amazing!!! appreciate it man!
@DiegoCastares
@DiegoCastares 2 жыл бұрын
This is gold. Thank you mate!
@GameDevLuuk
@GameDevLuuk 2 жыл бұрын
Thanks Diego, have fun coding 😎
@aliazzam7248
@aliazzam7248 4 жыл бұрын
I got great results Thank you so much ❤
@GameDevLuuk
@GameDevLuuk 3 жыл бұрын
Great to hear man! Glad my tips could help 😍
@elp95
@elp95 2 жыл бұрын
Thank you for this video
@thevirtunaut1856
@thevirtunaut1856 2 жыл бұрын
Thank you! You're a god. Super helpful!
@versystudio822
@versystudio822 3 жыл бұрын
Thanks for the video. Very informative.
@PandemoniumGameDev
@PandemoniumGameDev 4 жыл бұрын
Great tip, thanks!
@JonelKingas
@JonelKingas 11 ай бұрын
is it even posible to make low mb game like 5 MB etc, cause from what I see in my build editor log my small game that's pixel art takes Total User Assets 8.6 MB but it says Complete build size 71.6 MB? what are those other 63 mb?
@PolycarbonGames
@PolycarbonGames 3 жыл бұрын
Great job!
@Reikha1987
@Reikha1987 4 жыл бұрын
Fantastic video!
@GameDevLuuk
@GameDevLuuk 4 жыл бұрын
Thanks man :)
@Reikha1987
@Reikha1987 4 жыл бұрын
@@GameDevLuuk Tried it out in a prototype ive been working on and got it down from 20 mb to 5 mb following your workflow! Looking forward to the video about sound files
@GameDevLuuk
@GameDevLuuk 4 жыл бұрын
@@Reikha1987 great to hear, amazing results, keep it up!
@USBEN.
@USBEN. 3 жыл бұрын
Thankyou ,was a good video.
@Finnigan28
@Finnigan28 3 жыл бұрын
Great advices. Do you have any advice on how to reduce the size of the sounds? Which are the other heavy resources. If you had to optimize the sound weight for Tied Together, I'd love to know how did you do it.
@mingjyunhung6651
@mingjyunhung6651 Жыл бұрын
this is really helpful thank you !
@MDweller
@MDweller 4 жыл бұрын
Thankyou man. Those are some realy pro level tips! 👍
@GameDevLuuk
@GameDevLuuk 4 жыл бұрын
Glad they helped :)
@GeniusK
@GeniusK Жыл бұрын
This is amazing. Thank you
@battou2501
@battou2501 2 жыл бұрын
Sprite atlas WILL FIT ALL! Do not mislead people! There is #1 in the top right over the atlas previre - this is the number of atlas it generated. It will generate as much atlases as needed to fit all!
@KenlieroGames
@KenlieroGames 9 ай бұрын
Can you optimize files directly from asset folders with other app. So that when you save the file, lets say using photoshop, then the next time you start Unity, it automatically loads that (newly modified) file on startup?
@rinorramadani9034
@rinorramadani9034 29 күн бұрын
how you get all this good qyality. when i create a cricle on scene, and play on my phone (in unity remote)my quality is low and my fps is down why ??
@tobario
@tobario 3 ай бұрын
Still waiting for that audio optimization video ;)
@yojasmagic
@yojasmagic 3 жыл бұрын
This is great. I'm currently trying to get our project running on iOS, but it won't assign more than 128MB so optimisation is absolutely vital. Looking forward to that audio optimisation guide!
@GameDevLuuk
@GameDevLuuk 3 жыл бұрын
128 MB is plenty ;) I am sure you will do it easily with these tips 🔥
@USSR-Lenin-Stalin-Forever
@USSR-Lenin-Stalin-Forever Жыл бұрын
how to make Unity display the texture weight like yours?
@SkorpionYassine
@SkorpionYassine Жыл бұрын
When is the optimizing audio video :(
@rajdeepdas86
@rajdeepdas86 2 жыл бұрын
amazing tutorial
@syedfiazshah8821
@syedfiazshah8821 4 жыл бұрын
Good Job Mate.
@CROXoDyLE
@CROXoDyLE 4 жыл бұрын
upcoming brackeys for sure
@rCr101990
@rCr101990 3 ай бұрын
the best! thanks!
@moritahcol2810
@moritahcol2810 4 жыл бұрын
Great job with this video. Thank you very much. Did you finally made the video with audio compression? That would be really helpful too. Thanks again!
@GameDevLuuk
@GameDevLuuk 3 жыл бұрын
Thanks! Nothing new yet on the audio one, it was a lot less promising then the textures.
@457Deniz457
@457Deniz457 Жыл бұрын
Wow NICE !
@my_temporary_name
@my_temporary_name 4 жыл бұрын
Great video, thank you!
@jayrome9946
@jayrome9946 Жыл бұрын
Thanks bro!
@rafaelskiarteportfolio1098
@rafaelskiarteportfolio1098 2 жыл бұрын
Thank you!
@HefesTBunker
@HefesTBunker 4 жыл бұрын
Very cool and helpful video, man! :) Also, could you make the same video but about 3d game?
@suthamonhengrasmee8182
@suthamonhengrasmee8182 Жыл бұрын
+1
@lln6123
@lln6123 2 жыл бұрын
Great tutorial
@ha123461
@ha123461 3 жыл бұрын
ur doing gods work
@flyinwind8996
@flyinwind8996 3 жыл бұрын
great!
@eschewary367
@eschewary367 3 жыл бұрын
What are some ways to optimize performance once the size is optimized?
@GameDevLuuk
@GameDevLuuk 2 жыл бұрын
FPS ofcourse is one of the biggest things to tackle when talking about optimization. Hit that sweet 60 FPS on target devices, optimized scripts, reduce drawcalls. But my golden rule is always; optimize what needs to be optimized, don't optimize for the sake of optimizing.
@eschewary367
@eschewary367 2 жыл бұрын
@@GameDevLuuk Cool, thank you!
@rafaelbarbosa9347
@rafaelbarbosa9347 4 жыл бұрын
Hey! I'm wondering if there is some way of optimizing the "Imported DLLs" part, I can never get it below 13 MB, I'm fairly sure that it's the actual engine code, but even removing internal packages such as AI or Video doesn't change this value at all. Do you happen to know how to reduce this value even further? Are there also tips on how to optimize RAM usage?
@GameDevLuuk
@GameDevLuuk 4 жыл бұрын
Hi Rafael, thanks for your questions. Optimizing is a very broad topic with lots of different and specific tricks for each game. From the top of my head an empty Unity project is about 6MB in total. My guess would be is that you are using certain packages. RAM usage would be your textures, models, sprites you use. You can check de Frame Debugger to get a step by step overview of exactly what is being sent to the RAM and how costly it is. Consider static batching, dynamic batching, light baking, texture atlases. Luuk
@crystalape2195
@crystalape2195 2 жыл бұрын
great video, have you figured this out for 3d as well?
@GameDevLuuk
@GameDevLuuk 2 жыл бұрын
The principles work for 3D too. Models are actually very small in terms of file size. The textures though are not, you can optimize them with the same techniques shown in the video.
@nitinthewanderer
@nitinthewanderer Жыл бұрын
How can we optimise it without diminishing the quality?
@SkorpionYassine
@SkorpionYassine Жыл бұрын
Lower it just enough
@bashirmia599
@bashirmia599 4 жыл бұрын
How to reduce the include DLL file size. You skip this option
@yuguojiang9408
@yuguojiang9408 Жыл бұрын
Hello, can this optimization be used only on Ui, can it be used on model mapping?
@maabed1022
@maabed1022 4 жыл бұрын
Hey Luuk, thanks a lot for the tips! I hear a dutch accent :D I may be wrong. You've made a wonderful game, congrats! Have you considered launching on other platforms? I'd like to get the game to support you and because the game seems fun, but I don't own a switch.
@GameDevLuuk
@GameDevLuuk 4 жыл бұрын
Haha still working on the accent :D Right now it is only available on the Switch. Thanks for interest though!
@twibby6625
@twibby6625 4 жыл бұрын
New Brackeys here ? ;p Thanks for this very interesting video (and thanks to all guys that comment with some more details and tips)
@李洋-b6b
@李洋-b6b 2 жыл бұрын
Mipmap will occupy memory, webgl lack of memory,Is this ok?
@vmmi8215
@vmmi8215 3 жыл бұрын
This is really really cool, may i have some of your advice if i want to optimize a 3d game game instead of 2d?
@GameDevLuuk
@GameDevLuuk 3 жыл бұрын
2D or 3D doesn't matter that much, models are very cheap in general, only a few KB. So focus on the textures of your models. You can apply the same tricks on them.
@miguelayora8627
@miguelayora8627 3 жыл бұрын
The build report does not appear in my log editor, why? how can i find it?
@GameDevLuuk
@GameDevLuuk 2 жыл бұрын
It only shows up AFTER you made a build.
@sadiqabbaszade4789
@sadiqabbaszade4789 4 жыл бұрын
I had to come back to this video, because even after crucnh compressing all the textures, removing unnecessary packages, and all sorts of stuff, the build still consist mostly of included DLLs. Even DLLs in my empty project takes more space than those in your build. How can I solve this issue? I really have no idea which dlls are necessary and which arent, so i dont reall wanna manually do something without technical help
@TALLISVENOMXD
@TALLISVENOMXD 4 жыл бұрын
How can I use webgl in arc welder?
@krzysztofpaszkiewicz1274
@krzysztofpaszkiewicz1274 Жыл бұрын
The change to the power of 2 seems to have a reverse effect in my project. While I had to reduce the width of my sprites slightly I also had to increase the height (added transparency) on most of them and after the changes the project is slightly bigger. Has anyone got any ideas about this? Not a big problem though I still reduced the size of the project significantly by: * lower the quality of sounds and music. * change compression from gzip to brotli (my new server supports it, it works well) * change texture format from DXT to ASTC * strip unused code (high)
@edwardsmith535
@edwardsmith535 4 жыл бұрын
Check out Resource Checker on the asset store. It will give you a report on texture usage in your project without having to do a build. It's much faster for iteration if you don't have to do a build to get the build report. assetstore.unity.com/packages/tools/utilities/resource-checker-3224
@MartinMcDermot
@MartinMcDermot 4 жыл бұрын
amazing video,
@GameDevLuuk
@GameDevLuuk 4 жыл бұрын
thanks for the kind words!
@manuelberaha3435
@manuelberaha3435 2 жыл бұрын
Thanks for the tutorial! I packed all my sprites into a couple of Sprite Atlases (a lot of sprites and none of them POT) but my webgl build size stays the same (>70mb) and I really need to get it way down. Do I have to do anything else to let Unity know to use the sprite atlases or is it doing this automatically? Thanks!
@GameDevLuuk
@GameDevLuuk 2 жыл бұрын
Yes it will use it automatically. You can check changes in build size in the build report as shown in the video. Perhaps your sprite packer settings are not correct? Good luck!
@manuelberaha3435
@manuelberaha3435 2 жыл бұрын
@@GameDevLuuk Sry I think I got confused and it seems that my audio files are the problem. Thank you very much! Subscribed :)
@digitalsketchguy
@digitalsketchguy 4 жыл бұрын
Great tips thanks. But i still don't know how those guys optimized those vast watercolor textures for their game Gris.
@BrammudaDepeSekali
@BrammudaDepeSekali 3 жыл бұрын
awesome !
@What-a-save
@What-a-save Жыл бұрын
im using only UI elements IDK why even im using unity
@SkorpionYassine
@SkorpionYassine Жыл бұрын
Unity can be very versatile ;)
@Pub_Squash
@Pub_Squash 4 жыл бұрын
Do you have any tips for player setting optimisation?
@GameDevLuuk
@GameDevLuuk 4 жыл бұрын
Hey :) This is a very general question, I don't much with player settings optimization. One thing is setting the Exceptions to none, this should make the build a little bit smaller. Apart from that I don't do much in the player settings. Good luck!
@shihmeng91
@shihmeng91 4 жыл бұрын
Your video really help me project file size. Many thanks to you. @GameDevLuuk. If possible could you cover the topic of WebGL build with compression format of "Gzip" or "Brotli" how to get it work after unity 2020.1? It does not seem working for me, and it does not sound like a bug, and require do more manual setting(script) to get it works.
@GameDevLuuk
@GameDevLuuk 3 жыл бұрын
hi Isaac, thanks for the kind words and glad they helped you in your game dev journey! I am afraid I didn't touch upon WebGL in Unity 2020 yet. Hope it is solved by now
@sadiqabbaszade4789
@sadiqabbaszade4789 4 жыл бұрын
So unity automatically adds sprite atlas into the build instead of separate sprites?
@GameDevLuuk
@GameDevLuuk 4 жыл бұрын
Yes fully automatic 👍
@sadiqabbaszade4789
@sadiqabbaszade4789 4 жыл бұрын
@@GameDevLuuk cool. Thanks for the amazing video tutorial
@coderserabutan
@coderserabutan 4 жыл бұрын
very helpful
@apnadekhtu
@apnadekhtu 4 жыл бұрын
one question please is webgl and HTML5 are same? how can i get HTML5 game off unity??
@GameDevLuuk
@GameDevLuuk 3 жыл бұрын
Sorry for this super late reply. WebGL and HTML5 are not the same but both run in a browser. It is currently not possible to make HTML5 games in Unity. You will have to use Unity WebGL for this.
@mickmickymick6927
@mickmickymick6927 3 жыл бұрын
DLLs are 50% of my build, 13MB. Anyone know how to optimise them?
@ManojChauhan-kl3dh
@ManojChauhan-kl3dh 4 жыл бұрын
nice tut sir but also make tutorial for Unreal engine 4 ,How to optimize your Unreal engine 4 for WebGL : from 230MB to 3.7MB
@Koaalla
@Koaalla 3 жыл бұрын
Спасибо. Очень полезно
@Alex-op2kc
@Alex-op2kc 2 жыл бұрын
Nice
@georgejegiazarjan
@georgejegiazarjan 4 ай бұрын
cool
@David-gu8hv
@David-gu8hv 2 жыл бұрын
Unity's sprite atlas system? What!!
@GameDevLuuk
@GameDevLuuk 2 жыл бұрын
SpriteAtlas, the new Sprite Packer, Find it here: docs.unity3d.com/Manual/class-SpriteAtlas.html
@David-gu8hv
@David-gu8hv 2 жыл бұрын
@@GameDevLuuk Is it true that it doesn't work for 3D?
@richardbennett5022
@richardbennett5022 2 жыл бұрын
Its megabytes...
@goldenpiece7087
@goldenpiece7087 3 жыл бұрын
+1 like from me
@violentgamer5910
@violentgamer5910 3 жыл бұрын
{ [ [SUBSCRIBED] ] }
@asandax6
@asandax6 4 жыл бұрын
"Ha Ha Ha you only have 200 subs". I am laughing at you because I find that when people laugh at you, one tends to be more successful so I hope that 200 subs turns to 200K soon and than to 2 million and beyond.
@SlothHuntOnYou
@SlothHuntOnYou 7 ай бұрын
what about sounds? .s3m .xm .it .mod = are not playble in webGL=((( it's huge problem=(
@attenurmi936
@attenurmi936 10 ай бұрын
Super nice tips! Thank you!
@vrfxrealtime
@vrfxrealtime 4 ай бұрын
very helpful thanks for sharing!
Unity Performance Tips: Draw Calls
4:24
Lofi Dev
Рет қаралды 201 М.
Непосредственно Каха: сумка
0:53
К-Media
Рет қаралды 12 МЛН
The Art of Game Optimization
10:18
Worlds In Motion
Рет қаралды 283 М.
OPTIMIZE your Unity game using these performance tips | Tutorial
11:20
Sasquatch B Studios
Рет қаралды 24 М.
Unity Code Optimization - Do you know them all?
15:49
Tarodev
Рет қаралды 200 М.
Top 10 Tips To Optimize Your Mobile Game - Unity 3D
8:06
CG Dealers
Рет қаралды 42 М.
How to Send Data to Unity WebGL from Javascript or PHP
10:08
Code Monkey
Рет қаралды 59 М.
A new way to generate worlds (stitched WFC)
10:51
Watt
Рет қаралды 549 М.
Optimization for web, XR & mobile games in Unity 6
40:47
Непосредственно Каха: сумка
0:53
К-Media
Рет қаралды 12 МЛН