How to Improve a Games Performance to ‘Perfection’ | 10 Tips | Unity3D

preview_player
Показать описание


Useful Links:

---------------------------------------------------------------------------
🌼My Setup (affiliate links)🌼:

0:00 - Intro
01:27 - 1: Profiler
02:31 - 2: Camera Renders
04:29 -3: Use Layers
05:29 - 4: Optimise Your Models
08:15 - 5: Draw Call Batching
10:43 - 6: Occlusion Culling
14:00 - 7: Light Baking / Lightmaps
16:27 - 8: Optimise Your Code
22:25 - 9: Optimise GameObject Components
25:27 - 10: Quality Settings
26:40 - There Will Be Bugs
28:35 - Outro
30:17 - Patreon ShoutOut

Music:

Рекомендации по теме
Комментарии
Автор

Learn from my mistakes in this post mortem of my first Unity game, Perfection, and learn tips to improve your own games performance!

yagmanx
Автор

If you want your GameObjects to be visible without being public, you can put [SerializeField] before. It will be visible in the inspector but still private.

keftarkbarin
Автор

I'm maybe a bit late on this video but one thing that helped me a lot when i started, was learning about Object Pooling.
Basically if you have certain objects that have to appear and then disappear frequently (like enemies for example that appear when spawning and disappear when dying), instead creating and destroying the object simply activate it and deactivate it.
Usually i have a script that manages a certain amount of objects that are deactivated on the start of the game and when i need one or multiples of it, I ask the ObjectPoolManager for those objects, set them active, set up any components they might need, initialize their starting parameters and send them on their way. And if they have to disappear, just deactivate them because the ObjectPoolManager has a reference to them and can easily find them for future activation.

BerndXYCV
Автор

Very informative! With a background in 3D I was shocked at the number of polys on the plant. But if you don’t have a background in 3D it’s not very shocking I guess. Glad to see the improvements worked!

AcrylicPixel
Автор

Currently embarking on my third attempt for making a game in unity - your channel is a life saver! I had no idea you could use layers for 3D elements!

johnmccarrick
Автор

This is so extremely helpful! When I'm watching other devlogs they always get to a point where they simply "optimize", but they never explain what there doing! This is an extremely useful checklist to go through for all your games and I definitely plan to integrate this into my workflow! Thanks again for the great video!

patricktalksalot
Автор

Hey there, just an extra tip.
I see a lot of professional games using different meshes for an object visual aspect and its collisions.
Making a simpler more lightweight mesh for an object's collisions could help you optimize the game a bit while keeping mesh colliders.

Krk_
Автор

I don't know what I'm doing when it comes to programming(and anything else) but this video was sooo good. You've structured and inform everything in a super easy a digest way. You go sister!

paliing
Автор

i followed you back when i was into programming and trying to make games. i switched back to what i have been doing for almost 2 decades which is art and making art, possibly for games. but i am alot happier. there are people who should create the code and there are people who like concepts only and not the technical and admirably complicated part of the game making process. seeing this makes it look even more layered than i had remembered. still love games though and happy to see what you are working on.

my life was so much worse when i first started watching your videos. its gotten better but i am a ways off from my artistic goals. keep uploading videos especially upcoming projects related, its always cool to see.

EckosamaGhostTsushima
Автор

Helped me a lot! Especially the part where you mentioned that every single mesh in your game was a separate mesh despite them being exactly the same. I went through the many buildings in my game and noticed that every single one had a separate mesh (something dumb that probuilder did), so I made all of them into a single mesh and it helped an unholy ton with the performance!

ImScorpy
Автор

Great video! I know it’s been a lot of work to get it to this level of performance, and I commend you for your hard work and dedication. It’s not easy to go back to an old project and work on it again after many months/years have gone by, so amazing work!

I work as an engine programmer myself and, as you can imagine, performance matters a lot to me. So for me it was really nice to see a video like this and I hope you continue your journey into optimizations and performance.

