Advanced Unity3D tutorials to help get your game in front of your playtesters faster!
Build your indie game like an expert with: - comprehensive core mechanics - programming patterns - proper architecture - software engineering principles - advanced C# language features
Learn how to take your game from concept to playtest from a: - Unity Insider & Certified Unity Professional Programmer
New videos with source code every week!
🔔 Subscribe and hit the bell to get notifications!
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.
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.
Awesome video, awesome channel. Thanks very much, man! If anyone doesn't see the Guid value in the inspector, is because a PropertyDrawer class is showing that, called something like SerializableGuidDrawer.cs. You can find it in his repository (which he mentions on the video Description)
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
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.
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"
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.
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).
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.
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!
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.
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.
How this is possible that you are only one on RU-vid 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
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!
@@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
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 Oh, OK. For some reason I thought you had stopped somewhere along the way (cost!), maybe due to the way you have the interface set up. I really like Rider, but by George they like to charge you for it.
@@git-amend ahh.. that was not on my radar. I don't use Unity or Rider enough these days to consider that, but perhaps this could be useful info for others.
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!
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!
A small suggestion: When you're using non-standard methods, please tell us where they are coming from. Took a while to find InRangeOf(). Just a quick mention of which class it is in would be nice.
The only thing that's not right about this video is the name you used for your spline follow class, it should be AwesomeFollow instead of SmoothFollow 😆 I do like that they split the components up more
Hey @git-amend, marvelous video as always. Thank you so much! I had a few questions though. Whenever you Register and create your bindings on OnEnable, wouldn't that mean that the Binding field would get overridden each time the game objects gets enabled? My intuition tells me that creating the binding should live inside Awake(), and Registering / Unregistering should live inside OnEnable() and OnDisable() respectively. Other question is: what is the gain from adding the IEventBinding<T> layer to the architecture? Couldn't we just use Action<T> and Action? Or at least make the whole IEventBinding logic private to the EventBus, so it's encapsuled inside of it. Moreover, IEventBinding does not have the `event` keyword, meaning the event could be overwritten or set to null by anyone manipulating an instance of IEventBinding. What are your thoughts about that? Thanks again!
Some interesting questions with no concrete answers. The video is not meant to be the epitome of all Event Bus implementations, in fact it is not because I have not included the full functionality in the video or the repository to keep it simple. Where you create bindings and handle registration depends entirely on your own project. The reason I have a layer of abstraction via the EventBindings is so I can also have extra features such as logging and debugging, or even change the underlying delegate without affecting the entire solution.
This is one of the few channels who dont just show how to do things in a beginner way, but how to up your game, its a very valuable channel and really should be way more popular. I like that nearly every video is self contained enough that you can go there, view a thing, decide yes, i want that, and then go off and implement the thing in a project without too much of the oh, you need to have 15 other videos worth of stuff in the project before it even dreams of working
looks awesome. One question I have: How good is the performance of this? What if I want to create 2D scenes with about 500 agents, controlled by behaviour graphs?
I haven’t done any massive tests like that, but you will get an answer quickly if you ask in Unity Discussions under the release thread discussions.unity.com/t/behavior-package-1-0-1-is-released-update-1-0-2-is-out/1521797
@@git-amend Got an answer: "The performance should be good in general, we are following best practices & we should be not creating to much garbage or overhead at runtime. 500 agents will be fine." So, let's hope for the best.
I love this, but the problem is you cant have dependencies to your own packages, the package manager just doesnt support Github links as dependencies. It has to be the com.packagename.etc format. And its very frustrating for a modular packaging setup. Im still trying to figure out a solution, and i think the cloest ive gotten is via hosting your own com. packages using docker, but i didnt quite get it to work, but i do think that is the highest chance of getting this to work. I'd love some advice here! And as an example of what i want, Say i have a package that gives me the foundation for creating templates, but then i have multiple subpackages, all of them needing just one template, but i dont want all of them to have the whole template boilerplate code
Why don't you just import them sequentially, dependencies first. For example, if I had my own package that depended on UniTask, I would put UniTask first on the list of imports, followed by my custom package that depends on it.
@@git-amend Ideally I'd just have one package because the dependencies could theoretically end up being many and it's a hassle. However I hadn't thought of something that simple and it might be an acceptable workaround! I will give it a try, thank you!
Note if you put your Player (Hero) on the DontDestroyOnLoad level: "It seems like the issue you're encountering is due to the way Unity handles objects marked with DontDestroyOnLoad. Specifically, your Hero object is a singleton that persists across scene loads because of the DontDestroyOnLoad(gameObject); call in its Awake() method. This causes it to reside in a special scene called the DontDestroyOnLoad scene, which is not part of the active scene hierarchy. When you use FindObjectsByType<T>() or FindObjectsOfType<T>(), these methods typically search only within the active scene's hierarchy and do not include objects in the DontDestroyOnLoad scene. As a result, your Bind<T, TData>() method in SaveLoadManager is unable to find the Hero instance, and thus the Bind call doesn't link up the IBind data as expected."