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.
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.
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...
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...
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!
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 🥰
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.
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
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.
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.
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")
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!
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
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
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
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 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!
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.
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
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.
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.
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.
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
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!
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!
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 ?
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
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.
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?
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!
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!
@@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!
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!
[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. ;)
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.
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
@@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 :)
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?
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.
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.
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.
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 👍
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
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?
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?
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.
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.
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.
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.
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.
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
@@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.
@@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
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.
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.
@@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 :)
@@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.
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.
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
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.
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.
Code iteration and optimisation is so satisfying when you get it all right.
It's honestly some of my favorite stuff to work on
For the teeeny tiny subset of people who will be implementing world streaming in their own projects - this was dope. Thanks!
lol not like I have a choice...
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.
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...
Optimizing is a lot harder for bigger games than you would think.
@Twenty zero One ok how many AAA game have you worked on?
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...
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!
Oh wow what a kind comment, thank you! I'm so glad these devlogs could be any help or inspiration for you :)
This video is the dark side of game dev. Working thousand hours for something needed that the player will never see ;), very nice video !
Love watching this develop into an amazing game. (also love the orange cow thing)
Hahah the orange cow thing
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!
It was well worth the effort to bring you guys an accurate count ☺️
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?!
Haha I wouldn't say a tease, definitely a lot of love left to put into Farewell North before working on anything else!
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 🥰
Thank you! Glad you enjoyed them 😊
So you made occlusion culling?@@kylebanks
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.
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
Don't stress it too much, just tackle one thing at a time and it's much more approachable
@@kylebanks i dont know where to start from, would love some guidance
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
It's not too tricky once you dig into it, but there are a few workflow changes to get used to. Good luck!
This is one of the smartest Devlogs! Great to see another solution to a major task of Open World games and scenes.
Glad you enjoyed :)
Hey Kyle thank you for the great video! I am glad to see you're making good progress!
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
Awesome! I'll have to check out the video, do you remember which one it was?
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.
Thank you, that's really kind of you to say
@@kylebanks No problem dude!
Started using your SceneRef Attributes thanks for the repo! Great job as normal.
Oh awesome! Hope it's working well for you
devlogs like this are really interesting and informative. thanks for sharing
I'm very happy to hear that, I always worry about doing too much technical stuff in devlogs
the new updates might not show in the actual game or video but it is a very important change, good job!
Thanks!
You should add some narwhals or some kind of ocean animal! Great video btw! 💛
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.
Thanks! It's open source so feel free to just steal mine ☺️
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")
nice solution to the stuttering!
Nice work dude! This looks fantastic!
Thanks!
Super interesting video as always! Will definitely use the auto setup attribute! 🙏
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!
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
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
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
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!
You can! Sheep, cattle, and even duck herding is part of the game as he's a working dog 😊
@@kylebanks Oh wow, that's awesome to hear!
@@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!
Love this series been here since episode 1
Thanks for the support!
Very impressive tech behind this game
Amazing dev log 👌
Thanks Lukas!
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.
8.5+gb of mem to 1.2gb roughly... Thats freaking awesome :D WELL DONE!
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.
Looking good!
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
Same question
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.
Thanks for sharing this. I'm probably going to need to do something similar pretty soon.
good luck! it's a pretty fun little challenge to get a system that works well for your workflow
looks like a game that will be loved! ❤
Thanks!
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.
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.
now I have to learn all this
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
the game looks realy good, keep up the good work😁👍
Thank you!
You are an amazing programmer
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!
Great solution, liked and subbed :) Any progress on the occlusion problem ?
this is so cool!
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
I'm a mac user primarily myself, so I feel your pain :(
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!
Alternate title:
Competing with Unreals Streaming system
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 ?
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
For the issue you commented around 08:30, have you considered something like potential view set? (PVS).
new sub, I learned some new stuff thx
Awesome, thank you!
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.
WOOHOOO!
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?
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!
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!
@@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!
@@niklasmikkelsen4701 nice, good luck!
Could ou show us hop you did the foliage (animated grass and trees)?
Needed to spend more time on that coo
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!
[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. ;)
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.
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
@@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 :)
This is the part I fear most about gamedev
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?
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.
Could you please make a tutorial about world streaming?
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.
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.
@@kylebanks We ended up doing the same 😅 Kind of weird of Unity to ignore this functionality!
@@Haapavuo right? seems like an obvious missing piece in their api
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 👍
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
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?
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?
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.
wait, wtf, Unity does not have level streaming from the box? why does it even have?
it's just so crazy to see people do so much unnecessary work and still accomplishing great things!
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.
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.
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.
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.
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
@@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.
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
That's all the work of Fluffy Grooming Tool, a relatively new Unity asset that's fantastic
@@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
I have one doubt, why you did not used occulsion culling, that would have been no effort optimization?
Occlusion culling optimises draw calls but costs memory and CPU. World streaming saves all three. But I use both, they're not mutually exclusive
What is that FPS monitor you have? Custom or program?
It's an asset called Graphy, it's free iirc, been using it for years and definitely recommend
blend into idle a little bit hard
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.
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.
@@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 :)
@@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.
Wouldn't additive scenes be a better solution than having a hundred gameobject parents in a single scene?
I know its a bit random but... can you add a fox skin for the dog? I rellay like foxes :D
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 😊
1st!
WTF WE HAVE THE SAME FCKING LAPTOP!!!
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.
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
and that 100M pixels is per bounce, for lighting/shadows
bvh determines how much detail you have to draw, automatically, per ray/plane-ray(vertical plane ray cast)
oh you are using unity, so you cant do your own draw routines, sorry
Level of Detail: *exists*
Kyle: Duh lemme spend 4 months making a complex asynchronous world streaming system.
Level of Detail: ok.
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.
Good job missing the point of the video.
For occlusion you might wanna check this new asset: MF.SSGI - URP Screen Space Global Illumination - Occlusion & Raymarched shadows