If you’re interested, one of the things you can look into is Data-Oriented Design. It’s a pretty interesting topic (at least to me😅) that approaches performance in terms of hardware characteristics and how memory works under the hood. I know Unity has an implementation of an ECS nowadays (which uses Data-Oriented Design principles behind the scenes). I don’t know how good or practical the implementation is, because I’ve never used it myself, but I believe they’ve really focussed on it heavily in recent years. So that might also be an interesting area to explore in the future.

manzdeh
Автор

As for LOD'ing, I find it better to have the high quality / mid quality / absolute low quality. Mid quality should be the default, high should only be shown in either cutscenes or when very close to the model, so make sure your decimated models are in the 'mid' quality to make it the default. Low quality should be barely there, just to indicate that something's there.
The best way to verify LODs is by switching to wireframe mode (or use wireframe selection) and move the camera backwards until the wireframe becomes a solid color, then you can switch to a lower LOD.

I've seen asset store models that use like 5 LODs which is doing its job to optimize, but not as good as it COULD be, by having that many different models compared to all the vertices rendered at real time, the 2nd and 4th LODs will barely make any difference, but just add heap to memory, which as I said, still optimizes, but it nerfs the potential result.

TheDrsalvation
Автор

The way you are decimating the models is perfect for LOD! I would highly suggest checking it out if you haven't already.

alexdacat
Автор

8:56 this is really Important for 3D Artists
this was exactly the reason why my first game couldn't get higher than 20 fps
I build my whole level in MAYA because my teacher never told me there is something called draw calls and the general workflow of 3D Assets / props for Game Engines

My 3D models where optimized af and I didn't understand why my ~1000 poly assets killed the performance. No one told me the workflow that you usually only export the .fbx, then create a prefab / blueprint in Unity and not drawing every mesh multiple times into the scene and instead reuse them. Also a big problem was the materials. Materials are probably the main reason your fps drop like sh*t. Using multiple materials for example on a chair and not using base materials that can be drawn on many different assets for stuff like wood, metal etc. killed my performance.
Before I knew there was something called color IDs I created a material for every single thing that had a slightly different color. And with over 200 Materials (2048px) I know now why I had 20 fps..
anyways

I didnt understood why my relativ small scene had such bad performance but after hearing about drawcalls, materials optimization and a work of 20h we finally got a good performance ^^

sassuskrassus
Автор

Ok, I've watched this video for about 1-2 seconds and already.... clicked Like and subscribed! Thank you for instant atmosphere of joy and positivity.

Nazgul
Автор

Great video 🧡. I have one tip for artists and one for programmers:

Here's a tip for any artist who is going to attempt to make a game - TAKE A COURSE IN PROGRAMMING! I work with and have had to optimize levels created by artists who didn't know the meaning of the word "performant". So please just take a small course in programming. It'll help you immensely.

And for all the programmers out there, here's a different tip : complex =/= good. Don't write extremely complex, hard to read code if you can achieve the same result by simpler, more basic means. Keep It Simple and Stupid - K.I.S.S


There are so many Unity store assets that are just horrible when used without thinking - both in terms of art assets, AND in terms of tools and systems. You would be surprised at the number artists who don't know what being performant means, and ALSO, you would be surprised at the number of programmers who don't know how to keep code simple and clean.

krishnansubramoni
Автор

19:36 i know its a bit late to respond but in case someone need it: the use of "find" in the "awake" will not necessarily degrade the performance of your game. it depends on what script using it. if you use "find" in a singleton, it will be fine. just don't use "find" in a script attached to dynamic game object. another thing, if possible, try to use "FindObjectOfType" instead of "Find". i use "find" in the awake method of my level scene. although its not a singleton, but i consider it safe to put it there. no one will notice additional 0.5 sec delay during the scene loading :D

emonikino
Автор

Never thought I'd fall in love through a Game dev tips video.

ketchusenfu
Автор

Holy crap this is so useful! I'll be honest that I had to pause every section and look up what you're talking about, but holy crap! I'm trying to make a low-poly action game that's as easy on computers as possible so this is insanely useful!

TimM-kzvl
Автор

I didnt even understand like half of what you said, but for some reason I watched through the whole thing. Well written!

Zoddom