Watch This Before Working on a Big Game in Unity

  Переглядів 288,291

John Leorid

John Leorid

День тому

Making huge games in unity can quickly lead to problems - hopefully this video can help you to avoid them.
Links:
CrossScene Reference / GUID Based Reference:
github.com/Unity-Technologies...
Material Property Override:
github.com/Unity-Technologies...
NavMeshComponents:
github.com/Unity-Technologies...
Video Devlog by Robert Thomson:
• ZeroTag Devlog OMEGA
Timestamps:
00:00 - Intro
00:39 - Hardware
01:13 - Lighting
02:09 - Pro Builder
03:16 - Editor Performance
04:45 - Runtime Performance
06:53 - Planning for Performance
07:59 - No Automatic Systems
09:01 - Finding Close Objects
09:57 - Physics
11:22 - Non Player Characters (NPCs)
13:05 - Memory Management
13:48 - Reuse Assets
14:35 - Coding
15:01 - Profiling
15:59 - Keep Things Simple
16:27 - Summary
17:42 - Outro
My Twitter:
/ leorid4

КОМЕНТАРІ: 797
@skyfoz_
@skyfoz_ 2 роки тому
And now i have a question, what’s a big game ?
@johnleorid
@johnleorid 2 роки тому
After uploading I realized I never specified it in the video. Basically every game where you have a big enough (or complex enough) connected game world that you have to load and unload content to achieve 60fps in the build. In my specific case it was when we had more than 3million triangles on the screen while going through the world, at about 100k GameObjects, about a map size of 2km x 1km. At that point lightmapping stopped working, occlusion culling broke, it took 70 seconds to recompile or jump into play mode and we had less than 30 fps. I profiled the game and editor for two months and tried absolutely everything to fix it. This video shows what I've found out. What works and what doesn't work. Recompile time is now about 10 seconds, jumping into play mode 5 seconds, navigating the scene camera is smooth, the game runs at ~70-80fps at 4k with an RTX 3070 and 6-Core CPU and in 2k on many systems (playtesters had no issues). And it's now scaleable, we can add levels without any slowdowns and we can collaborate without merge conflicts (the last point took another month, creating the multi-scene setup).
@skyfoz_
@skyfoz_ 2 роки тому
Thanks for answering !
@bizentino
@bizentino 2 роки тому
@@johnleorid Amazing! Thank you for sharing! :D
@TYNEPUNK
@TYNEPUNK Рік тому
@@johnleorid 3 million? my game exceeds 30 million very often lol
@johnleorid
@johnleorid Рік тому
@@TYNEPUNK *3 Million, despite occlusion culling xD
@vast634
@vast634 Рік тому
When using a game with a large open world: keep in mind the problems with float imprecision. If your camera gets away more than like 2000 units from the origin, animations can start to flicker and shake. Look up various methods of "origin shifting" to solve that problem by moving the scene dynamically closer to the origin point.
@zelddroid
@zelddroid Рік тому
Good point!
@xanderkyron
@xanderkyron Рік тому
Well, origin shifting is one way to do it, aswell I know teams have just modified the engine they're using to use double-precision coords (CIG did this with CryEngine to get their space, yknow, space-y without having to deal with MMO synchronized world origin shifting, also Epic did this and UE5 natively uses double precision coordinates out of the box now), and then your distance limit becomes so ludicrous that it's barely even worth considering unless you're making a space sim in which everything must always exist in the same scene at the same time. However, with Unity, you need to pay them ridiculous sums of cash to get access to the source code in the first place to even begin on a change like this (which is absolutely insane on its own and anti-consumer as hell when every single other major engine has source out of the box), so YMMV if using this engine.
@vast634
@vast634 Рік тому
@@xanderkyron I never saw this as much of a hassle. The C# code can run just fine logic with using custom double Vectors. Custom Netcode can also use double precision. Just anything that has to do with the client visualization and local physics needs to be converted to 32bit float. But then again, the relevant scene is near the camera anyways. Things further away would be turned off or rendered in a different way (second scene camera to render a scaled down solar system, that is the backdrop when travelling for example). The world in a huge game like Star Citizen is also not just a simple scene with objects plopped in, but a more complex process to generate local scenes on the fly. So its also possible in Unity with the right approach. Of course, just compiling all those systems with using doubles would be the cleaner approach, if the engine allows that.
@BlueJeebs
@BlueJeebs Рік тому
Gaia has a floating point fix function, takes care of this auto 👍
@MarilynMonRover
@MarilynMonRover Рік тому
I noticed this while working on a scene that would move the focus of the scene to a location, which would never be reachable by conventional means, as a way to do some tutorial cutscenes without having to load an entirely new scene... my animated model was shaking like she was on a speedball drug or something. My solution was inevitably to move these constructs closer to the bottom of the terrain mesh. It didn't make any sense to me why the issue was resolved by doing this and it's still not something I completely understand but it is what it is.
@EvilRobin1
@EvilRobin1 2 роки тому
I think one of the biggest hurdles (atleast for me) working with larger projects is to say "no" to things I want to have in the game. There is usually sooo much that I want to add to the game, there is a need to mash all those idéas into doable tasks.
@johnleorid
@johnleorid 2 роки тому
While working on the event system video, I am thinking about a video about scoping and planning a game, the whole preproduction phase that a lot of devs seem to skip. (I am guilty of this too, as well as feature creep)
@tymondabrowski12
@tymondabrowski12 Рік тому
@@johnleorid that would be awesome
@alexandratrenkova9339
@alexandratrenkova9339 Рік тому
Honestly, this is a good problem to have. My boss (20 years of xp in the industry www.youtube.com/@SamuelAsherRivello) was telling me stories of some people that were excellent at coding but couldn't come up with the visual aspects of the game, which is honestly what should drive everything anyway
@smokinglife8980
@smokinglife8980 8 місяців тому
​@@alexandratrenkova9339that's me all the way lol trying to train myself to be more Creative, etc lmao
@TheGodEmperorOfMankind_
@TheGodEmperorOfMankind_ 2 роки тому
Me making a 2D tic tac toe game: "Ah yes this is relevant to me"
@INeatFreak
@INeatFreak 2 роки тому
This is quality content. Well done. It's so hard to find topics about big projects with Unity. I hope you continue to share your knowledge.
@hollownxt1295
@hollownxt1295 2 роки тому
Cause Unity is trash
@jomalomal
@jomalomal 2 роки тому
@@hollownxt1295 not really lol, it's an excellent tool that has some unfortunate limitations. It's a perfectly good engine for games with smaller scopes and for beginner game devs looking to prototype things quickly.
@hollownxt1295
@hollownxt1295 2 роки тому
@@jomalomal Unreal Engine for has better and more tools and it’s free…
@Finlzz
@Finlzz Рік тому
@@hollownxt1295 Epic take 30% of your revenue
@hollownxt1295
@hollownxt1295 Рік тому
@@Finlzz and? With Unity you’re not getting any
@marceldoe9684
@marceldoe9684 2 роки тому
This is very good content. I would love that video on an Event system.
@johnleorid
@johnleorid 2 роки тому
Working on it ^^
@alrickdeperiers7722
@alrickdeperiers7722 2 роки тому
@@johnleorid Nice, I would love it !
@wiljagerhardt1219
@wiljagerhardt1219 2 роки тому
@@johnleorid cant wait to see it.
@TYNEPUNK
@TYNEPUNK Рік тому
yeh i dont get that event system really
@notagamedev5494
@notagamedev5494 Рік тому
++++
@guitar45rocks5
@guitar45rocks5 Рік тому
Even five minutes into the video, I could barely believe how densely packed this video is with useful information. Thank you for this great video.
@GamingwithRedPhoenix
@GamingwithRedPhoenix 2 роки тому
Heyho, Game Dev here for Unity. I do a lot of profiling, and we are using Renderdoc. Its an extremely important tool as you can link it to Unity and grab Frames to analyze. It is similar to the Frame Debugger, but much much more indepth. When we started optimizing we were constantly checking our builds, and with Renderdoc we removed about 1/3 of GPU overhead already. One important topic to mention from GPU sides are shaders, lights, shadows and texture sizes. But thats probably a whole other video as well. Great Job otherwise. Grüße
@marcoseliasmep
@marcoseliasmep 2 роки тому
Haha nice message on the end! I’m developing a bus simulator for about five years, there are a lot of things that we learn the hard way haha. I abandoned ProBuilder because some updates broke some of my models. Huge games on Unity will suffer from another problem: the lack of precision on world coordinates. After 10km or so from the origin things will get broken, shadows appear blinking, too much jitter on smaller objects etc. The most common solution is moving everything back to keep the camera near the 0,0,0 position. Unreal Engine 4 includes a setting for that, on Unity there is a great open code called “Floating Origin”. But performance may be bad if there are tons of rigidbodies. I can’t wait to test a custom compiled version of Unreal Engine 5 with 64-bit coordinates. But I’m procrastinating on that.
@johnleorid
@johnleorid 2 роки тому
True, floating point precision is indeed a problem for games with a big world map. After I uploaded the video, I realized that I never specified what I meant with "Big Games". xD But I guess most of what I said applies to a lot of ambitious games. ^^
@saul8510
@saul8510 2 роки тому
Wait unity doesn’t have double precision support? REALLY?!
@marcoseliasmep
@marcoseliasmep 2 роки тому
@@saul8510 as a data type it has the double variable. But not for transforms positions, rotations and scale… Every huge map must have its own workaround to “fix” it.
@FirstnameLastname-my7bz
@FirstnameLastname-my7bz 2 роки тому
@@johnleorid are you working in big company? Btw, how to start? What to learn first to be able navigating intuitively In all of this?
@johnleorid
@johnleorid Рік тому
@@FirstnameLastname-my7bz I'm working at a company. Not small, not big, just a company. XD I would suggest looking for "unity beginner tutorials" and you should definitely start small. My first game was ~12 grey cubes and a horribly animated character to jump from one cube to the next one.
@KAP01able
@KAP01able 2 роки тому
Really good video. I don't use Unity as a dev platform. However, 90% of this information applies to 100% of the game engines out there. Way back in the 'day', I developed everything on an unnamed open source game engine. I made some pretty good (at the time) content packs and add-ons. My customers could create some good visual stuff. However, I did not take into account all the other systems needed to make a fun game, running at 60 FPS. Most of the information mentioned here, is something that needs to be kept in mind when building a game. Unity Engine or not. It is VERY difficult to keep the 'overall' cpu, gpu, ram and performance budget in mind. Overall, this video should be a 'basic' guide to help optimize game builds.
@aliatef7203
@aliatef7203 2 роки тому
would love to know more about this, what would you consider a more advanced guide to optimization?
@KAP01able
@KAP01able 2 роки тому
@@aliatef7203 Thanks for the question. I am NOT a Unity developer but, I have a video example from the original 'Doom' that points out just how a basic AI works (ukposts.info/have/v-deo/p6dyrJCHfG-SkXk.html). Now, this is a 'basic' AI routine from one of my favorite early games. Think about how many times the CPU is checked just during these processes. Now, add in all the modern AI complexities. You can see how just the graphics and AI can cause stuttering and other issues just because we did not take into consideration the overall game view. Then there are other videos and such that explain UI/player feedback, Collision detection (both player, NPC and Enemies. Then you have the animations and a host of logic issues within the game environment. Now, think about pulling all of this off within a few compute cycles. Think of everything your console or computer has to process 'between' rendered frames. This is why there are 'bad ports'. This is why beta and alpha testing is super important. You need to examine how different people approach a level or encounter. You need good notes and issues documented. This info will allow you to 'fix' issues/approaches that you 'the developer' might not have thought of. The key to making a 'solid game' is hidden within making all of these systems work in a logical and unified way. I can make the best damn environment in the history of the world. However, if I (the environment guy) take up all the system resources to place pretty pictures in a player's face, where does the AI, UI, Collision Detection for all the entities, 'score calculation' and a host of other processes, exist? A good reference for this issue would be the game "Anthem". Visually stunning game, at the sacrifice to game play. This was likely an issue with 'uber graphics' and a lack of game play space reserved within the hardware limits.... Just my opinion but, I think if they scaled back the visual crap, it would have left room for more complex and interesting gameplay. Hope that explains things a little bit. A grand 'balance' is what is needed in any game. Look good, play well and accomplish all the entertainment aspects without a complete sacrifice of any aspect of the development. As you can see, just based on this simple example, there is HUGE potential for tutorials concerning game dev optimization. I do not have 'all the answers'. I would never claim that. I just want to point out that there is something to be said about showing all the different aspects of game dev. However, I think the smart developer will need to be able to find the compromises needed within all of these systems in order to make a smooth playing and interesting game overall.
@johnleorid
@johnleorid 2 роки тому
I agree with most of what you've said but I don't think a lack of gameplay in e.g. Anthem is because of hardware limitiations (better writing and more interesting puzzles as well as a more fleshed out skill tree and less micro-transactions) but a lack of manpower. If 75% of your team is focused on making pretty environments, writing shaders and optimizing the content loading, then you have no one left who designs interesting quests or provides the tools to make cool quests possible. And changes. Changes have destroyed Cyberpunk 2077, probably Fallout 76, Hawken and a lot of other games. Another big topic. ^^
@SioxerNikita
@SioxerNikita Рік тому
​@@johnleorid Wow, someone who sees a level of nuance in the game development world XD I've even met game developers that don't have that. It's in the end all about resource allocation, focus, etc. Frankly a generic game should probably be about 25% coding, 25% art/sound and 25% game design, 25% world (lore, etc). Doesn't matter if you have the prettiest or best coded game in the world if the sound/art design is fucking terrible and the overall game design is horrific, or if the lore is terrible. But these percentages is OBVIOUSLY dependent on the individual project. An artsy game like Braid is probably like 10% coding, 30% art, 40% game design and 20% world. But yeah, Frostbite (I think it was) for Anthem was NOT designed for the open world which was demanded of them, and they essentially had to spend WAY too much time on fixing that stuff up.
@guiltyshoes
@guiltyshoes Рік тому
Well, Unity is infamous for being able to make simple things very hard. Not to mention editor performance. Devs clearly did not had in mind open world games when developing engine.
@lorenzoconsoli1916
@lorenzoconsoli1916 Рік тому
This video is amazing. On UKposts the most of the videos about Unity are good enough for beginners or intermediate, but there aren't too many videos about these complex topics. I think that if you could create some videos about coding a big game it should be fantastic! Thanks again for the video
@fawazaljohani8447
@fawazaljohani8447 2 роки тому
this is really good content, this type of information is kind of hard to find when you encounter an issue related to them, so it's really beneficial to know them before you encounter these issues, just having the knowledge that a solution exists for a certain problem will save a lot of time when you encounter them. game devs really need someone like you, keep it up I think your the next Brackeys
@SkeleTonHammer
@SkeleTonHammer 2 роки тому
I guess it goes without saying, but if you want to make a big complicated game, you need to be knowledgeable about game development, intelligent, and experienced. Too many inexperienced developers have big dreams of making big games that will be the next [insert open world game here]. I'm 36 now, and I've been doing this since I was about... 15. At this point in my life, I'm more than just a "jack of all trades, master of none," I know most aspects of game development on a deep level. I'm a jack of all trades and master of many of those trades. When I set out to make a big complicated game, the planning phase is monumentally important. I need to plan what the game looks like structurally before I place a single cube down in Unity. I need to have an idea of what the data will be structured like, I need to figure out if I'm going to use virtual texturing, HDRP, URP, how I'm going to pack my textures, what kind of audio fidelity is needed, what the art style needs to be to suit my aesthetic and performance desires, decide how modern the game will be and how that will affect how many people will be able to run it (will I be making a game with baked lighting? Am I making a very modern game that uses no baked lighting and uses ray tracing features exclusively? Is there a level of dynamism in the game that it even warrants real time lighting?)... There's a lot to consider, and if you're only a couple years into game development you might not even be aware of what questions to ask and what to consider, let alone how to consider it. As far as optimization, in my experience I've come to realize that rather than "don't optimize until you need to," time and experience will teach you what optimizations can be done in all kinds of situations, and you should carry those optimizations into EVERY project you do. Because if you optimize (and PLANNED!) your game all along, you won't have to after it's done which can lead to soul-crushing code refactors and bugs on the tail end of your development.
@ikobi4807
@ikobi4807 2 роки тому
Not sure if you're aware of the full quote because of the way you used it sounded quite condescending, at least that's how I interpreted it. Here is the full quote though “A jack of all trades is a master of none, but oftentimes better than a master of one." I hope if you were unaware before you'll now be able to enlighten any ignorant person that tries to use that quote as an insult. Cheers!
@koyima
@koyima 2 роки тому
I am 37, literally have been at this as long as you have. I am a 3D artist that now teaches coding at the university level. I completely agree
@virtualmecha
@virtualmecha 2 роки тому
@@ikobi4807 More like delusional air blower XD
@jamegumb7298
@jamegumb7298 2 роки тому
I once tried using pure raytracing in a game using ships made of components made 100% in OpenSCAD for a simple (well okay not really) Eve clone prototype, but with Nexus: TJI ship combat, with each ship having their own 100% virtual machine to run the ship. Not for the weak of cpu, but size was tiny for what I had. Even if cpu was no issue, it did not run very well and looked way too Fortnite, but the idea was solid. Too much work though.
@SioxerNikita
@SioxerNikita Рік тому
32 here, and I frankly disagree. I am a hobby programmer at best, doing the starts of an MMO here. Knowledgeable about game development, sure. Intelligent, sure... Experienced? Nope... but it helps. But all you really need is basic knowledge, know that you have to optimize, etc. and search up the rest. A plan? Not really. You do need to know an overall goal you want to work towards, but even with huge games, you can still take it step by step. It just needs more prework than most other projects. EDIT: Oh yeah, by pre-work, I more mean the optimization, step by step keeping the game together and not just solve problems at "some point".
@xiaotan85
@xiaotan85 2 роки тому
Thanks for this content! There is a lot of content about making demos and for beginners of Unity, but really lack content like yours about how to build complex systems and larger project! Subscribed!
@gotbaka3
@gotbaka3 2 роки тому
I would greatly appreciate another video on the event system you mentioned and a more in-depth look at organizing code for a complex game like that. Excellent video btw.
@dreamisover9813
@dreamisover9813 2 роки тому
Interesting topic, good to see more videos about it. I think there are more aspects to it, but these are def. some important ones. The part about the navmesh volumes was awesome, I didn't know about that! There is something for GPU/shader analysing too, the Frame Debugger, where you can step through separate draw calls and such.
@johnleorid
@johnleorid 2 роки тому
The frame debugger really helps when you know what you are doing. Back when we had GPU performance problems and I had basically no idea about batching, instanced rendering and draw calls and so on, it wasn't a helpful tool for me. But you are right, I sould've mentioned it.
@tablettablet4792
@tablettablet4792 2 роки тому
@@johnleorid hello there im just started to learn and bought gaia pro 2021 that has an option for multi tile terrain streaming but im not a coder but wanne be an artist do you have some tips. Like how to load and unload like building or vegetations only on the terrain tile where the player is at the moment how does that work whithout coding is that possible . And should i do when making the things like you said in your video to only stream load and unload where the player is like vegetation or buildings. I know that with npc s and crowd you can spaan them in when enter a region by triggers but what about buildings props vegetation etc is that possible
@c0d3_m0nk3y
@c0d3_m0nk3y 2 роки тому
The Unity Frame Debugger isn't very good. Use RenderDoc (or Pix or Nsight) instead. Right-click the game tab to get a button for taking a RenderDoc capture.
@hamzafayyaz8616
@hamzafayyaz8616 Рік тому
@@johnleorid can i have a video or some informative links about these topics (batching and stuff) too. Would really like that
@facepalmedev
@facepalmedev 2 роки тому
Some real helpful things to consider here, even though I personally don't intend to make a "big" project and instead focus on smaller contained maps myself, keeping all these things in mind is still important and good practice. Will subscribe and look out for more helpful vids from you. :D
@shyamarama
@shyamarama 2 роки тому
This is an amazing video - thanks! Would be interesting to see you go into more details on some of the techniques you mention, like the events system. These optimization videos are great 👍
@MohanABK
@MohanABK Рік тому
Videos like these are legendary and must saves. This talks about many things you don't often hear about in 99% Game Dev videos. And it was purely knowledge, and no bull shit.
@stylie473joker5
@stylie473joker5 2 роки тому
That's why its best to use mixed lighting (baked on some areas & realtime on others)
@Chris-lw5po
@Chris-lw5po 2 роки тому
One of my first unity projects was in URP and one of the first issues I ran into was placing more than 8 real-time point lights and they’d disable themselves kuz only 8 can be loaded at a time- that pushed me to learn about baked lighting and light probes. So fucking worth
@Ryanflees
@Ryanflees 2 роки тому
mixed lighting means one light illumination works for baked lightmaps for static objects, realtime lighting for dynamic objects, and realtime shadows for all ( or shadowmask for static). it's no better than baked lighting workflow. The pc/console game industry has ditched lightmaps (baked and mixed light in unity) for years, So just use realtime gi workarounds.
@pikachufan3588
@pikachufan3588 Рік тому
Thank you for teaching about the material override. I had no idea that was a thing and makes things SO much better than having to create another material instance when I just need a slightly different material.
@johnleorid
@johnleorid Рік тому
In V2022.1 there are material variants which provide pretty much the same functionality - but afaik they are still assets you have to create.
@jacques-dev
@jacques-dev Рік тому
I would love to see more videos like these as well as more in-depth content on the coding and planning side of things. Event System sounds good. I'd also maybe like to see some dedicated videos on the topics you discussed here that go more in-depth.
@lucasfarias1148
@lucasfarias1148 Рік тому
Amazin video, thank you so much for working on this, it is so hard to find actual intermediate/advance topics about Unity. Loved it!
@Dominik-K
@Dominik-K 2 роки тому
Great explanation and I learned a lot from this video. Would love to see more content, e.g. the event system you mentioned
@xinoHITO
@xinoHITO 2 роки тому
Man these are such knowledge BOMBS! I'm making a small to medium-sized 3D project and a lot of what you said applies! Also you nailed that outro
@miwiarts
@miwiarts 2 роки тому
This video was such a relieving change of pace, I instantly subscribed.
@Alan-fu2vx
@Alan-fu2vx 2 роки тому
Very informative video in a concise format, great! I'd also love a video or two about Coding for a Big Game. Keep it up!
@KnucklesEmerald-wj9vo
@KnucklesEmerald-wj9vo 8 місяців тому
Thank you for the video! Would absolutely love to see more vids from you
@ViniciusNegrao_
@ViniciusNegrao_ 8 місяців тому
Finally "advanced" tips. Thank you so much, those are really helpful!
@skinnylizardstudios
@skinnylizardstudios Рік тому
This is golden information. Keep these things in mind any time when doing any FP game that has any asynchronous loading
@jcozyyt
@jcozyyt 8 місяців тому
I would really like to see a video diving more into the event manager and organizing your code. Great video, you held my attention the whole time and earned my subscription. Keep up the great work!
@mantra1229
@mantra1229 2 роки тому
Bloody brilliant content, thanks for uploading and looking forward to more insights in your future videos
@NeoCrypt01
@NeoCrypt01 Рік тому
Please make more such quality content if you get some time it is very helpful for newbies like me (learning unity currently and will join company soon) this helps alot to understand many situation and stuff.
@colincurrie7930
@colincurrie7930 5 місяців тому
Yes please! I would love to see some videos about structuring performant code for large games...particularly the usage of ECS for batching groups of scenery into subscenes and using DOTS graphics.
@BlackMantisRed
@BlackMantisRed Рік тому
Great stuff I’m helping my friend with his open world game and I have never made a large game before, glad to know there is nothing too complicated that I didn’t already know.
@ViktorFerenczi
@ViktorFerenczi Рік тому
Very useful content. Thank you and your patrons :)
@D_2_Digital
@D_2_Digital 2 роки тому
This was very informative. Thank you for the video!
@tetsu1334
@tetsu1334 Рік тому
Definitely interested in learning more about coding systems! Great video mate
@voltonik6404
@voltonik6404 2 роки тому
This is very informative, Thank you, great content!
@oloffagerstam3275
@oloffagerstam3275 2 роки тому
Amazing video, thank you so much. Subscribed in the hope that you'll put out a coding/event system video 😁
@Acdrop1
@Acdrop1 Рік тому
This was a really great video. I’ve only now started to dabble in unity. I don’t want to make a huge open world, something more sizable, but I’m a junkie for optimization and figuring out how to make things better. Really enjoyed the points you brought here, I’ve spent most of last night googling about them and learning alternatives lol😊
@Faygris
@Faygris Рік тому
This is insanely helpful! Thank you so much
@meinnameistsimon1888
@meinnameistsimon1888 Рік тому
Really nice video! Taught me some stuff I didn´t really think about.
@cryptmhg66
@cryptmhg66 11 місяців тому
This is a 10 years of experience and knowledge compressed into a single video. Would be great to see the video about code optimization!
@ZhaojuEphastine
@ZhaojuEphastine Рік тому
I think that, for baked lighting and especially in the example you were showing, that you can split your game into rooms and bake those rooms. You could also create a scene dedicated to this room just to bake stuff or cheking and verifying how everything in this room plays. You could also, I think, develop the room on its own scene so that you can navigate in your environment. I think this particular point was brought up during the Editor Performance video chapter, but I think that adding the tip that you could bake lightings per room or divisions and only rely on realtime lightings on light sources that could span in multiple rooms or object groups. I find the optimising part of a game as interesting as it is crucial. My current computer was made in 2014 and was an average gaming build at the time (meaning a good machine in the broader PC configs) but it's starting to feel less and less powerful for more recent games... especially with indie games. It may seem weird that indie games are harder on the hardware than AA or AAA games. But I think that's even more logical. Big game studios theoretically have more budget to optimise. While indie studios aren't even aware of the performance issues, or do not care enough. I have a will to make my games more accessible to more modest PC configurations, so optimisation is a very important topic to me. My computer can still handle gamedev because of the "extra mile" my friend invested into the CPU at the time. To be honest, when I am downloading the one map demo of an indie game that in itself weighs 12+ GB, I internally suffer. One, because even if my download speed is good, I think that there are still many many gamers that have a less powerful bandwidth. Two, because I know that, even in lower graphic settings, it will most likely have performance issues and few optimisations to offer. It's a general feeling I have and it may be exagerated, but I feel like most of those indie demos would really deserve more optimisations.
@igorgiuseppe1862
@igorgiuseppe1862 2 роки тому
walls arround cities is good for 2 reasons. 1)you dont have to render the city if you are distant from it, as you said. 2)you dont have to render everything outside the city if you are inside it.
@Spartan322
@Spartan322 2 роки тому
Not to mention that any game with a civilization that's often at war, has massive internal conflicts, or is pre-modern era in style would realistically have walls for towns, villages, and cities anyway.
@cryora
@cryora 2 роки тому
overworlds lol
@robertmalzan6724
@robertmalzan6724 Рік тому
Great advice! I'd love to get a more in-depth discussion about a central communication hub as suggested in your video.
@000Gua000
@000Gua000 Рік тому
One of the best Unity videos I saw. Unfortinaly I had to learn some of those lessons the hard way, cause this topic isn't covered enough.
@mercuryhg7150
@mercuryhg7150 Рік тому
Very pog content, I actually took notes for the first time lol, the video about coding for complex games would be great!
@sacb0y
@sacb0y Рік тому
I'd also recommend looking into texture compression like crunch compression, especially for things like roughness/metalic maps (where you can also reduce the resolution) where the compression is less visible, or masks for special shaders. But generally crunch compression for everything but hero objects won't have an obvious visual reduction. And as a result can take a 10GB game down to like 1GB. Also with URP and HDRP it's ideal to have as few shaders as possible.
@Bloodthirst
@Bloodthirst 2 роки тому
Good tips , other things i would add are things like : -caching , if you can cache somthing then fking do it , and if you can reuse an item then do it , i've seen a lot of codebases that had stuff (especially in ui code ) like "if something changed then destroy all UIs/objects and rebuild from scratch" , don't be lazy , react to changes accordingly instead of "rePaInT aLL" on every slight change -speaking of UI , only make interactable the things that matter and disable "raycast target" and "maskable" on eveything by default , i actually made an editor script that does that automatically. -if you can bake or precalculate something in editor or a loading screen then do it, try to take as much work off the game during runtime. -if you are running into a bottleneck with stuff executed in update , try to avoid branching by using a jump table or reformatting the data in a way where you can put it i an array and index into it directly. -if you can express logic with an array lookup , do it - the more generic a solution , the more you account for stuff that you probably wont run into and will just be useless overhead , try to make your solutions as domain specific as possible - if there's a task you can automate or make an editor for then do it , your futur self will help you. -unity can be a really dumb engine that would rather give you a straight forward solution/answer but keep the performance overhead/consequences hidden , do the extra digging .pooling I can keep typing on and on but i am too tired rn , hope this helps tho
@r1pfake521
@r1pfake521 2 роки тому
Good points, about the UI point, there is actually a way to change the default values of Unity components, so you could disable raycast target and maskable by default, without a custom script. Im at work so I can't open Unity right now, but the option is hidden somewhere in the player settings menu
@Bloodthirst
@Bloodthirst 2 роки тому
@@r1pfake521 oh yeah I know that one, in my case I needed a script since i did extra checks like checking if i had a parent that had a mask component before toggling maskable on , or whenever i create a button the script automatically unticks all raycast targets on children and adds a single "collider" image under it called "Interactable" that recieve the ui callbacks
@yashmalhotra9202
@yashmalhotra9202 10 місяців тому
thank you for the video, soo much info in a single video.....When will the code architecture video is coming out ?
@thatguy9668
@thatguy9668 10 місяців тому
Simple, accurate, appreciated. Thank you.
@ericO141
@ericO141 2 роки тому
Really amazing video, I saved this to rewatch now and then. In my personal opinion, the lightmapper is soooooo time consuming. I've tried so much times to use it, and kinda get to know how to make it work, but honestly it's waay more easier to simply use realtime lighting, and it looks pretty similar. I guess it can be used only in level based games, like portal for example
@williamabousharaf8980
@williamabousharaf8980 Рік тому
Very very informative video, I would love to see what you got more
@xXxIMMORTALxXx
@xXxIMMORTALxXx Рік тому
I saved your video for future reference. Please make more videos on large-scale game development, these are hard to find.
@Quocviet08t2ah
@Quocviet08t2ah 2 роки тому
Subscribed for this video, well done!❤
@DarkSwordsman
@DarkSwordsman Рік тому
I have very little experience with game development, but I do have some experience with other things such as web programming, and always have had an interest in complex systems and understanding game performance. This was a very interesting video even though I don't really plan to make any sort of big game. It is very cool to learn that a lot of techniques are quite manual and rely on the developer to manually write them for the game. This is also reassuring and great to hear in case I do make my own games or even content for other games like VRChat which use Unity. I always have wanted to dig through a performance profiler of many of the games I play to find possible performance improvements. Great video!
@garathiel84
@garathiel84 Рік тому
You made my day ... started to use an event system to pass paramaters from scene A to Scene B ... but giving a Unique ID its a way cleaner option!
@Vashen2
@Vashen2 Рік тому
Awesome video with fantastic information. Thank you so much for making this ❤️
@csthll
@csthll Рік тому
This was really helpful, thank you a lot! I would really appreciate the "coding big games" video in the future.
@AtelierSenna
@AtelierSenna 2 роки тому
Great vid, thanks for making it, learned a bunch. I think it'd be neat to see vids on the code/architecture side if you wanna make those.
@johnleorid
@johnleorid Рік тому
Still working on it. The coding video will be a bit longer, so it will take more time to make it. ^^
@Skye-Games
@Skye-Games 9 місяців тому
Great video! I'd love to see a video on Big Game Coding systems
@albinauric7992
@albinauric7992 Рік тому
Great video, you earned my sub :) I would love to see the video on Even System. Can’t wait xD
@Natefurry
@Natefurry 2 роки тому
Use the frame debugger to help with figuring out what is using a lot of draw calls. It would be your best bet for a gpu profiler that comes with unity itself.
@nannnyy9390
@nannnyy9390 2 роки тому
What a great quality and informative video. This is coming from a beginner developer. Could you make a more detailed video on how to code a big game?
@MegamanXGold
@MegamanXGold Рік тому
Great video! +1 for Event Systems. There can never be enough videos about single-responsibility and modularity in development. Please talk about how powerful event systems can work in different game types and how interdependencies can cause nightmares.
@dgnhrd_74
@dgnhrd_74 6 місяців тому
Thx alot for this deep dive - i would appreciate a tutorial about code best practices like the event system
@almicc
@almicc Рік тому
video was really great but it was totally overshadowed by the genius of the outro, keep it up
@Madve27
@Madve27 2 роки тому
Thanks for the insights! Outro made me instantly like&sub. :)
@epsilon_lt_0
@epsilon_lt_0 Рік тому
Very interesting video. I'm not into unity and I surely never will, but I think that the overall concepts you've outlined here are also applicable to other engines like Unreal. Thank you!
@rocketshader2699
@rocketshader2699 Рік тому
Amazing informative video. We'd like more info about this subject. Big open world games, RPG systems, stream loading, big terrains, scene loading etc. Thanks!
@Sogeshing
@Sogeshing Рік тому
This is gold! Please keep doing these kind of REX, it's priceless. Did you do a video on the coding part at the end?
@johnleorid
@johnleorid Рік тому
Was collecting footage, writing code, doing a lot of research and working on Games (also for the video) in the last weeks and started actually working on the video (in the videocutting software) within the last week. You can ring the bell to get a notification when it's ready and uploaded. ^^
@johnleorid
@johnleorid Рік тому
REX? ^^
@Sogeshing
@Sogeshing Рік тому
@@johnleorid my bad, experience feedback basically. I thought it was an international term (I'm french).
@Sogeshing
@Sogeshing Рік тому
@@johnleorid notification activated!
@johnleorid
@johnleorid Рік тому
@@Sogeshing ah thanks for the follow-up :)
@evgenkonyshock4913
@evgenkonyshock4913 Рік тому
Golden video. Share more experience on loading/unloading regions of big world please
@MichoSchmidt
@MichoSchmidt Рік тому
Great video John!
@vladm2772
@vladm2772 2 роки тому
Good video! These concepts are crucial for any game developer not only Unity devs. Unity is "good" enough for bad games and if more people like you will teach others this low levels stuff. Then we all, as gamers will benefit from it as well as the Unity's reputation xD. Keep it up!
@ebolei
@ebolei 2 місяці тому
occlusion culling and static batching saved my game. Occlusion has a lot of hiccups but I'm glad I figured it out.
@CarlitologyTV
@CarlitologyTV Рік тому
Good video, great points. For my first game I decided to go as big and ambitious as possible. Five years later and I've learned soo much but... still no game lol. I still feel like its just within reach and Unity has come such a long way. Anyways, I find that packaging game areas and sub areas into prefabs and instantiating them at runtime OnCollisionEnter has been the fastest way to build massive levels that run great. AI and Rigidbodies are another issue though. I also decided to include physical objects that can be moved around and put on vehicles, etc. Interesting problems to solve for sure.
@Stenierfromwow
@Stenierfromwow Рік тому
Thats some top tier video. Straight to the point. I will pray youtube algorithms for you my friend. Thanks a lot for great video
@bluedark7724
@bluedark7724 Рік тому
That's Amazing information! I'll be rewatching this several times. Interesting that Occusion culling is not effective in large scenes
@joshuaanderson6609
@joshuaanderson6609 Рік тому
This is a great video on this topic, and a lot of it applies to other game engines as well!
@voronoistudios
@voronoistudios Рік тому
Thank you, helped a lot!
@vaibhavjaiswal799
@vaibhavjaiswal799 Рік тому
Really want to know more about this Like the better code writing you talked earlier and how to optimise large open world environments with lights and other stuffs
@vaibhavjaiswal799
@vaibhavjaiswal799 Рік тому
That's really awsome, no one ever talk about large games, I literally learn many things and realize i was wrong about many things
@DylanBurke
@DylanBurke Рік тому
Hey, loved this video. Thank you so much for making it! I'm super interested to hear about how you do scene management and your strategy for breaking objects into different scenes. Pretty much everything on screen starting at 3:20 Looking forward to more videos!
@DylanBurke
@DylanBurke Рік тому
So I started building a scene management system and I still have so many questions about what you have on screen here. What does the "Free" indicate in the hierarchy view? Another clip seems to suggest it's some sort of locking for VCS? Is there a reason you don't remove the scenes from the hierarchy when unloading them? How did you go about making preview images for scenes? What does the Switch/Add tab do in the Load/Unload window? I assume Add New makes a new data structure to hold a multi-scene composition, but is that assumption true? What are the scenes titled "Notes_" used for? As in, what is in them? Sorry if that's a bit much. Thank you again for this video; it's a goldmine!
@johnleorid
@johnleorid Рік тому
Free, Editing, Locked & Modified are the states of a scene, used for merge-conflict-free collaboration. States are written to a custom server and I am using git hooks to know when a user has pulled or pushed. So based on timestamps I can prevent someone from acquiring a scene that wasn't pulled and also preventing unlocking a scene that wasn't pushed. It's not perfect but with only one branch this solved all our issues.
@johnleorid
@johnleorid Рік тому
Preview images.. I just used the scene camera, writing to a render texture, which I then convert to a standard texture and this into a byte array if I remember correctly. When opening the window for the first time after recompile, I convert the (serialized) byte array back to the textures.
@johnleorid
@johnleorid Рік тому
Keeping scenes in the Hierarchy has the sole purpose of being able to right-click and load them without the editor tool. Just a backup/alternative. ^^
@johnleorid
@johnleorid Рік тому
The switch/add tab let's me jump to the main menu, debug/test scenes and it let's me quickly add the lighting and player scene. With those two scenes I have correct lighting and everything I need to play the game in any scene I want (player & UI are in the player scene. Despite not having any direct references, it's convenient to have those in the same scene)
@justusforan
@justusforan 2 роки тому
+1 for an event system, great video!
@pedrosilvalopez5157
@pedrosilvalopez5157 Рік тому
It is hard to find in youtube videos about actual production/commercial-quality projects. There is a lot of tutorial for beginners but not so much content for solving "real world" problems like these. Hoping to watch more videos like this one.
@merchantscape
@merchantscape Рік тому
Subscribed to see that event system!
@eldeivid7380
@eldeivid7380 Рік тому
Thank you for the tips!
@ultimatebluegrassplaylistc3087
@ultimatebluegrassplaylistc3087 Рік тому
Smart talk. Fascinating!
@synchaoz
@synchaoz 2 роки тому
"Writing code for a complex game" - yes please. Great video, would love to see more in-depth content from you.
@pedrobelluzzo
@pedrobelluzzo Рік тому
I work full time for a small company doing mobile games, so i got a little bit of experience, but very little when it comes to PC games. Had already figured out i would have some of those problems, but thank you for you video. I'm going to develop the game systems using a terrain with 10% of the full size, but sooner or later, i'll have to upgrade my PC to continue. (btw, i'm using Polaris, which seems to be better than Unity's built in terrain)
@Ryanflees
@Ryanflees 2 роки тому
Just a quick tip. If you don't have the following solutions or workflows. don't make a large level, not even a medium level (depends on the vertices and drawcalls overall) 1, level streaming 2, dynamic occlusion culling
@benvella1728
@benvella1728 Рік тому
Very good tip, make small projects like you're making big ones before graduating to bigger ones
@user-account-not-found
@user-account-not-found Рік тому
great video, still new to all this but very informative.
@Eagle-pe9pg
@Eagle-pe9pg 9 місяців тому
Thanks for this video. Some excellent advice and great delivery. Can you exlaborate on why baked is to be avoided over realtime?
@johnleorid
@johnleorid 9 місяців тому
Lightmaps for our game would have been 400GB on the disk. I don't think you can upload a game of this size to steam nor will anyone download it, even if they have enough space on their hard drive. The new probe volumes on the other hand would be suitable for baking lights, but these didn't exist when I made the video. It's still a workflow pain to bake so I'd avoid it wherever possible.
@anotheroutlier1227
@anotheroutlier1227 Рік тому
Oh yeah, I'd Definitely want to know more about event systems!
@irminverhoeff5592
@irminverhoeff5592 Рік тому
great video, this is really helpful. Thank you
@nathanfranck5822
@nathanfranck5822 2 роки тому
Our team removed so many builtin Unity features that we regularily wondered why we were using Unity at all :P Unity is really tough to make work with large games. Lighting is particularly difficult.
@MarilynMonRover
@MarilynMonRover Рік тому
UKposts needs more videos like this. Thanks for your insight. My only minor objection would be the use of Probuilder... when used properly, it's a very useful tool and really helps cut development time with no performance loss... key word here is *properly* though. You did quickly address how to get around its main issue, which was nice. One would *never* want to use a Probuilder mesh in a released product... always always ALWAYS export without exception. The built-in exporter works fine but the FBX exporter package works too. What would be nice to see more of is some detailed videos on specific concepts. I know it always varies from game to game but some good practical examples is indispensable for those who learn from example rather than from theory. For example, specifics on how to activate/deactivate interactive entities around the player character... that would be super useful to a lot of newcomers to RPG dev. It's easy to just say that this should be done, which so many dev videos state and which is such an obvious concept in and of itself that most already know that it should be done, but seeing specific implementations of the principle would really help out a lot of starting devs, and is something that is rarely given any concrete attention to.
@johnleorid
@johnleorid Рік тому
I'm not sure what you mean. In Unity, deactivating is just "npcGameObject.SetActive(false)", there isn't really anything to it, besides a simple distance check and maybe an angle check using "Vector3.Angle()". If it's a crowd system, there might be more to it, like pooling and randomizing their looks before re-spawing. Getting Spawn Points can be done using the NavMesh or using points, set by the level-designer, which run a simple sight of line check before spawning. Crowd systems can be much more complicated, especially when you want them to be visible from far away. There are so many attemps, using GPU Instancing, Billboards, excessive LOD in Visuals & Code, the whole pathfinding, sharing paths, using Flow-Fields instead of A-Star. But I don't expect any indie dev to make a game in a densly populated city. Even AA and AAA have problems pulling this off. And when it's a sparsingly populated town, the content loading system should do most of the work. Everything on top of that is just for further optimization.
@MarilynMonRover
@MarilynMonRover Рік тому
@@johnleorid Yeah, that's what I'm referring to... using SetActive is pretty obvious :) but the process by which you determine which ones should be enabled and which should be disabled is what I'm referring to. I know it seems simple enough when you've been doing this for awhile but there are a lot of newcomers who don't understand algorithms to do this logic and I think such explanations would be super helpful for them. Even in your response to me, it pretty much came down to theory and rough ideas, which is something such people get told a lot... "just do this and this general idea" without any specifics as to how to do those specifics, and many of the tutorials I've seen online that don't delve into code just stick with general theory that doesn't really help those people in particular. It's something that I've personally always wanted to make tutorials on, but... well... I suck at making tutorials :) and having even more noise on youtube won't help anyone. :)
@zelddroid
@zelddroid Рік тому
Super good video. Love the detailed advice!
Should you use Unity 6 to develop your Game?
25:28
DarkDax
Переглядів 31 тис.
I Built 300 Hours in Creative Mode
20:47
shovel241
Переглядів 213 тис.
одни дома // EVA mash @TweetvilleCartoon
01:00
EVA mash
Переглядів 667 тис.
Building Runtime UI with UI Toolkit In Unity
21:35
Game Dev Guide
Переглядів 19 тис.
Giving Personality to Procedural Animations using Math
15:30
t3ssel8r
Переглядів 2,3 млн
How Small Open-World Games Feel Big
12:33
Razbuten
Переглядів 957 тис.
11 Things You (Probably) Didn't Know You Could Do In Unity
13:49
Game Dev Guide
Переглядів 145 тис.
The WORST gamedev hot takes
42:10
BiteMe Games
Переглядів 14 тис.
Implementing World Streaming in my Unity Game! | Devlog
9:16
Kyle Banks // Farewell North
Переглядів 38 тис.
Dear Game Developers, Stop Messing This Up!
22:19
Jonas Tyroller
Переглядів 664 тис.
Why Have Open World Games Become Boring
55:01
Exiled
Переглядів 1,8 млн
I re-coded Minecraft, purely for MAXIMUM FPS (World Record)
11:26
Element X
Переглядів 114 тис.
Notch Has A New Indie Game! (Minecraft Creator)
7:59
Thomas Brush
Переглядів 72 тис.
Gegagedigedagedago! Nugget Kid Saved by a Cute Puppy! Part 16
0:18
Max Design Pro - Creative Animation Channel
Переглядів 25 млн
3 star drop#brawlstars #supercell #stardrop
0:36
Yøzi_12
Переглядів 4,4 млн