Implementing World Streaming in my Unity Game! | Devlog

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

КОМЕНТАРІ • 159

  • @kylebanks
    @kylebanks  Рік тому +4

    Hey folks, thanks for watching! Just wanted to let you know that all the code for the world streaming solution is available on Patreon now for those who want it.

  • @maxximumb
    @maxximumb 2 роки тому +71

    Code iteration and optimisation is so satisfying when you get it all right.

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

      It's honestly some of my favorite stuff to work on

  • @isto_inc
    @isto_inc Рік тому +3

    For the teeeny tiny subset of people who will be implementing world streaming in their own projects - this was dope. Thanks!

  • @gijsbert11
    @gijsbert11 2 роки тому +72

    Performance optimization, something AAA studios barely to no-longer do and throw DLSS at it to try and fix the performance cuz they were too lazy to optimize the game... thank you for making the game runnable on lower-end hardware! keep up the good work.

    • @kylebanks
      @kylebanks  2 роки тому +27

      Ahah thank you. To be fair, optimising Farewell North is a much easier challenge than optimizing most AAA games, but it's something I weirdly really enjoy working on...

    • @KingRecycle69
      @KingRecycle69 2 роки тому +11

      Optimizing is a lot harder for bigger games than you would think.

    • @seanss
      @seanss Рік тому +5

      ​@Twenty zero One ok how many AAA game have you worked on?

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

      No man, AAA, they have their optimization methods of their own engine. Battlefield 2042 is an example. It doesn't renders the whole map at a time. They have their world partitioning. Which renders a partition what player can see. Rendering everything will crash out.
      Just to inform you...

  • @arlenkerndt
    @arlenkerndt 2 роки тому +11

    Since discovering your game dev vlog, I have come back to it multiple times for inspiration and entertainment! The art and story of the game are beautiful, and the way to present your journey never gets old! I can't wait to see future dev vlogs; keep up the amazing work!

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

      Oh wow what a kind comment, thank you! I'm so glad these devlogs could be any help or inspiration for you :)

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

    This video is the dark side of game dev. Working thousand hours for something needed that the player will never see ;), very nice video !

  • @JacksonBLee
    @JacksonBLee 2 роки тому +7

    Love watching this develop into an amazing game. (also love the orange cow thing)

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

      Hahah the orange cow thing

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

    I love this game, and I really adore you and your creativity. It takes great dedication to count the grass blocks. No wonder it took you 4 months!

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

      It was well worth the effort to bring you guys an accurate count ☺️

  • @TUKMAK
    @TUKMAK 2 роки тому +45

    Ooh Very satisfying to see all of the memory being saved! Also, did I hear you say a tease for a next game you're working on?!

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

      Haha I wouldn't say a tease, definitely a lot of love left to put into Farewell North before working on anything else!

  • @jixyrover1759
    @jixyrover1759 2 роки тому +9

    I love seeing the process and finding things you wouldn't normally think about 🤔 That being said idk why but 0:58 made me so happy 😁 the design, colour, and their fluffiness are just so adorable. 10/10 fantastic addition 🥰

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

      Thank you! Glad you enjoyed them 😊

    • @YoutuberUser000
      @YoutuberUser000 2 місяці тому

      So you made occlusion culling?​@@kylebanks

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

    World streaming is something I really don't know anything about, and what you've done here seems so far above my current understanding of programming, memory, and Unity as a game engine that I could only really get a vague understanding of what you did and how it works, but I like that you put some effort into optimizing your game! Some devs just don't.

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

    I have been developing my game for over 1 year now, and watching this made me realise that there is so much to it when it comes to optimisation

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

      Don't stress it too much, just tackle one thing at a time and it's much more approachable

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

      @@kylebanks i dont know where to start from, would love some guidance

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

    World Streaming has always been a topic I have kept a healthy distance from, but you broke it down and made it much more approachable! Awesome stuff

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

      It's not too tricky once you dig into it, but there are a few workflow changes to get used to. Good luck!

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

    This is one of the smartest Devlogs! Great to see another solution to a major task of Open World games and scenes.

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

    Hey Kyle thank you for the great video! I am glad to see you're making good progress!

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

    I reached this video through git-amend's Unity tutorial series. Very cool to find these places with attention for best practices and solid development outside my regular ecosystem

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

      Awesome! I'll have to check out the video, do you remember which one it was?

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

    Hey Kyle. I know you probably hear this a lot, but you deserve much more interaction with your viewers. This game looks amazing and I can't wait to play.

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

      Thank you, that's really kind of you to say

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

      @@kylebanks No problem dude!

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

    Started using your SceneRef Attributes thanks for the repo! Great job as normal.

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

      Oh awesome! Hope it's working well for you

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

    devlogs like this are really interesting and informative. thanks for sharing

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

      I'm very happy to hear that, I always worry about doing too much technical stuff in devlogs

  • @Rahim-444
    @Rahim-444 2 роки тому

    the new updates might not show in the actual game or video but it is a very important change, good job!

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

    You should add some narwhals or some kind of ocean animal! Great video btw! 💛

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

    Amazing work! I love these more technical devlogs. And you solution for the components is genius, definitely going to look into doing this for my own project.

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

      Thanks! It's open source so feel free to just steal mine ☺️

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

    I like this video
    People usually don't realize that adding content or features into the game is only a small part of the development. All the work behind the scenes takes time and some smart engineering while providing no noticeable difference for the player (unless You don't do it and the players will just scream "You can't even optimize a game")

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

    nice solution to the stuttering!
    Nice work dude! This looks fantastic!

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

    Super interesting video as always! Will definitely use the auto setup attribute! 🙏

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

    Awesome to see how you've handled streaming. I really like the Nearest neighbours algorithm you described and why it's not useful for you. Good luck with those future problems!

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

      Thanks! Not sure if I'll really need to solve them for Farewell North, might be overkill, but have some interesting ideas for how to improve the system if needed for future projects

  • @Prrt-rq3ym
    @Prrt-rq3ym 2 роки тому

    Nice Devlog I hit the bell straight away I also just worked on a chunking system for my game and went a completly different way with it I am using a custom dictionary whicht always keeps track of the chunks loaded in, the catch is once a new chunk gets loaded the oldest chunk gets removed from the dictionary, I got around the stutters that way since like this I can assure that there is always only one chunk in the process of loading or unloading simultaneosly also I am not checking what to load on every Update but on a fixed intervall (once per second). Btw I want your grass it looks amazing :D

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

      Oh nice! Yea that would help for sure, but for me I was finding even the smallest subscenes would cause a slight stutter with those pesky awakes, so I had to go a bit of a different direction, but that makes total sense

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

    Hey, I haven't watched one of the devlogs in a while, so I'll have to binge-watch them haha! As somebody who *loves* border collies, I was wondering if you can crouch down and herd stuff. Personally, watching them focus and get into position is really cool to watch, and seeing it here would be cool as well. Thank you!

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

      You can! Sheep, cattle, and even duck herding is part of the game as he's a working dog 😊

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

      @@kylebanks Oh wow, that's awesome to hear!

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

      @@kylebanks I'm watching your old videos right now, and currently I'm at your devlog from 6 months ago.
      For the fur colors, I think being able to customize the border collie is a good idea. I understand that it can take away from the story, though.
      Maybe make the other colors unlockable after playing through the main game as the classic black/white border collie. That way people can still play as their favorite border collies, but the story mode dog is still the one everybody plays.
      Edit: I don't know if you already found a solution!

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

    Love this series been here since episode 1

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

      Thanks for the support!

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

    Very impressive tech behind this game

  • @lukasossaprov6401
    @lukasossaprov6401 5 місяців тому

    Amazing dev log 👌

  • @D-Dev
    @D-Dev Рік тому +1

    It's just wow. Btw I really like the art style of your game. Could you tell me if these textures are from some package or you created it by your self? I'm especially interested in this rock texture because looks really great.

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

    8.5+gb of mem to 1.2gb roughly... Thats freaking awesome :D WELL DONE!

  • @SozINh
    @SozINh 3 місяці тому

    Needed this, everyone’s saying it’s just impossible to make an open world game.
    I think this is one of the missing pieces for a lot of people.

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

    Looking good!

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

    Great vid, how did you deal with the size of your world for your characters, did you use floating origin, or something else to handle the stuttering that happens when over 1000 meters away

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

    One thing about the flags that I worry about is if you have a new game+ or exploration mode that lets you go from island 1 to 6 at times you are not expecting. Definitely a good idea to tune this to your artist vision of the game, but it's something to keep in mind.

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

    Thanks for sharing this. I'm probably going to need to do something similar pretty soon.

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

      good luck! it's a pretty fun little challenge to get a system that works well for your workflow

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

    looks like a game that will be loved! ❤

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

    Great job!
    This is the main problem of Unity... you can do fantastic things but... you have to do them by yourself while such features should be included in the core engine by default.

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

      Thank you! I agree, but also if anything I'd see myself personally going to a lower-level engine if anything. I like tinkering and having really fine grained control. To me the way Unity gives you the ability to load a scene, and it's up to you to decide when, is actually perfect. I can totally understand the other perspective though.

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

    now I have to learn all this

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

    I'm giving this thing a go. Do you have anymore detailed tutorial videos by chance, or would you at least consider making one in the short term of the next 1-2 weeks, if possible? That would be marvelous

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

    the game looks realy good, keep up the good work😁👍

  • @ekekw930
    @ekekw930 10 місяців тому

    You are an amazing programmer

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

    This was awesome to see your thought process through this problem! Something I noticed at the beginning was how you were able to have an area of color around the player and everything else was grayed out. How did you manage to do this? I had an idea for a game that incorporated that but didn't figure out how to do it!

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

    Great solution, liked and subbed :) Any progress on the occlusion problem ?

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

    this is so cool!

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

    Thank you so much for building it for mac! I know were a small community, but it's nice to not have to use wine

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

      I'm a mac user primarily myself, so I feel your pain :(

  • @haowu-z7h
    @haowu-z7h Рік тому +1

    Great video! I noticed that these sub-scenes are loaded as additive scenes. I have two questions.
    The Game Objects in the sub-scene share the same world coordinates. Therefore, to place them in the correct position in the final world, they must be accurately placed in each sub-scene. But when I independently edit a sub-scene, how can I ensure that these game objects are correctly placed? Another solution is for each game object to only consider its position in its own scene and then move the entire sub-scene after loading. However, this may disrupt baking. What is your approach to this?
    Using the additive scene method can only load the same scene file (.unity) once. If I have some sub-scenes I want to reuse, I cannot have multiple instances of that scene simultaneously. Additionally, can each scene be saved as a Prefab? Then we can stream and instantiate the Prefab. What issues might arise from using Prefabs instead of additive scenes?
    I sincerely look forward to your answers. Thanks again for your video; it's a great learning resource!

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

    Alternate title:
    Competing with Unreals Streaming system

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

    Great video I love this kind of technical in depth. I have a question though, doesn’t Unity have « Adressables » to manage the load and unload of assets very efficiently ?

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

      Addressables solve a similar problem but not exactly the same. They can definitely be combined with world streaming as well. One of the biggest memory hogs for Farewell North comes from static batching, which afaik can't be addressed with addressables. I'll probably add Addressables for things like render textures that currently just sit in memory at all times but are only needed in specific areas

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

    For the issue you commented around 08:30, have you considered something like potential view set? (PVS).

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

    new sub, I learned some new stuff thx

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

    I'm so glad I switched to dots now. The OO workflow is just chaos by default and Unity not having something like this (or at least validation) build in makes it worse.

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

    WOOHOOO!

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

    So... a fix to your problem.
    The K-nearest is likely to generate better results than manual at times. Why not use the groupings for scene organization for creation. And the K-nearest for the final output?

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

    What was your decision to use ECS Sub-Scenes instead of regular scenes? Have you experienced issues with having the GameObjects being converted to a ECS format?
    Great video!

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

      Oh that's unfortunate naming on my part, these aren't ECS subscenes they're just regular additively loaded scenes. I've taken to calling them subscenes because they act as children of the main scene for light baking, occlusion, etc purposes. So they don't really stand alone as their own scenes, if that makes sense.
      Sorry for the confusion!

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

      ​@@kylebanks hah no worries, it's hard keeping track of terminologies for new tech! Unity releases something each month it feels like.
      I really appreciate the video, the team and I are heading into streaming as well for our next game, exciting challanges to tackle!

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

      @@niklasmikkelsen4701 nice, good luck!

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

    Could ou show us hop you did the foliage (animated grass and trees)?

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

    Needed to spend more time on that coo

  • @Meow-or-Never
    @Meow-or-Never 2 роки тому

    Hello, I was wondering what kind of grass do you use? It seems to me you use a grass mesh and a custom shader? My own game has the typical unity grass and I just want to burn it, do you have any resources or guides as to how to achieve that beautiful, smooth and clean grass? Thanks!

  • @mariohaberle6147
    @mariohaberle6147 4 місяці тому

    [The reference part] "I don't trust Unity with references"... yeah, no... whilst I don't agree with you and referencing stuff in "on validate" is I'd say okayish to avoid awake fetching... what you should teach your self to do is creating lazy getters. ;)

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

    I love your game. Really nice way to async load scenes. What do you think about loading small chunks or even individual objects with Addressables?
    P.S: Thanks for the reference system, I always did OnValidate for every script, that was horrible.

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

      Tbh I haven't messed with addressables too much, but from my completely uneducated point of view it feels like it kind of solves a similar but distinct problem? I need to look into it more, but for things like render textures and assets that live outside of a scene, it makes a lot of sense

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

      @@kylebanks yeah, with addressables you can load and unload asynchronously any unity asset, prefab, scene, material, etc. Good luck with your project, can't wait to see more :)

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

    This is the part I fear most about gamedev

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

    Thanks, great video. How do you handle light map baking? Do you load all scenes and bake the whole world from a parents scene or something? Or is it mainly real-time lights?

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

      Glad you enjoyed! That's right, for all baking operations (lights, navmesh, occlusion, etc.) you bake from the main parent scene with all the subscenes loaded, and Unity knows how to distribute the data across the relevant scenes. So this also helps save memory as not all lightmaps are in memory at once, they load in and out with the child scenes.

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

    Could you please make a tutorial about world streaming?

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

    Nice vid! How do you make sure that no scene gets loaded twice? We sometimes have that occur since Unity does not have any way to see if a scene is already being loaded.

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

      Thanks! Yea that was an issue, I ended up writing a small wrapper around unity's scene class to track state like whether it's loaded, loading, unloading, etc.

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

      @@kylebanks We ended up doing the same 😅 Kind of weird of Unity to ignore this functionality!

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

      @@Haapavuo right? seems like an obvious missing piece in their api

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

    Sounds like a nice addon, but I ask myself what happens if you edit a property in a script that is used in various prefabs?
    If I remember correctly the OnValidate function is called only by opening the inspector on the gameObject, therefore, unless you visit each Prefab their component references will not be updated.
    I noticed you added an On-Click solution in the form of the editor button, but does that work with any instance of a script, even in prefabs?
    Thanks and congratulations on surviving 4 more months of development 👍

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

      I was a bit worried about the prefab workflow as well, but OnValidate gets called on all prefabs every time the domain reloads (ex. every time you change some code and compile), so it's not been an issue thankfully

  • @pencilman7566
    @pencilman7566 5 місяців тому

    I have to pay for the code? At least write it out so we have some way of developing our games without having to always pay for things. Would it be possible to share the code?

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

    Thanks for sharing, but was all this work worth it? Wouldn't World Streamer 2 have saved you boat loads of time and have been worth the $50 so you could focus on content?

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

      Yea, sometimes! I use plenty of off-the-shelf tools when it makes sense, but in this case I'm confident it was worth the effort (and definitely didn't take a boat load of time) as i'm able to get much more optimised than a general purpose tool could, which is very important for this game as it has no camera cuts from beginning to end, so there's no way to mask any suboptimal streaming. World Streamer also wouldn't solve the biggest pain point which was the scene awake framerate hitches.
      Assets are super handy and often make sense to use, but in this case I'm a programmer and this is a pure programming challenge, something I thoroughly enjoy and am quite good at, so it's worth leaning into that strength and gaining some advantages here to overcome weaknesses elsewhere.
      There's time spent learning and fighting with any new tool, but by spending a few days building something custom I've learned a new skill and have a new tool I can bring to any project that perfectly suits my workflow.

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

    wait, wtf, Unity does not have level streaming from the box? why does it even have?

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

      it's just so crazy to see people do so much unnecessary work and still accomplishing great things!

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

      It has the ability to stream levels (docs.unity3d.com/ScriptReference/SceneManagement.SceneManager.LoadSceneAsync.html), but it's up to you to decide when to load and unload based on your game and requirements.

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

    I feel like it shouldn't be based on position, it should be based on vision ; based on movement data, predict position of player into the future. If any object is visible from the player's future position, load it. Sort of like foveated rendering. That will handle occlusion and not require you to make fake islands.

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

      I've thought a lot of frustum and occlusion culling with streaming and utlimately don't think it's worth it. Streaming from the disk and unloading memory when an area's no longer needed are both expensive in their own right, so I'm finding it's a balance between frequently streaming small chunks but not too frequent that it starts introducing disk or GC bottlenecks. Doing something predictive would be cool, but most of my level design is circular or wide open areas so it's not going to be too beneficial for this game.
      The fake islands (imposters) are so I can crank up the render distance without impacting performance, so sort of a different thing. Basically just an extreme LOD.

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

    Are you using addressables or similar in order to load things in and out of memory? If you're splitting the world into chunks and loading unload via unity's sceneloader, no memory is released again.

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

      You can manually release all the unused assets after unloading a scene using Resources.UnloadUnusedAssets. It's not as efficient as Addressables but requires less management of individual assets

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

      @@kylebanks Cool, I'll have to look into that - thank you. A good performant world streaming system (that also doesnt hitch) seems to be the biggest hurdle for me at the moment, especially when dealing with a high amount of objects, textures, shaders etc.. And yes, addressables require a lot of management :(. The HLOD system on github does make use of them, but it seems to break when baking more complex arrangements.

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

    hey! can you show the process of making the animal fur? Im trying to achieve this "cartoony fur" and i cant even think where to start

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

      That's all the work of Fluffy Grooming Tool, a relatively new Unity asset that's fantastic

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

      @@kylebanks do you have any idea how to make this kind of hair in blender or unreal? i couldn't find any info about this cartoony look on thte internet

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

    I have one doubt, why you did not used occulsion culling, that would have been no effort optimization?

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

      Occlusion culling optimises draw calls but costs memory and CPU. World streaming saves all three. But I use both, they're not mutually exclusive

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

    What is that FPS monitor you have? Custom or program?

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

      It's an asset called Graphy, it's free iirc, been using it for years and definitely recommend

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

    blend into idle a little bit hard

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

    The 7 million quad instances should only take up a few MBs. And your rocks should be instanced, so ideally you only have a handful of rock models and each object just stores a model matrix. Did you try Unity's built-in LOD system? I think it does the streaming for you too. And you should avoid using Unity GameObjects for things.

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

      Couple comments talking about LODs now so let me try to quickly summarize without making another video :)
      1) All the positions for the grass, plus the terrain system, still take up memory.
      2) With static batching all combined meshes end up being unique, which is 3x-ed by LODs.
      3) I do use LODs, but they solve a completely different problem. They save draw calls/poly counts, but they don't stream and all those unique static meshes are still taking up memory, plus LODs take CPU cycles to calculate every frame. At a certain point LOD actually hurts performance if you don't use it carefully and end up with thousands of LODs calculating camera distance/screen size every frame.
      World streaming doesn't replace any of those optimisations, it's another optimisation to add on top which aims to reduce memory and CPU usage, whereas LOD only really helps the GPU.
      Almost every optimisation, LOD included, has upsides and downsides and should be used to target specific bottlenecks, so there's no one perfect solution for all your performance troubles.

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

      @@kylebanks Yah apparently Unity LOD does not handle the streaming too.
      You should only need a position per blade which would be 12 bytes x 7 million = 84 MB, that's not much really.
      And that's good that you are doing static batching, with static batching (I assume) the vertex data isn't actually kept on RAM, it's sent straight to the GPU, so the rocks and things shouldn't be taking up any memory either. I apologize as I think I may not understand the scale of your game, I still don't understand why you were getting such atrocious RAM usage, you must have thousands of little gameObjects everywhere in the form of loot or puzzles? Because some grass, terrain, and a few cows shouldn't take up 6 GB of RAM lol anyway I don't want to keep you busy, if it's my lack of understanding no need to explain it to me, I was just worried there may be something you are overlooking :)

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

      @@tristunalekzander5608 ohhh lol, that ram usage in the activity manager was an intentional leak to make it skyrocket just for the video. Real usage was like ~3gb or so.

  • @JonathanGorr
    @JonathanGorr 9 місяців тому

    Wouldn't additive scenes be a better solution than having a hundred gameobject parents in a single scene?

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

    I know its a bit random but... can you add a fox skin for the dog? I rellay like foxes :D

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

      There won't be a fox skin, but I can at least say fox fans will be happy with some of the things I've been working on 😊

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

    1st!

  • @Angel-eg8xm
    @Angel-eg8xm 2 роки тому

    WTF WE HAVE THE SAME FCKING LAPTOP!!!

  • @forasago
    @forasago 4 місяці тому

    The "remaining issue" should NOT be tackled. Don't do it. If you apply a new form of occlusion culling to your scene loading scheme you make the worst case (there is nothing to cull) run WORSE, which is the opposite of optimization. Occlusion culling in general is, shall we say, overprescribed in Unity. A lot of scenes actually run better if you don't cull, yet everyone recommends culling and people do it without comparing the performance.

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

    if you have lot of stuff, culling objects by bvh will make you draw pixels just once, even 4K has only 8M pixels, you dont have to draw 100M of pixels in vain, remove all over-draw

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

      and that 100M pixels is per bounce, for lighting/shadows

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

      bvh determines how much detail you have to draw, automatically, per ray/plane-ray(vertical plane ray cast)

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

      oh you are using unity, so you cant do your own draw routines, sorry

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

    Level of Detail: *exists*
    Kyle: Duh lemme spend 4 months making a complex asynchronous world streaming system.
    Level of Detail: ok.

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

      LOD is great and in use, but everything still lives in memory and eats CPU cycles calculating the screen size/camera distance for every single LOD object. When you start having thousands of 10s of thousands, they actually start hurting performance. The memory usage is also made much much worse by static batching where every mesh (x3 for your LODs) ends up being unique.
      There's no one perfect solution for performance, you utilise many tools (LODs, batching, streaming, imposters) where they fit best.

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

      Good job missing the point of the video.

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

    For occlusion you might wanna check this new asset: MF.SSGI - URP Screen Space Global Illumination - Occlusion & Raymarched shadows