Watch This Before Working on a Big Game in Unity

Поділитися
Вставка
  • Опубліковано 1 січ 2025

КОМЕНТАРІ • 805

  • @skyfoz_
    @skyfoz_ 2 роки тому +728

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

    • @johnleorid
      @johnleorid  2 роки тому +486

      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 роки тому +52

      Thanks for answering !

    • @bizentino
      @bizentino 2 роки тому +13

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

    • @TYNEPUNK
      @TYNEPUNK 2 роки тому +10

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

    • @johnleorid
      @johnleorid  2 роки тому +20

      @@TYNEPUNK *3 Million, despite occlusion culling xD

  • @vast634
    @vast634 2 роки тому +262

    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 2 роки тому +6

      Good point!

    • @xanderkyron
      @xanderkyron 2 роки тому +12

      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 2 роки тому +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 2 роки тому +1

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

    • @MarilynMonRover
      @MarilynMonRover 2 роки тому +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 роки тому +150

    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 роки тому +45

      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 Рік тому

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

  • @TheGodEmperorOfMankind_
    @TheGodEmperorOfMankind_ 2 роки тому +21

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

  • @guitar45rocks5
    @guitar45rocks5 2 роки тому +18

    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 роки тому +261

    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.

    • @hollow_dbd
      @hollow_dbd 2 роки тому +2

      Cause Unity is trash

    • @jomalomal
      @jomalomal 2 роки тому +12

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

    • @hollow_dbd
      @hollow_dbd 2 роки тому

      @@jomalomal Unreal Engine for has better and more tools and it’s free…

    • @Finlzz
      @Finlzz 2 роки тому +1

      @@hollow_dbd Epic take 30% of your revenue

    • @hollow_dbd
      @hollow_dbd 2 роки тому +5

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

  • @lorenzoconsoli1916
    @lorenzoconsoli1916 2 роки тому +32

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

  • @SkeleTonHammer
    @SkeleTonHammer 2 роки тому +54

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

  • @marceldoe9684
    @marceldoe9684 2 роки тому +349

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

  • @GamingwithRedPhoenix
    @GamingwithRedPhoenix 2 роки тому +77

    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

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

  • @fawazaljohani8447
    @fawazaljohani8447 2 роки тому +17

    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

  • @dreamisover9813
    @dreamisover9813 2 роки тому +63

    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 роки тому +7

      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 2 роки тому

      @@johnleorid can i have a video or some informative links about these topics (batching and stuff) too. Would really like that

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

  • @igorgiuseppe1862
    @igorgiuseppe1862 2 роки тому +21

    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

  • @pikachufan3588
    @pikachufan3588 2 роки тому +3

    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 роки тому +1

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

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

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

  • @adamcolon
    @adamcolon 28 днів тому

    I'm half way through the video and so far I wanna say that this is all extremely valuable advice.
    I've been a programmer for over 25 years, but in the business world... I write games as a hobby. Every single thing you've said so far is 100% accurate and of high value.

  • @LowLevelLemmy
    @LowLevelLemmy Рік тому +1

    Are you still working on the event system video??? I need that ASAP

    • @johnleorid
      @johnleorid  Рік тому +1

      Yes, I'm working on the animations right now. ^^

  • @yashmalhotra9202
    @yashmalhotra9202 Рік тому +2

    thank you for the video, soo much info in a single video.....When will the code architecture video is coming out ?

  • @ebolei
    @ebolei 10 місяців тому +2

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

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

  • @sacb0y
    @sacb0y 2 роки тому +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.

  • @miwiarts
    @miwiarts 2 роки тому +1

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

  • @pedrobelluzzo
    @pedrobelluzzo 2 роки тому +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)

  • @vaibhavjaiswal799
    @vaibhavjaiswal799 2 роки тому

    That's really awsome, no one ever talk about large games, I literally learn many things and realize i was wrong about many things

  • @ZhaojuEphastine
    @ZhaojuEphastine 2 роки тому +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.

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

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

  • @csthll
    @csthll 2 роки тому

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

  • @XZYSquare
    @XZYSquare 2 роки тому

    9:30 a solution is to not iterate over it each frame
    use triggers, store items you're close to in a list when you enter a their trigger, remove them when you exit the trigger
    if it's related to a button press, you do not need to check every single frame
    while inside the trigger, use the input system to get an event, and do the item pickup code in that event
    this way you don't hold up the frame buffer when doing input checks.

  • @mirastyle
    @mirastyle 2 роки тому +1

    That's why it is important to actually know what's the engine doing in the background and not just to approach this naively based on a few tutorials. To me the skill and magic in creating the breathtaking large scenes is in knowing where to do the compromises, what to do, what to fake

  • @skinnylizardstudios
    @skinnylizardstudios 2 роки тому

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

  • @colincurrie7930
    @colincurrie7930 Рік тому

    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.

  • @evgenkonyshock4913
    @evgenkonyshock4913 2 роки тому +1

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

  • @rohrichoak9740
    @rohrichoak9740 2 роки тому +2

    I remember similar tips back in the glory days of Blender Game Engine. Lights were a big killer there, so you really had to switch them off when far enough/out of the room.
    Ultimately, creating Nintendo 64 level of quality will never kill the fun anyway. Graphics are beautiful, but that's not where all the fun comes from at the end of the day.

  • @XZYSquare
    @XZYSquare 2 роки тому +1

    i go on about not checking every frame for things... I talk about the input system... I want to clarify that since the input system runs BEFORE or after render, you can hook into events that happen on button press instead of in the update function. This could really help with making sure things happen without taking over the render cycle. even better is coroutines. These don't run on the update thread. That means you can run code in them without affecting update.
    3: you can make the initial modular pieces of the meshes with probuilder, then export those with the fbx export option. then, replace the probuilder mesh object with the exported version. since they'll be modular you don't have to do it every time you want to use that mesh again.
    6: you say to look at the perspective of the player when placing and hiding objects in the scene... this could easily also be applied to ai/systems/input/searches and anything that could change over time. if the player would be considering pressing a to pick an item up before looking at it, don't check for if he's pressing a until they're looking at it
    8: no automatic systems... that's a bit of a loaded statement... that's like saying not to make a factory where items can be converted into others using code... automatic isn't the problem... what is even considered automatic if any ai or item pickup system is not that?!
    9: it's smart to think on the grid, but what's even smarter is pairing that with the correct events, timings and functions... if the player is not spamming a at every single frame why check every frame if they want to pick something up? wait until they do something to check if they can do it. (presses a button, enters a trigger, etc)
    10: there's a max rigidbody count?! actually no there is not. no way to configure it, and i've spawned over 10,000 rigidbodys without taking a performance hit on my laptop with no gpu in the editor on a intel i5 cpu.
    11 and 12: if the player's not seeing it happen, only update the ai's code. you don't need to be displaying animations that the player will not see. you don't need physical interactions and ai when a player doesn't even know they're happening. if you have to check every frame for what will happen in the case the player interacts, only check on input not every single frame if they can talk.
    15: this goes without saying, you can pool assets. store a list of a type of mesh, their position, rotation and what their purpose is and have that configure itself when loaded... this way you don't need each object to be in the scene taking up all the resources even when you're not there... this could be worse but you can do it in a way that can really improve performance.

    • @johnleorid
      @johnleorid  2 роки тому +1

      "Limited number of Rigidbodies" was badly worded - of course there isn't a real limit, I just worked on different building destruction games and managed to kill the performance thanks to the Physics engine every now and then. (I think the performance cost of one body has to do with the complexity of the map, the static colliders. Not 100% sure about that one, but it would make sense with how the broadphase works) ^^
      Cool comment, thanks for sharing your thoughts :D

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

  • @jcozyyt
    @jcozyyt Рік тому

    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!

  • @almicc
    @almicc 2 роки тому

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

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

  • @Willyuum
    @Willyuum 2 роки тому +1

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

  • @MichoSchmidt
    @MichoSchmidt 2 роки тому +1

    Great video John!

  • @BlackMantisRed
    @BlackMantisRed 2 роки тому

    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.

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

  • @garathiel84
    @garathiel84 2 роки тому

    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!

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

  • @tetsu1334
    @tetsu1334 2 роки тому +1

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

  • @ViniciusNegrao_
    @ViniciusNegrao_ Рік тому

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

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

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

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

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

  • @DylanBurke
    @DylanBurke 2 роки тому +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 2 роки тому +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  2 роки тому

      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  2 роки тому

      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  2 роки тому

      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  2 роки тому

      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)

  • @WyMustIGo
    @WyMustIGo 2 роки тому +1

    Great video. Sadly the problem is that many clueless people go out, buy some assets, then slap it all into an environment calling it a "survival game" or whatever. Then when the game performs like crap, people who have no clue blame the engine. Engines are "tools" for EXPERIENCED developers, they are not "entry level" systems for the inexperienced people. I've worked on AAA games during my career where we wrote 100% of the code, and others when we used an existing engine. In ALL cases our code always outperformed the generic engine because our code was tailored and optimized at its core for our game. But the thing is, having the ability to write an understand your own code will GREATLY improve your ability to work with 3rd party engines like Unity and Unreal -- simply put, we know what happens at low levels, the inexperienced do not. Worst yet, they watch UA-cam channels and assume the author has a clue, in almost all cases the author has never developed anything except a common cold/flu, they simply copy and re-release tutorials and the bad information gets propagated.
    Bottom line: Engines are a double sided sword, great to have experienced developers (with games under their belt) save time, but terrible for those who will never take the time to actually learn how to develop and program without one.

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

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

  • @ViktorFerenczi
    @ViktorFerenczi 2 роки тому

    Very useful content. Thank you and your patrons :)

  • @KnucklesEmerald-wj9vo
    @KnucklesEmerald-wj9vo Рік тому

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

  • @GoalRival2
    @GoalRival2 Рік тому +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😊

  • @deuced80
    @deuced80 2 роки тому

    This sounds like I'm in the advanced section of game making. Sounds very useful for folks at a high level in game creation. I'm heading back to the basics department.

  • @Natefurry
    @Natefurry 2 роки тому +5

    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.

  • @gadgetboyplaysmc
    @gadgetboyplaysmc 2 роки тому +3

    BRO! The animation you showed on 14:39 on "Unified Communication System" through the Event System is really interesting. I'm really struggling with writing code that's extendable and maintainable throughout all my systems. Even in small mobile games, it can get pretty complex. Would love to watch a video on "Writing Code for A Complex Game" that you mentioned.

    • @johnleorid
      @johnleorid  2 роки тому +1

      Had to do a lot of research, also I wrote a event system myself which I want to share with the release of the event system video and of course, working on Games.
      But I am actively working on it and I hope to release it soon. :)
      It's way more work than I thought it would be. As always. xD

    • @gadgetboyplaysmc
      @gadgetboyplaysmc 2 роки тому

      @@johnleorid Awesome dude! Can't wait! I have you on my notification bell. Appreciate the content you're doing for us in the game dev community. Hope you make it big man!

  • @SuperKREPSINIS
    @SuperKREPSINIS 2 роки тому +1

    well pretty mutch all can be optimized as a regular workflow, 6:15 for example, solution ? frustum culing, oclusion culing and for npc's at far away, just dont run code of those npc. with scene view in inspector, same frustum culling.

  • @CarlitologyTV
    @CarlitologyTV 2 роки тому +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.

  • @mercuryhg7150
    @mercuryhg7150 2 роки тому

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

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

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

  • @bluegru
    @bluegru 2 роки тому +1

    Hey whats that at 1:12 with the colored project folders? looks kinda neat

    • @johnleorid
      @johnleorid  2 роки тому +2

      An asset, rainbow folders 2
      assetstore.unity.com/packages/tools/utilities/rainbow-folders-2-143526

    • @bluegru
      @bluegru 2 роки тому +2

      Looks awesome
      Thanks

  • @numathesaint872
    @numathesaint872 2 роки тому +8

    the more I learn, the less I know.

  • @mantra1229
    @mantra1229 2 роки тому

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

  • @HandleDisliker
    @HandleDisliker 2 роки тому

    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!

  • @DileepNow
    @DileepNow 2 роки тому +3

    Subbed. I don't even use Unity but this is informative.

  • @Quocviet08t2ah
    @Quocviet08t2ah 2 роки тому +1

    Subscribed for this video, well done!❤

  • @phillippi2
    @phillippi2 2 роки тому

    This is one of the reasons that many games, especially old 3d games, use a tile-based rendering system. This allows the engine to load/unload chunks of the terrain as needed. Look at the original Ultima: Underworld. When you look down, sometimes you can see that the terrain behind you is missing. If you walk back a few steps, it reappears. This is because it only renders what you can see if you look straight ahead.

  • @voltonik6404
    @voltonik6404 2 роки тому +1

    This is very informative, Thank you, great content!

  • @v.k.s.338
    @v.k.s.338 8 місяців тому +1

    You deserve all the subs,
    Thank you

  • @synchaoz
    @synchaoz 2 роки тому

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

  • @DarkSwordsman
    @DarkSwordsman 2 роки тому

    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!

  • @everabyss
    @everabyss 2 роки тому +1

    The video was pure gold! Please do video on "Coding Stuff".

  • @itzdabbzz
    @itzdabbzz 2 роки тому +1

    I would love to see a detailed explanation about coding a "Big Game" and great coding layouts or structures to follow tbh

  • @kevkas
    @kevkas 2 роки тому

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

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

  • @jendrikbulk1885
    @jendrikbulk1885 2 роки тому +1

    I'd Like to know some more details about why not using occlusion culling and the batch static. It's the first time that I hear it's a bad thing. Same for the navmesh topic

    • @johnleorid
      @johnleorid  2 роки тому +1

      All of it depends on the size of your Game. If you are working on a smaller game, these things can improve your performance and if you can, it is safe to use them.
      If your game is so large that you have to manually load and unload content, then static batching will prevent that, as it combines things regardless of your hand-placed loading regions. Same with occlusion culling, it expects content to be visible - if you blend it out manually, this results in anti-synergy.
      Regional nav-meshes are also a requirement - because then you can have one nav-mesh per region/sector.

  • @xXxIMMORTALxXx
    @xXxIMMORTALxXx 2 роки тому

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

  • @MarilynMonRover
    @MarilynMonRover 2 роки тому

    UA-cam 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  2 роки тому

      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 2 роки тому

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

  • @jamesrobertson6205
    @jamesrobertson6205 2 роки тому

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

  • @robertmalzan6724
    @robertmalzan6724 2 роки тому

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

  • @KentHambrock
    @KentHambrock 2 роки тому +1

    Some good tips in here. Correct me if I'm wrong, but some of these tips are specifically only for large open world games running on PCs.Tiled rendering GPUs like those on phones can't handle GPU instancing to my knowledge and baked lighting is almost essential given how much of a negative impact real time lighting can make. Granted, mostly people don't make big games, open world or otherwise, for mobile processors as they're not typically seen as a 'gaming' system, but the Nintendo Switch and Meta Quest/Quest 2 have a lot of people trying to find the best ways to make big games on mobile processors . Those need much more vigilant and extreme forms of optimization. I'd love to see a video covering some of those processes and some best practices videos for coding/memory optimization.

    • @meatpuppet5036
      @meatpuppet5036 Рік тому

      This is absolutely true, real time lighting is really only for desktops/consoles. Mobile games have different restrictions.

  • @hamidrezakhosravimusic
    @hamidrezakhosravimusic 2 роки тому

    I'm using UE5, but some of these info's here were pretty amazing. Thank you

  • @XZYSquare
    @XZYSquare 2 роки тому +1

    12:12 while active the npcs could iterate themselves over a coroutine, these of which you can pause and resume at any time
    since they don't run on the update thread while inside coroutines i imagine they could improve framerates

    • @Reahreic
      @Reahreic 2 роки тому

      I regularly use coroutines running at lower tick rates on less important items. IIRC only the player character actually uses Update, the rest of the game items are triggered to 'tick' their logic at usually between 5 and 30 fps depending on their criticality and proximity the the player. Additionally spreading 'long-running' logic tasks over a few frames helps to reduce the propensity for CPU related frame drops.
      Certainly takes planning to ensure one doesn't corner themselves.

    • @XZYSquare
      @XZYSquare 2 роки тому +1

      @@Reahreic that's true

  • @D_2_Digital
    @D_2_Digital 2 роки тому +1

    This was very informative. Thank you for the video!

  • @thatguy9668
    @thatguy9668 Рік тому

    Simple, accurate, appreciated. Thank you.

  • @alexandratrenkova9339
    @alexandratrenkova9339 Рік тому +2

    My boss with 20 years of experience in the game dev industry www.youtube.com/@SamuelAsherRivello (for the curious) always says that no matter how huge of a world you are building, if you have structure, you will be able to just work more efficiently. So in essence, there is no such thing as a game that is impossible to build, but only such that has hole in the code because of lack of overview and simplicity.

    • @johnleorid
      @johnleorid  Рік тому

      If a AAA Game was made in 2 years by 200 developers, it would take 400 years for a solo-dev who is an expert at everything (animation, coding, audio, writing, ...) to make the same game.
      "Structure" is important (also to keep your motivation going) nonetheless "Scope" is probably slightly more important.

  • @kevindean8312
    @kevindean8312 6 місяців тому

    Nice, you made some real good points. KISS being one of them.

  • @petrus4
    @petrus4 2 роки тому +1

    TL;DR:- Know and mentally designate the difference between the background/bedrock/static (BSP, in old terminology) elements of your scene, and the foreground/dynamic/temporary stuff. (Usually known as entities)
    If you want fully destructible environments, then you will need to be voxel/chunk based, which presents its' own can of worms; but your life will be MUCH easier if you have an indestructible/static/pre-rendered outer carapace, and then use either 2D sprites or small, non-rendered meshes for your internal stuff.

  • @slavic_sloth
    @slavic_sloth Рік тому

    Just a heads up for the baking light segment, you can always change the Lightmap Size, compression, and a lot more in the Lighting Setting window.

    • @johnleorid
      @johnleorid  Рік тому

      Yea, but seems like the new way is to use probe volumes, they are different than the old light probes in many ways and can be used in bigger levels. I still wouldn't use them everywhere in an open world map and they have quite some limitations (e.g. daytime change only works with blending).

  • @Markyparky56
    @Markyparky56 2 роки тому

    PIX is a GPU debugging and profiling tool for Windows and Xbox from Microsoft. You can use it to capture a frame of execution in your game and all the different steps taken to render that frame on the GPU. And it's free!