Watch This Before Working on a Big Game in Unity

Поделиться
HTML-код
  • Опубликовано: 22 май 2024
  • 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
  • ИгрыИгры

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

  • @skyfoz_
    @skyfoz_ 2 года назад +704

    And now i have a question, what’s a big game ?

    • @johnleorid
      @johnleorid  2 года назад +470

      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 года назад +50

      Thanks for answering !

    • @bizentino
      @bizentino 2 года назад +12

      @@johnleorid Amazing! Thank you for sharing! :D

    • @TYNEPUNK
      @TYNEPUNK 2 года назад +9

      @@johnleorid 3 million? my game exceeds 30 million very often lol

    • @johnleorid
      @johnleorid  2 года назад +18

      @@TYNEPUNK *3 Million, despite occlusion culling xD

  • @vast634
    @vast634 2 года назад +243

    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 Год назад +6

      Good point!

    • @xanderkyron
      @xanderkyron Год назад +11

      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 Год назад +3

      @@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 Год назад +1

      Gaia has a floating point fix function, takes care of this auto 👍

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

      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 года назад +136

    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 года назад +44

      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 2 года назад

      @@johnleorid that would be awesome

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

      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 9 месяцев назад

      ​@@alexandratrenkova9339that's me all the way lol trying to train myself to be more Creative, etc lmao

  • @GamingwithRedPhoenix
    @GamingwithRedPhoenix 2 года назад +74

    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

  • @marceldoe9684
    @marceldoe9684 2 года назад +348

    This is very good content. I would love that video on an Event system.

  • @guitar45rocks5
    @guitar45rocks5 Год назад +15

    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.

  • @INeatFreak
    @INeatFreak 2 года назад +255

    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 года назад +2

      Cause Unity is trash

    • @jomalomal
      @jomalomal 2 года назад +11

      @@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 2 года назад +1

      @@hollownxt1295 Epic take 30% of your revenue

    • @hollownxt1295
      @hollownxt1295 2 года назад +5

      @@Finlzz and? With Unity you’re not getting any

  • @SkeleTonHammer
    @SkeleTonHammer 2 года назад +51

    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 года назад +3

      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 года назад +1

      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 2 года назад +4

      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".

  • @lorenzoconsoli1916
    @lorenzoconsoli1916 2 года назад +31

    This video is amazing. On RUclips 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

  • @marcoseliasmep
    @marcoseliasmep 2 года назад +28

    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 года назад +7

      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  2 года назад +4

      @@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.

  • @fawazaljohani8447
    @fawazaljohani8447 2 года назад +16

    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

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

    Me making a 2D tic tac toe game: "Ah yes this is relevant to me"

  • @xiaotan85
    @xiaotan85 2 года назад +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!

  • @facepalmedev
    @facepalmedev 2 года назад +12

    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

  • @gotbaka3
    @gotbaka3 2 года назад +7

    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 года назад +62

    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 года назад +6

      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 года назад +1

      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

  • @MohanABK
    @MohanABK Год назад +6

    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.

  • @xinoHITO
    @xinoHITO 2 года назад +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

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

    Amazin video, thank you so much for working on this, it is so hard to find actual intermediate/advance topics about Unity.
    Loved it!

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

    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!

  • @shyamarama
    @shyamarama 2 года назад +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 👍

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

    This video was such a relieving change of pace, I instantly subscribed.

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

    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  2 года назад

      In V2022.1 there are material variants which provide pretty much the same functionality - but afaik they are still assets you have to create.

  • @Alan-fu2vx
    @Alan-fu2vx 2 года назад +1

    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!

  • @jacques-dev
    @jacques-dev 2 года назад +3

    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.

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

    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😊

  • @Dominik-K
    @Dominik-K 2 года назад +1

    Great explanation and I learned a lot from this video. Would love to see more content, e.g. the event system you mentioned

  • @igorgiuseppe1862
    @igorgiuseppe1862 2 года назад +19

    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 года назад +3

      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

  • @stylie473joker5
    @stylie473joker5 2 года назад +21

    That's why its best to use mixed lighting (baked on some areas & realtime on others)

    • @Chris-lw5po
      @Chris-lw5po 2 года назад +10

      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 года назад +5

      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.

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

    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.

  • @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.

  • @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!

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

    This is a 10 years of experience and knowledge compressed into a single video. Would be great to see the video about code optimization!

  • @KnucklesEmerald-wj9vo
    @KnucklesEmerald-wj9vo 9 месяцев назад

    Thank you for the video! Would absolutely love to see more vids from you

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

    Finally "advanced" tips. Thank you so much, those are really helpful!

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

    This was really helpful, thank you a lot! I would really appreciate the "coding big games" video in the future.

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

    This is golden information. Keep these things in mind any time when doing any FP game that has any asynchronous loading

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

    video was really great but it was totally overshadowed by the genius of the outro, keep it up

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

    Definitely interested in learning more about coding systems! Great video mate

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

    Bloody brilliant content, thanks for uploading and looking forward to more insights in your future videos

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

    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.

  • @000Gua000
    @000Gua000 2 года назад

    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.

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

    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.

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

    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.

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

    Very useful content. Thank you and your patrons :)

  • @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!

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

    Very pog content, I actually took notes for the first time lol, the video about coding for complex games would be great!

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

    Really nice video! Taught me some stuff I didn´t really think about.

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

    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!

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

    Great advice! I'd love to get a more in-depth discussion about a central communication hub as suggested in your video.

  • @ericO141
    @ericO141 2 года назад +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

  • @Bloodthirst
    @Bloodthirst 2 года назад +7

    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

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

    Amazing video, thank you so much. Subscribed in the hope that you'll put out a coding/event system video 😁

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

    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.

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

    Awesome video with fantastic information. Thank you so much for making this ❤️

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

    Very very informative video, I would love to see what you got more

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

    Thats some top tier video. Straight to the point.
    I will pray youtube algorithms for you my friend.
    Thanks a lot for great video

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

    This is very informative, Thank you, great content!

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

    I saved your video for future reference. Please make more videos on large-scale game development, these are hard to find.

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

    This was very informative. Thank you for the video!

  • @MegamanXGold
    @MegamanXGold 2 года назад +14

    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.

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

    Great video John!

  • @vladm2772
    @vladm2772 2 года назад +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!

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

    Subscribed for this video, well done!❤

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

    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)

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

    Great video, you earned my sub :)
    I would love to see the video on Even System. Can’t wait xD

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

    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!

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

    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?

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

    "Writing code for a complex game" - yes please. Great video, would love to see more in-depth content from you.

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

    Golden video. Share more experience on loading/unloading regions of big world please

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

    Thanks for the insights! Outro made me instantly like&sub. :)

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

    occlusion culling and static batching saved my game. Occlusion has a lot of hiccups but I'm glad I figured it out.

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

    The ending by listing your pateron error codes has me dead in my chair. LOL
    Very well done video! Thank you for the tips!

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

    This is insanely helpful! Thank you so much

  • @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  2 года назад

      Still working on it. The coding video will be a bit longer, so it will take more time to make it. ^^

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

    Hey there! I rarely comment but I think you deserve one ;) Very good and interesting videos. What I love about it is , despite beeing about Unity, most of the advices works for all game engine. I'm trying to learn Godot , and depite it beeing a very good engine, it's also one that needs the devs to optimize their games a lot, especially if you are working on 3d games. And I knew some of the stuffs you talked about, but other were really helpful. Liked your videos and I do believe you really deserve it! Nice work!
    Edit: Also, would totally love a detailed video about optimizing scripts :P

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

      Thanks a lot for your comment :D
      I'm looking forward to a Code Optimization video, but first I want to share the event system, as it's a very cool pattern (when used correctly). ^^

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

    Simple, accurate, appreciated. Thank you.

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

    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.

  • @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

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

    Great video! Almost all of the tips are sort of a must have in any more or less normal project. Unless you are stamping trash mobile games every week - all of these tips are really useful.

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

    That's Amazing information!
    I'll be rewatching this several times.
    Interesting that Occusion culling is not effective in large scenes

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

    First-time visitor and I love your intro.

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

    RUclips 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. :)

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

    This is a great video on this topic, and a lot of it applies to other game engines as well!

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

    Lol the patreon list at the end killed me hahaha, good video man, keep them coming.

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

    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 Год назад +1

      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)

  • @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

  • @v.k.s.338
    @v.k.s.338 20 дней назад +1

    You deserve all the subs,
    Thank you

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

    Super good video. Love the detailed advice!

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

    Very well presented information and the Patreon bit at the end killed me haha

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

    +1 for an event system, great video!

  • @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  Год назад +1

      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 :)

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

    The terrein tool supports the use of prefab with LODs, by adding grass prefab as if it was a tree, you can do the same for the grass

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

    I've only really started programming with Unity off and on for about six months now, so what is said in the video isn't familiar with me (instead of a different language though, it's like a dialect). The stuff that I do understand though is wise and is chalk-full of great ideas.
    While I can't enjoy this video now, I look forward to the day I can. Cheers, and best of luck in your own coding endeavors, both creator and viewer alike!

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

    Great video. That ending make me chuckle hard lol.

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

    Great content. I'm tired of videos on just small scale games.
    I want to know about big games! The potential of the engine! The limitations! More please!

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

    Good overview of potential problems with Unity development! Nice video. 🙂

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

    For Unity big project (from my experience) is appearing as an amount of Scenes and Prefabs you have plus all the resources like textures, meshes and materials. Each prefab is pain and scene is even more pain. In theory the solvation should come with use of assemblies definitions and Assets Bundles (via the Addressables feature) with witch you will control what should and what should not be loaded. But it is something to consider from the beginning of a project. And UE handles big projects better, but the approach to achieve it is the same. Modularity of code and modularity of content (check out UE Game Features thing).

  • @Skye-Games
    @Skye-Games 9 месяцев назад

    Great video!
    I'd love to see a video on Big Game Coding systems

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

    Thanks for the video!
    Very useful advises. The only problem for me is that I struggle before all of these problems start to appear in my project.
    I end up far before - when trying to manage code in a big project. I can program any mechanic alone. But when it comes all together I just got overwhelmed.
    I watched and read a lot about architecture approaches, patterns and other stuff. But in really it is almost impossible to separate systems to make it clean.
    And when you try to separate them by some kind of events system - you only make it worse. Because they now look like isolated but in fact they are still connected but in more complex and hidden way. And now it's harder to debug and maintain.
    So yeah. I would love to hear about managing code in a big games

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

      It's a way of thinking, I'll try to cover it in the video but it will need more than one to show proper examples and applications of it in various situations.
      At the end of the day, architecture is all about connections, the less you have, the better.
      Stay tuned because I think this is exactly what my next video(s) will be about. ^^