Happy Sunday everyone! I hope this video helps to explain Octrees and gives you some ideas for how you can use them in your projects!
@mikecu2249
6 сағат бұрын
Damn, thats some premium Video right there! This is of high quality on a very complex topic, with the best being its HANDS ON! Great video!
@git-amend
5 сағат бұрын
Thanks for watching!
@inrage7871
20 күн бұрын
This channel is gem! Thank you for your content 😍
@git-amend
20 күн бұрын
Thank you!
@silchasruin4487
18 күн бұрын
I cannot tell you how great the material you're teaching is. Clear and concise while being quite simple for the layman. Some of the concepts you touch on sometimes sends me off into a rabbit hole. Such as using bit masking in your ternary operators. On another note, I once stress tested quad trees by instantiating 10k objects and activating the closest ones based off of player position. The nested for loops didn't do the FPS any favors. I learned very quickly about time slicing your operations. Also your recent utility AI video has really inspired me with simplifying behaviors. Really looking forward to seeing what you have in store next. You're a veritable gold mine of inspiration.
@git-amend
18 күн бұрын
Really appreciate that! Bit masking can definitely lead to some fun rabbit holes. Glad to hear the utility AI video inspired you-more content like that coming soon!
@bhaktijpatil
16 күн бұрын
I would really appreciate a tutorial on how to work with a large number of gameobjects like voxels in worlds which demand them and the optimizations you can leverage for such cases, thanks for the existing videos too.
@VikingPingvin93
20 күн бұрын
I can't even keep up with all of these videos you are making! It's one thing to watch them, completely different understanding them. Thanks for all your work!
@git-amend
20 күн бұрын
Thanks so much for watching! Take your time with the concepts, and feel free to ask questions if anything’s unclear!
@techdave99
19 күн бұрын
It's another thing to make them. Imagine the hours spent on each video. Wish i had the money to pay for it. Hope git-amend doesn't burn out.
@jtudela1
18 күн бұрын
6:08, That OctreeNode constructor algorithm to generate the 8 quadrants of the inner cube is a thing of beauty. It has been 25 years since I took a programming course in college, but if that is not taught in school it should be! It might be well known as a way of doing this among expert developers, but should be introduced in data structure classes or other lower level programming courses. The way you handled the 3D space but using bitwise math is genius. Bitwise math is underused IMO. I love to use them for flags for gamestates instead of a bunch of booleans everwhere. Especially narrative heavy storylines and branching dialogs.
@git-amend
18 күн бұрын
Thanks for the kind words! Bitwise operations really are a hidden gem for optimization! They’re so powerful once you get the hang of them! Sadly, I don't think that kind of thing is taught much in school anymore.
@NihongoWakannai
19 күн бұрын
I just recently watched the GDC talk from warframe devs about octree 3D pathfinding and now you release this video lol GDC 2015: Dan Brewer - "Getting off the NavMesh: Navigating in Fully 3D Environments"
@git-amend
19 күн бұрын
Oh, I haven't seen that one... will look it up.
@gamheroes
19 күн бұрын
You listened to my prayers and made the video I requested! :O Cheers to you!
@git-amend
19 күн бұрын
Hey no problem, hope you find it helpful!
@TheArghnono
20 күн бұрын
Nice explanation, clear code and an oddly satisfying spaceship loop 🙂
@git-amend
20 күн бұрын
Glad you enjoyed it! I caught myself watching the loop for quite a while last night lol. 😄
@정동우-n2x
20 күн бұрын
It took me a month to implement quadTree, which is amazing. I always learn.
@git-amend
20 күн бұрын
Nice, hope you like this vid!
@정동우-n2x
20 күн бұрын
@@git-amend I like all yours videos, not just 'this vid'!
@ZombieGrinder60k
18 күн бұрын
Would be really great if you can make a job system compatible version of this. Great content as always.
@git-amend
18 күн бұрын
Not a bad idea, I'll give that some thought.
@frontalachivment3604
19 күн бұрын
How this is possible that you are only one on KZitem who do this kind content. What does it tell about other authors who stuck at "this is function, ok? This is how you create monobehaviour?" level :D There is so many of them they have 200k+ subscribers and look like they learn with audience basics pretending being expert xD
@git-amend
19 күн бұрын
Well, it's true that there is a ton of beginner content out there... but there are a few other creators out there that do more advanced topics regularly. Check out Warped Imagination and Iain McManus if you haven't yet!
@simonnordon8421
19 күн бұрын
@@git-amend It makes me feel like 'advanced' unity is quite niche.
@NihongoWakannai
19 күн бұрын
You should watch GDC talks, there's one on this exact topic GDC 2015: Dan Brewer - "Getting off the NavMesh: Navigating in Fully 3D Environments"
@hop3studio511
19 күн бұрын
@@git-amend super agree, at the curent time, you and warped imagination and also lain mc manus are the best source for advanced unity tutorial in my mind, there's also other cover advanced topic, but many i see no longer make video Also i found sharp accent
@janus798
19 күн бұрын
Oh man, this would've been incredible like a year ago when I was designing a 3d pathfinding system. Settled on low precision voxels due to time constraints, but I always wanted to refactor it with octrees
@git-amend
19 күн бұрын
Well, voxels are a good way to go too, just a little simpler I guess.
@techdave99
20 күн бұрын
When I first read the title, I thought that I might have to go outside. But then I remembered that Octrees are in the computer. Yay, don't have to go outside!
@git-amend
20 күн бұрын
🌲
@Xeros08
20 күн бұрын
And that they are also upside down!
@TrentSterling
19 күн бұрын
Wow, this technique can be used for many things. Performant Astar based audio occlusion here I come!
@git-amend
19 күн бұрын
I hadn’t thought of that! What an interesting idea!
@zimnelredoran9985
20 күн бұрын
Thank you for the top notch content! Very interesting topic :D Made my Sunday ; )
@git-amend
19 күн бұрын
My pleasure!
@simonnordon8421
19 күн бұрын
Another great video. Top Quality content.
@git-amend
19 күн бұрын
Much appreciated!
@Novacification
2 күн бұрын
I can't believe it's been this difficult to find your channel! KZitem search has really become useless. Best bet is to search for nothing else than in-depth videos on game dev algorithms and concepts for several days and then clean your feed with the "not interested" option for a week. Finally, the algorithm starts getting desperate enough to stop the doomscroll-bait and get to the good stuff. I think I'm close to have watched all your videos since I found your channel yesterday. Most of them I even watched multiple times. If I wasn't such a dummy, I would have spammed each video with comments for the algorithm. You and Sebastian Lague are easily the two best creators for more advanced game dev topics in my opinion. I can't wait to get started on modelling NPC behavior and making my own nav mesh implementation for map textures this weekend (now that I indirectly learned about quadtrees). If you can make some videos on how to efficiently simulate a simplified set of daily actions for 4 million people then you will have solved all my problems :) Actually, I would generally love to see some videos focused on performance if possible. I need to simulate a lot of things and the more efficient I can do it, the more I can do. There's probably a lot that can be gained by nerding with data structures, such as Struct sizing for memory alignment and optimizing cache availability. Or maybe the Octree implementation could be optimized. I don't know how wide the appeal would be for that or if it's even something you know anything about but there's shockingly little practical information on this, that I have found.
@git-amend
Күн бұрын
Thanks so much for the thoughtful comment! I’m really glad you found the channel and enjoyed the content-that means a lot. I completely get the frustration with the KZitem algorithm, and it’s awesome that you’ve already dived into so many of the videos. Also, no worries about adding comments to every video, as far as I understand it's a much bigger algorithm boost to have viewers watch multiple videos on the channel in a row. And big shout-out for putting me in the same sentence as Sebastian Lague. I’m a huge fan of his work too! I'll likely be talking more and more about DOD and optimization as we move forward.
@DarthBiomech
19 күн бұрын
This is cool! I suppose, to make route look more organic, you'd need some kind of optimization algorithm? Something like tracing between nodes to see if they're occluded or something
@git-amend
19 күн бұрын
Yes, a good strategy for real time optimization would be to check if direct routes between nodes are clear, skipping unnecessary nodes for a more organic and direct path.
@relinqu1shed
20 күн бұрын
This channel is like school, but interesting and educational!
@git-amend
20 күн бұрын
Haha thanks!
@miltgmend
20 күн бұрын
insane. I was looking for this.
@git-amend
20 күн бұрын
Perfect timing! Hope it helps you out!
@SubatomicPlanets
19 күн бұрын
I only discovered your channel a week ago or so from a comment on reddit. I immediately subscribed! I especially love this video because I recently looked into this sort of thing. You are clearly very talented, so I wanted to ask if you could make this or something similar an asset? I would like a 3d navmesh that also works on low end devices and uses little storage. I recently looked up this sort of thing for my game but there is no simple asset right now I think. Thanks for the video anyway, it's very cool!
@git-amend
19 күн бұрын
Well the problem with making Assets is that you have to also support and maintain them - something I don't have time for at the moment. Another subscriber mentioned they have an Asset already on the store that does something similar though, but I'm not sure the name of it.
@retroman7581
20 күн бұрын
Uh, interesting topic! :D
@git-amend
20 күн бұрын
Thanks, hope it's useful.
@starplatinum3305
19 күн бұрын
bro cooked 🗣🔥🔥🔥
@git-amend
19 күн бұрын
Thanks 💯
@iozsaygi
19 күн бұрын
Great content, quick question. Considering A* already considering nodes that ara adjacent/neighbor, does it makas sense to use Octrees for that? AFAIK A* already clips the search space.
@git-amend
18 күн бұрын
Octrees reduce the total number of nodes A* needs to consider, especially in large 3D spaces, by focusing the search on relevant areas. It’s like the difference between searching through a uniform voxel grid versus a space that’s subdivided only where more detail is needed.
@gamheroes
19 күн бұрын
¡Gracias!
@git-amend
19 күн бұрын
Thanks for the super!
@nein3405
19 күн бұрын
Thanks!
@git-amend
19 күн бұрын
No problem! Thanks for the super!
@mikekozlov3484
20 күн бұрын
That's very cool, I actually sell on Asset Store an asset that does exactly that.
@git-amend
20 күн бұрын
Oh yeah? Which one, I'll check it out!
@mikekozlov3484
13 күн бұрын
@@git-amend "3D Space Pathfinding"
@zanolsena
11 күн бұрын
This video is fantastic, I've been trying to write a truly 3d navigation system for flying AI in my game and this is giving me exactly the results I couldn't achieve myself. I do have an issue though: when I enter play mode, it takes like 1 minute to actually load in. I only have 7 objects (ProBuilder objects of different shapes) in the OctreeGenerator. Any tips for reducing that time? Is there maybe some way to generate a tree for an area in the editor instead of at runtime?
@git-amend
11 күн бұрын
The Octree calculation in this video is near instantaneous. I think you should review your code if it is taking an entire minute to calculate... find out how deep the recursion is going and if there are other things causing the delay.
@zanolsena
10 күн бұрын
@@git-amend I reviewed everything and did find a couple of bugs which greatly improved performance when fixed. As for the time, its improved, but still takes around 45 seconds. I tested it on some cubes like in your video and it worked near instantly, so I can only assume the issue lies in that I'm using probuilder objects...which is worrisome for just how useful this will be to my project, since I'm using a lot of ProBuilder and Realtime CSG objects for the game world.
@glennmerrill88ify
19 күн бұрын
How would you handle moving objects within the tree? I've been looking into Quad Trees recently and generally the simplest thing to do is just regenerate the entire tree on update, would this same thing apply for Octrees? Great video by the way, always look forward to your videos.
@dav1dsm1th
19 күн бұрын
Yes, unfortunately, you'd have to regenerate the octree each frame (or once the data is considered stale) as the performance gained using the octree is inherent in the structure of the tree. But this can still be quicker than brute force testing the distance to all objects of interest in a scene. You could also have two octrees, one in use and one being populated on another thread - and then swap which one is active (in the same way a GPU uses double buffering).
@nein3405
19 күн бұрын
if your whole world is so dynamic that everything changes all the time then yes. i doubt it actually is tho, you probably have a lot more static objects which are relevant for actual pathing than dynamic ones. so no, you dont necessarily need to regenerate the whole tree each frame, you can just handle dynamic objects differently.
@damonfedorick
19 күн бұрын
Nice!
@git-amend
19 күн бұрын
Thank you! Cheers!
@bluzenkk
20 күн бұрын
i wish you made this video 10 years ago... so i dont have to learn this the hard way 10 years ago.
@git-amend
20 күн бұрын
Right? If only I had a time machine!
@techdave99
20 күн бұрын
less than 400 views in the first hour. Hope it still gets as many views as last week's video.
@git-amend
20 күн бұрын
Haha they can’t all set new records, this one is doing pretty good.
@Smartoyunda
15 күн бұрын
When I follow the same steps as you and write the code myself, it does not draw the gizmos in the same way, I could not figure out why.
@git-amend
15 күн бұрын
You can check against the repository, link is in the description.
@Smartoyunda
15 күн бұрын
@@git-amend i did. Your code absolutely fine but its same with my code but i dont know why not work the same
@Kerphelio01
12 күн бұрын
@@Smartoyunda I have no idea, and it may be silly to even suggest - but do you have Gizmos enabled in the view options of your scene view? I've forgotten that I had disabled them in the past, and afterwards felt stupid enough to remember :D
@Smartoyunda
12 күн бұрын
@@Kerphelio01 its enabled. I have some visual boxes but not the same as in the video.
@RonaldMcDonald-o5z
19 күн бұрын
For the algo!
@git-amend
19 күн бұрын
Thank you!
@techdave99
20 күн бұрын
Wondering what might be useful to determine if an animation should be done/rendered based on the player's distance. Anyone have an idea?
@mikekozlov3484
20 күн бұрын
Nah, building an octree is extremely expensive for computation, you can't rebuild it very often.
@techdave99
19 күн бұрын
@@mikekozlov3484 Turns out that Unity has a culling mode for animation. just had to look on the animation component.
@enbawatches
20 күн бұрын
This comment is just some food for the algorithm
@git-amend
20 күн бұрын
This reply as well then 😁
@RoxGame
19 күн бұрын
Just a stupid question: can this system be integrated as a node in a Behavior Graph?
@git-amend
19 күн бұрын
While both are node based systems, I think the purpose is a bit too different. An Octree is mainly used to divide up space and not specifically for processing logic.
Пікірлер: 92