Тёмный

🚗 Neural Networks and Genetic Algorithms for a Self Driving Car in Unity [Part 1/3] 🚗 

AJTech
Подписаться 8 тыс.
Просмотров 38 тыс.
50% 1

A fully self driving car in Unity from scratch using Neural Networks and Genetic Algorithms! Yes I said from scratch, we will be coding everything ourselves so that you can understand from the base up how everything works. I have been working on this video for quite a while to make it the best I can for you ❤ Of course you can apply all of these concepts and techniques into your own games, research and simulations.
PROJECT FILES (PLUGINS & COURSE) + COMPLETED PROJECT :
☢ github.com/AJTech2002/Self-Dr...
PART 2 : • 🚗 Neural Networks and ...
* NEWS : Welcome to the community!! I want to congratulate everyone on reaching 1800 subscribers, this is a collective accomplishment and I thank you all for your support. *
Firstly I would like to apologise for the late upload times I know I announced this video a while ago, I really wanted to polish up the system before I shared with everyone :)
❤ 2019 calls for more social media & interaction with you guys so check me out on ❤ :
====================================================
✄ / codewithajay ✄ [TWITTER]
- Daily Game Development Content, tips, motivation, updates on the game & just about my very 'interesting' life.
====================================================
----- LETS TRY AND HIT : 25 LIKES ✌ ---------
★ Upcoming Videos :
- Open World Series Part 5 ❤
- A* Pathfinding Remastered
✄ LINKS MENTIONED IN VIDEO ✄ :
GENETIC ALGORITHM RESOURCES
☢ blog.sicara.com/getting-start...
FEED FORWARD NEURAL NETWORK RESOURCES
☢ towardsdatascience.com/a-gent...
☁ In this video we begin our journey by creating the first of the three scripts, the Car Controller which is a script that provides the inputs to the neural networks, calculates the fitness function for the genetic algorithm and does the most important job of moving the car itself.
◕‿◕ The next part is even better and in order for you to see it you have to subscribe and tap that bell icon to be notified :
►► ru-vid.com_... ◄◄
☾ Stay tuned for the next episode, I will be releasing new videos once every 5 to 6 weeks discussing what I have done over the course of the weeks, always giving you some good entertainment with some knowledge on how you can tackle complex challenges in your own games! (◕‿-)
I'll see you next time ✌
✄ IMPORTANT LINKS YOU SHOULD CHECK OUT ✄ :
DEV LOG PART 1
☢ • Video
DEV LOG PART 2
☢ • Video
DEV LOG PART 3
☢ • Video
CUSTOM CHARACTER CONTROLLER TUTORIAL
☢ • (01) Stealth Game - Cu...
INVERSE KINEMATICS SERIES
☢ • (05) Stealth Game - In...
♬ MUSIC ♬ :
☮ Wayr - Follow the light
► CORE VIDEOS ►:
✌ Unity Trailer
If any of these videos or music belong to you and you wish for them to be taken down, please email me at : ajays.workemail@gmail.com
Thank you, for watching guys :)
#unity #ai #neuralnetwork

Игры

Опубликовано:

 

