Awesome video, great delivery and easy to understand. Would like to see a continuation on how to add additional belts by left clicking and rotating the belt by right-clicking. Something similar like the end of your video where you placed additional belts.
Well we hear it a lot almost everywhere that Raycast is very heavy and affects the performance of the game and it must be used very carefully. So the way you made this, if a game let's say has 10,000 belts you're using the Raycast 10,000 times per frame
Hey Pedram, You're right - having multiple thousands of raycast is super costly BUT only if you're blocking the main thread, there are many ways to improve the existing script, for example; you can make the ray casts be asynchronous to not block the main thread. Saying that, since we are only ray casting if a belt does not have a "next belt" the performance hit will be minimal as the ray casting isn't enabled on those belts. Hope this clears it up :)
@@CodingWithRus I've also used a grid system with dictionary, list or a hashset to basically check if "current position + direction 1 step" has an object. I have no idea which is the better option to do, but at least I've had good success with that in a smaller game where the game world is something like 30x30 steps.
Hey @@oatcube3961, It really depends on how far down the optimisation rabbit hole you want to go. For this you'll really need to know your data structures. IMO - list are the least optimised (let alone the chance of repeated elements) but rather the way it's used. Lists use a basic Array under the hood with search algorithms (which you can argue that most do anyways) BUT, have a read of this and I think it'll point you in the right direction: theburningmonk.com/2011/03/hashset-vs-list-vs-dictionary/#:~:text=However%2C%20it%27s%20important%20to%20remember,if%20you%20need%20to%20perform Hope that helps! Rus
@@CodingWithRus Thanks for the link. Actually meant array rather than list. Still a noob when it comes to performance but have been tinkering with a lot of things.
Apologies! I keep referencing IntelliJ (I use it for work). The IDE that I'm using is called Rider :)
Awesome video, great delivery and easy to understand. Would like to see a continuation on how to add additional belts by left clicking and rotating the belt by right-clicking. Something similar like the end of your video where you placed additional belts.
Welcome back
Good to be back :)
Very good video i like see game systems under the hood
Thank you very much, im new to unity and your video helped alot.
Oooo could you do a follow up tut on something like a smelter?
Would love to make a factorio style game for myself
I'll pencil it in! Thanks for the suggestion :D
@@CodingWithRus Keep up the mazing work \m/
can you a make a fall of terrain generation tutorial next
Hey, do you have an example?
@@CodingWithRus ruclips.net/video/XpG3YqUkCTY/видео.html something like here how we can adjust where the fall of or like the terrain turns flat
When I tried to download the file it restarted the seen! now I lost months of progress! does anyone know how to see the save history or something?
sadly no, but situations like this is where Version Control Systems come in. Git is the most common, but Unity does come with Version Control too now
PePe come back pls stream again
I shall return soon!
Did you know how to make conveyor like in satisfactory?
I can try to create a tutorial for it as a remake episode! Thanks for the suggestion:)
Well we hear it a lot almost everywhere that Raycast is very heavy and affects the performance of the game and it must be used very carefully.
So the way you made this, if a game let's say has 10,000 belts you're using the Raycast 10,000 times per frame
Hey Pedram, You're right - having multiple thousands of raycast is super costly BUT only if you're blocking the main thread, there are many ways to improve the existing script, for example; you can make the ray casts be asynchronous to not block the main thread. Saying that, since we are only ray casting if a belt does not have a "next belt" the performance hit will be minimal as the ray casting isn't enabled on those belts. Hope this clears it up :)
@@CodingWithRus I've also used a grid system with dictionary, list or a hashset to basically check if "current position + direction 1 step" has an object. I have no idea which is the better option to do, but at least I've had good success with that in a smaller game where the game world is something like 30x30 steps.
Hey @@oatcube3961, It really depends on how far down the optimisation rabbit hole you want to go. For this you'll really need to know your data structures. IMO - list are the least optimised (let alone the chance of repeated elements) but rather the way it's used. Lists use a basic Array under the hood with search algorithms (which you can argue that most do anyways) BUT, have a read of this and I think it'll point you in the right direction: theburningmonk.com/2011/03/hashset-vs-list-vs-dictionary/#:~:text=However%2C%20it%27s%20important%20to%20remember,if%20you%20need%20to%20perform
Hope that helps!
Rus
@@CodingWithRus Thanks for the link. Actually meant array rather than list. Still a noob when it comes to performance but have been tinkering with a lot of things.