5 июл 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 101   
@pataQtasuxumuxu
@pataQtasuxumuxu 4 года назад
First time I tried to learn writing a game in Unity and truly an amazing tutorial! Really good job man and thanks a bunch! You have earned my subscription for future vids :)
@modernistt
@modernistt 5 лет назад
He protecc, he attac but most importantly, he bacc
@marcreinert4790
@marcreinert4790 4 года назад
Thanks for this tutorial I actually learned a lot new Unity functions from this video and your explanations made perfect sense to me
@loganrego6893
@loganrego6893 5 лет назад
Hey uh, I just turned 18. You're a few years younger than me, and I'm so impressed and inspired by the amount of knowledge and dedication you have to programming and coding. I just want you to know that it's inspired me to finally try it out for myself, and hopefully, I can catch up to you one day. Thank you.
@brendanhannum5904
@brendanhannum5904 2 года назад
This is completely awesome
@WillDev
@WillDev 5 лет назад
You should have more subscribers. Your content is amazing
@batchprogrammer108
@batchprogrammer108 5 лет назад
Thank you very much :)
@WillDev
@WillDev 5 лет назад
@@batchprogrammer108 do you self learn all this stuff?
@batchprogrammer108
@batchprogrammer108 5 лет назад
@@WillDev Yes I do, but luckily there are heaps of resources online that are very detailed
@WillDev
@WillDev 5 лет назад
@@batchprogrammer108 ah i see
@saneblack2671
@saneblack2671 4 года назад
I think Fixed update is useful for physics calculations, because unity made this function to be related to their physics calculation thread, but update goes 60 fps, they both go at constant speed (in theory), btw Good VID!
@Real_MrDk
@Real_MrDk Год назад
to the point .... excellent brother
@lukass1604
@lukass1604 4 года назад
This is amazing and u are very pleasant :)
@r8Rusoski
@r8Rusoski 3 года назад
Beautiful
@amirmadjour9561
@amirmadjour9561 4 года назад
Keep it going
@batchprogrammer108
@batchprogrammer108 4 года назад
ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-VYQZ-kjP1ec.html
@rajinhossain9522
@rajinhossain9522 5 лет назад
@ItIsBeats
@ItIsBeats 3 года назад
been making my own race course in blender for some experience, would this still work if i had a mesh collider on my plane where the grass is instead of a separate cube on the outside of the track pls?
@GameJarne
@GameJarne Год назад
This video helped me out so much, tysm! I do want to suggest you to not use variables like “v” or “h”, you don’t need to make your code compact, you should make it readable. Never use a single letter for a variable name! Also hardcoding is fine imo, but to make it easier to know what the values mean, you can declare variables in the function instead.
@nonenone7285
@nonenone7285 4 года назад
thank very very much ☺
@adriantili6918
@adriantili6918 5 лет назад
About totalDistanceTraveld , you could initiate lastPosition with startPosition then in colision before reseting it you give to lastPosition the transform.position so like this you calculate the distance between starting point and colision point in one go not every frame
@batchprogrammer108
@batchprogrammer108 4 года назад
The problem with this is, since it's a circular course if I did this then it would provide an inaccurate distance value because Vector3.Distance calculates a straight light distance. It will actually calculate displacement not distance
@thanos_n9s145
@thanos_n9s145 5 лет назад
One question I'd want to ask... I want to spawn the car where I crashed it last time, would you please create any video connected with that?
@thefallaeffect5371
@thefallaeffect5371 3 года назад
love his vids he should hacve more subs
@az1334
@az1334 3 года назад
Hi, to import the blender course, you need to have blender installed on your machine.
@prafulbs7216
@prafulbs7216 4 года назад
you should make a video on setup environment first[Downloads, software's, etc]. Please do that it will help full.
@ujjwalsingh5188
@ujjwalsingh5188 4 года назад
nice bro
@acropolise1319
@acropolise1319 4 года назад
Do the Cars able to drive in Slopes and Ramps? Please answer!
@TheAstrocricket
@TheAstrocricket Год назад
AJTech: I'm going to change the color of the grass because it is hurting my eyes. Also AJTech: *uses lite theme*
@user-qw2vo5tg2d
@user-qw2vo5tg2d 4 года назад
which video inspired you?
@usrnewxnew5227
@usrnewxnew5227 2 года назад
instead of moving the car manually couldn't you use h and v as inputs to wheelcolliders?
@user-dz9yw1xk3g
@user-dz9yw1xk3g 3 года назад
Hey Thank you for your tutorial video. but some how my car isn't forwarding, Time Since Start is resetting.
@mircea1233
@mircea1233 5 лет назад
Good, good, this is something we also need, but ah.. , where's the world manager we all are waiting for?
@batchprogrammer108
@batchprogrammer108 5 лет назад
It's coming :D I know it's taking a while, but really it's one of the harder systems and I will release one entire dev log just on that.
@shivanshsaini1
@shivanshsaini1 4 года назад
come on you cant leave us stranded here
@nilsiderallerechte5428
@nilsiderallerechte5428 4 года назад
33:53 wouldn't it be better to use Time.fixedDeltaTime()? But great video, it helped me very much!!
@user-pk4ut1ge3t
@user-pk4ut1ge3t 2 года назад
i tried this code 2 times when i play it i only see numbers, but car is not moving at all also the outpt in the console is not showing i dont really understand the problem
@jacklamb1155
@jacklamb1155 4 года назад
Hey! The first thing is that I really appreciate this video, it's helping me out a lot with a neural network I have to create for an assignment of mine. However, I have encountered an issue I can't fix. In the InputSensors method, of the 3 sensor values, I have only c that actually has any values that change. Happily, it is between 0 and 1 but a and b remain at 0 unless I make unusual sharp turns in the Inspector. Any clue as to what could be causing this? I reviewed the code and compared it to yours but as far as I can see it's all good.
@batchprogrammer108
@batchprogrammer108 4 года назад
Thank you for the compliments Jack, I can think of a few things that may be wrong. I'm not sure if you're using your own course setup; if so in the code there is a hit.distance/20 - i did that to keep it between 0 and 1 you may have to play with that a little as the scale of your course may be smaller than mine. So change the 20 to a variable and try playing with that in the inspector. Second thing that may be an issue is the ray is possibly colliding with the bounds of the car, so you may have to use a LayerMask to ensure that it isn't hitting the car. So based on the details you have given me, the distance issue seems to be more probable. Please try that, and if it doesn't work then maybe send some screenshots or a GitHub link to ajays.workemail@gmail.com and I'll reply to you within today :)
@jacklamb1155
@jacklamb1155 4 года назад
@@batchprogrammer108 Thank you, AJ. After adding the layer mask the values started to change properly! Luckily it was something simple. I appreciate the swift response! Your legendary with the videos, keep it going your talented :)
@batchprogrammer108
@batchprogrammer108 4 года назад
@@jacklamb1155 I'm very happy that it worked for you, good luck with your project :)
@user-zx8ou7db6n
@user-zx8ou7db6n Год назад
I get the following error when trying to serialize and deserialize the trained car with json: JsonSerializationException: Could not create an instance of type MathNet.Numerics.LinearAlgebra.Matrix`1[System.Single]. Type is an interface or abstract class and cannot be instantiated. Path 'hiddenLayers[0].Values'
@extremetitan2847
@extremetitan2847 4 года назад
That is one hell of a keyboard
@SockitWrench627
@SockitWrench627 4 года назад
So, did you just give up on the game you were making? I know I'm a bit late on that, but I loved watching those videos, and I was gonna definitely buy the game no matter how good or bad it is
@batchprogrammer108
@batchprogrammer108 4 года назад
Nope in fact I'm on school holidays right now and I'm only working on the game and will have a development log out within a month. I will also be releasing the next part to the self drive car series within this month. Thank you very much for the support and it means a lot, I'm in year 12 now so getting time like this is very rare so I am going to spend every moment working on the game :)
@SockitWrench627
@SockitWrench627 4 года назад
Okay. Good luck on that. I can't wait to see the next videos
@lukamandic9694
@lukamandic9694 2 года назад
@AJTech, how do you get those Vector3 things. Where that comes from. I would be thankful if you could reply. :)
@batchprogrammer108
@batchprogrammer108 2 года назад
Comes from when you use Unity, from the UnityEngine namespace
@lukamandic9694
@lukamandic9694 2 года назад
@@batchprogrammer108 I had an issue with autocomplete in unity. I fixed it and now it works. Thanks for the reply, awesome tutorial.
@PH0S
@PH0S Год назад
Hi! Does this work in mac?
@qasimimtiaz114
@qasimimtiaz114 4 года назад
Hey man, im making my own track and car. Im having problems with the box colliders. can you help?
@batchprogrammer108
@batchprogrammer108 4 года назад
Sure what's the issue?
@mateusdsp6871
@mateusdsp6871 4 месяца назад
Good!!!! :D Jesus is coming back folks, God bless you all!
@user-iw9ru5lc8o
@user-iw9ru5lc8o 2 года назад
i cant find the zip file in description... any help?
@arhziz
@arhziz 3 года назад
i know it's late and probably irrelevant to the outcome of the code. but for debugging sake others might wanna change other sensor values too when printing out the values @ 27:00
@mcrafterzz2447
@mcrafterzz2447 5 лет назад
When will your next open world video come?
@VZINC
@VZINC 5 лет назад
id say hes given up
@batchprogrammer108
@batchprogrammer108 5 лет назад
@@VZINC Nope! Not Yet :D
@lekdendorji6a
@lekdendorji6a 4 года назад
@@batchprogrammer108 ...
@random_precision_software
@random_precision_software 4 года назад
Can you do the next step and make a traffic light system.?
@batchprogrammer108
@batchprogrammer108 4 года назад
So the next episode was going to be training it, but definitely I can see if I can extend the network to have traffic light inputs; it may go into part 4 though.
@random_precision_software
@random_precision_software 4 года назад
@@batchprogrammer108 great 👍
@sathyanarayanan.s8653
@sathyanarayanan.s8653 2 года назад
bro great work🤍. and are you tamil?
@batchprogrammer108
@batchprogrammer108 2 года назад
thanks bro, yeah I am
@sathyanarayanan.s8653
@sathyanarayanan.s8653 2 года назад
@@batchprogrammer108 vanakam bro, i was having trouble in generic network in unity and need to make a ai for my game. This vid way simple and helpful to understand. I also shared this series playlist to my friend snd it was helpful for him also❤
@febrianaris
@febrianaris 4 года назад
Hi I just follow your very nice tutorial, a review : I think you only print out aSensor value for log
@batchprogrammer108
@batchprogrammer108 4 года назад
Yep haha thanks for spotting this, this tutorial has a few errors I need to spend some time cleaning up the GitHub :)
@febrianaris
@febrianaris 4 года назад
@@batchprogrammer108anyway, it is very easy to follow tutorial, great job !! I am in the part 2 and i know you spend a good deal of effort to explain everything, thanks for your work
@user-qh2vq6md2g
@user-qh2vq6md2g 4 года назад
i dont understand the overall fitness like what does it give me exactly (like what is that number "overallfitness" means?) and the distance multiplyer and the sencore mltiplyer and avrage speed multipier (what are they exactly for)?
@DownTownProductionive
@DownTownProductionive 4 года назад
What happened after this video, it was going good:(
@batchprogrammer108
@batchprogrammer108 4 года назад
ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-VYQZ-kjP1ec.html : Just finished it yesterday! Really sorry about the wait, the third part will follow in the next 3-4 days because I'm creating the next development log video at the moment.
@DownTownProductionive
@DownTownProductionive 4 года назад
AJTech now this is greaaaaat news
@mohamadizaz3645
@mohamadizaz3645 3 года назад
Hye, i cannot find the plugin + course file 😅
@Bailey-kc1jm
@Bailey-kc1jm 2 года назад
Did you ever find it
@YYYValentine
@YYYValentine 3 года назад
How do you run the game with the editor not freezed?
@adriantili6918
@adriantili6918 5 лет назад
Next part please
@batchprogrammer108
@batchprogrammer108 4 года назад
ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-VYQZ-kjP1ec.html - sorry about the wait Adrian.
@erikthemaster8990
@erikthemaster8990 4 года назад
How is it going with the open world game
@batchprogrammer108
@batchprogrammer108 4 года назад
It's coming out within a couple of days, sorry about the wait
@erikthemaster8990
@erikthemaster8990 4 года назад
@@batchprogrammer108 you know it's really impressive that you have made a open world game all by yourself. So when I get a computer I'm definitely going to buy your game.
@batchprogrammer108
@batchprogrammer108 4 года назад
@@erikthemaster8990 wow thanks so much for the support but it's not completed yet I meant the video was coming out in a couple of days, it's definitely getting there though!
@NoZhenya
@NoZhenya 3 года назад
16:42
@premiumquinn
@premiumquinn 3 года назад
Does this still work in 2020?
@batchprogrammer108
@batchprogrammer108 3 года назад
Yep!
@tronixthedev7887
@tronixthedev7887 3 года назад
You: 25 likes RU-vid: 500 likes
@qasimimtiaz114
@qasimimtiaz114 4 года назад
I mean the blend file
@batchprogrammer108
@batchprogrammer108 4 года назад
You will have to have Blender installed for the blend file to show up
@viguswg
@viguswg 4 года назад
The second one never game.
@batchprogrammer108
@batchprogrammer108 4 года назад
ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-VYQZ-kjP1ec.html it has now :)
@ZenitDS
@ZenitDS 3 года назад
You forgot a very important thing in Unity, MOVEMENT SHOULD ALWAYS BE RELATIVE TO TIME. You should have used Time.deltaTime or Time.fixedDeltaTime instead of 0.02f. Also in the part where you add the time to the timer you should have used Time.fixedDeltaTime instead of Time.deltaTime since it´s a FixedUpdate() function.
@prathamesh_sinha
@prathamesh_sinha 2 года назад
Do you always run in a uniform speed? Does your car always move on a fixed speed? Did you listen to what he said? He said that he did that by choice cuz there is almost nothing like uniform speed in real life. Yes, the second this is correct actually.
@cyrianox
@cyrianox 4 года назад
nice video, great work but at least 15min can be removed if you don't repeat things 2 or 3 times
@batchprogrammer108
@batchprogrammer108 4 года назад
Sorry about that I'll try having a better script next time :)
@rocketwastaken
@rocketwastaken 3 года назад
what kinda psychos disliked this video?
@qasimimtiaz114
@qasimimtiaz114 4 года назад
The course does not work
@ivantosev2677
@ivantosev2677 4 года назад
Next part please
@batchprogrammer108
@batchprogrammer108 4 года назад
ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-VYQZ-kjP1ec.html - sorry about the wait, it's here now
Далее
Сумерки сасага🧛
11:41
Просмотров 634 тыс.
AI Cars Learn To Drive!
6:56
Просмотров 13 тыс.
What are Genetic Algorithms?
12:13
Просмотров 26 тыс.
Learn Neural Networks through coding
24:31
Просмотров 30 тыс.
Creating an Ecosystem Simulation
11:28
Просмотров 14 тыс.
How I make science animations
43:39
Просмотров 696 тыс.
A.I.  teaches itself to drive in Trackmania
15:04
Просмотров 4,8 млн
Neural Network Learns to Play Snake
7:14
Просмотров 4,5 млн
Unity ML-Agents 1.0 - Training your first A.I
11:55
Просмотров 112 тыс.
How I created an evolving neural network ecosystem
10:09
МНЕ ТЯЖЕЛО ПРИЗНАТЬ, НО...
40:07
Просмотров 201 тыс.