Тёмный

5.4 Arrive Steering Behavior - The Nature of Code 

The Coding Train
Подписаться 1,7 млн
Просмотров 47 тыс.
50% 1

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

 

2 окт 2024

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 87   
@Hermaniac8
@Hermaniac8 3 года назад
We've all been waiting for this video to... arrive.
@pvic6959
@pvic6959 3 года назад
you beat me to it. Ive been waiting to make this joke too LOL
@ViratKohli-jj3wj
@ViratKohli-jj3wj 3 года назад
Ba dum tssssss
@SimonTiger
@SimonTiger 3 года назад
1:14 lol
@darkfrei2
@darkfrei2 3 года назад
How you comment it 3 days ago?
@igricRBX
@igricRBX 3 года назад
@@darkfrei2 Simon is a VIP member of the Coding Train community, so I think he has access to videos before us. Btw make sure to check out his videos, he's a young coding genius.
@SimonTiger
@SimonTiger 3 года назад
@@igricRBX Correct, I am a member. Members have access to special Discord channels, one of which contains sneak-peeks of upcoming videos!
@NeilMartinIsHere
@NeilMartinIsHere 3 года назад
Instead of adding the boolean arrival as a parameter, I would have added slowRadius as a parameter. Then you pass slowRadius=0 for the Seek function. You pass slowRadius=100 for the Arrive function. You could add an ArriveCarefully function with slowRadius=500
@ricksidwell
@ricksidwell 3 года назад
Tuning the characteristics of the vehicle is certainly one way to tune the behavior. But if you don't want to change the vehicle, an alternative is to change the slow-down radius. If you change line 47 to: let slowRadius = this.maxSpeed * (this.maxSpeed / this.maxForce + 1) / 2; you can set the vehicle maxSpeed and maxForce to whatever values you want, and arrive will slow the vehicle down perfectly.
@vladbach8605
@vladbach8605 2 года назад
I did something similar and noticed it still overruns a tiny bit. I think it's because the slowing down function gets applied one frame too late, so I'm adding "+ this.maxSpeed" to slowRadius!
@SongSeeker7
@SongSeeker7 3 года назад
A tip for the seek() function. Instead of using slowRadius create this.slowRadiusSq = 100*100 as a member varialble and use distSq = force.magSq() , but of course your testing us :) Love your videos.
@SwordQuake2
@SwordQuake2 3 года назад
Implement seek using arrive but with slowRadius of infinity.
@ProwlerDigital
@ProwlerDigital 3 года назад
I'm still working on your javascript API series but just came here to show my appreciation in the comments!!
@TheCodingTrain
@TheCodingTrain 3 года назад
Hope that series is helpful!
@ProwlerDigital
@ProwlerDigital 3 года назад
@@TheCodingTrain you changed the game for me.. thank you again
@ВсадникАпокалипсиса-я9е
@@TheCodingTrain please make series about React.js
@pvic6959
@pvic6959 3 года назад
I've been watching your stuff for years (discovered you while I was in college a few years ago for a CS degree). Even now, I still love your stuff. I don't really play around with the code you produce, but I like watching someone else think through how they would do it. Its really helped me when it comes to my own code. If I get really stuck at work or for persona projects, sometimes I pause and say "how would X do it?" and it breaks me out of whatever "coders block" I got myself into. Thank you so much for your videos! I have recommended this channel so so many people. It does the fun+educational balance very well (dare I say: it does it best)
@jamesking2439
@jamesking2439 3 года назад
I just want to say that Coding Train inspired me during a dark time of my life and helped me get my first coding job. Thank you Daniel.
@waves-coder
@waves-coder 3 года назад
Can u make a blog app using express as a backend and pure html css js as frontend and provide admin use a markdown textarea to post a blog
@aidennymes6335
@aidennymes6335 3 года назад
I have a coding challenge for you: write a simple barcode scanner and evolve to qr code scanning. and if you're brave go forward to build an augmented reality marker detector and start to place simple 3d objects on them. that was something i did few years ago and it was a lot of fun! seems like you have all the basics to accomplish this already covered in past videos, so maybe this is some content idea for you :D looking forward
@frankie_goestohollywood
@frankie_goestohollywood 3 года назад
I love your videos so much!!!!!
@KalimBatony
@KalimBatony Год назад
Cool video! The author inspires! I tried to rewrite this code in C# in Unity, the achieve method works fine, but when implementing the arrive method there were problems, I didn't find the Map function, so I decided to write it myself, but it doesn't work correctly, the object slows down but then starts moving in the opposite direction before reaching the goal. Can anyone tell me what's wrong)This is my Map method: public static float Max(float val, float oldman, float max, float new Min, float newMax) { val = (val - oldman)/(oldman - oldman); returns new Min + val * (newMax - newMin); }
@alenaalena181
@alenaalena181 3 года назад
I study at the university the computer department, but I do not have a computer, I attend electronic lectures and exams on my mobile. I wish I had a computer, I work to buy it, but it is expensive 😞😞
@vlapr0571
@vlapr0571 5 месяцев назад
Wouldn't it be easier to just limit the force to maxSpeed? So when it is far from target it moves at max speed, but when it is close it is limited by the distance?
@prinzkiwi8207
@prinzkiwi8207 3 года назад
i wish to have a p5.js executable (app)
@borjonx
@borjonx 3 года назад
Came from Kinect 1414 & Processing... STAYING FOR EVEREYTHING ELSE !!!!! :)
@PacVan12
@PacVan12 8 месяцев назад
3:53 First time I hear him speak Italian
@aniket2593
@aniket2593 3 года назад
I guess, I would have done it like : slowRadius = maxSpeed*10; if (distance
@ChrisBNisbet
@ChrisBNisbet 3 года назад
How about using a local variable rather than a comment to indicate arrival mode? E.g. let arrival_mode = true; this.seek(target, arrival_mode);
@Chris-Brown-
@Chris-Brown- 2 года назад
in seek I limit desired speed to distance
@dgloria
@dgloria 3 года назад
Something's really wrong with me, as you said: "Once I'v arrived, I don't want to go anywhere ever again" made me emotional. Once I get wealthy, I'm gonna take a month and do this tutorial from square one up to the final episode. If only...
@MrImmi34
@MrImmi34 2 года назад
An easy way would be to have force equal to some scalar times the difference of positions. If position error is larger, it will move faster and assymtotically approach zero.
@nikilnikilesh9228
@nikilnikilesh9228 3 года назад
Sir we need more videos on machine learning and deep learning
@gordontheengineswifedr.nirmal
@gordontheengineswifedr.nirmal 3 года назад
Damn he’s cute. I’m a lady who likes a teacher with face fuzz!
@springrollwang4441
@springrollwang4441 3 года назад
oh no, this is the end of playlist
@thecrazy8888
@thecrazy8888 2 года назад
Realisticly you should not have to change maxSeepd and maxForce everytime you switch from one behavior to the other.
@chrismanning5232
@chrismanning5232 3 года назад
Hi there, Dan! Love your videos. I am a senior Node developer for my day job. One small suggestion: you found that your arrival flag was unclear when used inline towards the end of this video. In my past few jobs (and current company) I've found that the standard is to pass your variables as an object (destructured in the definition). This does a couple of things for you: when used inline it ensures you A) pass in a clearly labeled parameter and B) don't have to worry about the order. So your seek definition becomes seek({target, arrival = false}) and when you call it: seek({target, arrival: false}) because you already have a target variable that you're passing through (so you can avoid target: target)
@DanKaschel
@DanKaschel 3 года назад
That was my thought as well. Bonus: if you make a typescript version, an object will help encapsulate those configuration parameters beyond just individual parameter types.
@geoffwagner4935
@geoffwagner4935 Год назад
Dan is such a "Hype man" xD
@Eternam
@Eternam 3 года назад
recreating this in vanilla javascript, waiting for the wander video. great videos! thank you!
@Texplanations
@Texplanations 3 года назад
THE MOMENT HAS ARRIVED INDEED! I'm early on a CODING TRAIN VIDEO AAAAAAHHHHHH
@AndrewBone
@AndrewBone 3 года назад
It'd be cool if you could use maxSpeed and force to calculate slowdown radius.
@DanKaschel
@DanKaschel 3 года назад
Plus the delta speed, however that's stored.
@APaleDot
@APaleDot 3 года назад
You can. Some fairly basic math gives slowRadius = (this.maxSpeed * this.maxSpeed / this.maxForce) / 2
@hellofriend3091
@hellofriend3091 3 года назад
Please make a video guide for making our own framework please please please,
@hamadaparis3556
@hamadaparis3556 3 года назад
19th century animation awesome it seems like Einstein movie
@hussainsalih3520
@hussainsalih3520 3 года назад
i love you so much , i learn from you a lot what can i do for you ?
@icecrack4579
@icecrack4579 3 года назад
I recently saw your video on animation is p5, and thought, if we have multiple images instead of a sprite sheet, can't we store them in an array, and write a for loop to go over each of them, every couple of frames?
@TheCodingTrain
@TheCodingTrain 3 года назад
Indeed that would work!
@RajJaiswal538
@RajJaiswal538 3 года назад
But that will require making a lot of images and preloading a lot of images which will slow down the system. Could work for simple short animations though
@icecrack4579
@icecrack4579 3 года назад
@@RajJaiswal538 On the internet, sometimes you can find separate images on websites, so that's why you can use this method, instead of creating a sprite sheet yourself. Also preload runs once, and from my experience, p5 can handle up to 50 objects, and display them(images) at once, so it should have no problem displaying images one at a time, I think.
@RajJaiswal538
@RajJaiswal538 3 года назад
@@icecrack4579 yes! For less images. Anything over 50 and it will take like 10 minutes just to preload p.s. I am not sure if 50 is the golden number and it also depends upon the size of image
@icecrack4579
@icecrack4579 3 года назад
@@RajJaiswal538 Oh, I misunderstood your comment, I had done it with the same image, in the object class itself, I'm not sure about 50 different images tho.
@toastyPredicament
@toastyPredicament 2 года назад
Hey
@Jkauppa
@Jkauppa 3 года назад
assembly rocks
@Jkauppa
@Jkauppa 3 года назад
naming is waste of time
@Jkauppa
@Jkauppa 3 года назад
if you need to name, you have made it too complex, to understand
@Jkauppa
@Jkauppa 3 года назад
try that sphere as ray tracing sphere collision volume for dynamic distance fields
@Jkauppa
@Jkauppa 3 года назад
fields for ray marching, ie, a field generation instead of all-to-all check
@darkfrei2
@darkfrei2 3 года назад
Thanks for your videos!
@najibsaad5765
@najibsaad5765 3 года назад
Youre always seeking, so you can simply add an if statement if you’re in the slowing zone, you start to “arrive” i think it would be more clear and you won’t have a separate function for arriving
@DanKaschel
@DanKaschel 3 года назад
Only if the strategy for seeking is always the same as arriving.
@SimonTiger
@SimonTiger 3 года назад
@@DanKaschel Which isn't the case, so yeah...if you always want the vehicle to go at maxspeed then there would be no way to do it if you do it like that
@sreenivaspakalapati8123
@sreenivaspakalapati8123 3 года назад
Loved it Man ❤❤❤
@danielmelendrez1616
@danielmelendrez1616 3 года назад
These videos are simply a beautiful rollecoaster. It's a nice mix of relaxation from seeing the final result and the anxiety from trying to read Daniel's mind XD
@uahnbu
@uahnbu 3 года назад
It's getting exciting. I can't wait for moreee
@lolisimp693
@lolisimp693 3 года назад
Love your vid
@patzelife
@patzelife 3 года назад
❤❤❤❤👍
@viniciusfriasaleite8016
@viniciusfriasaleite8016 3 года назад
Always great content! I think a way to improve this is to use some math to calculate the arriving
@DanKaschel
@DanKaschel 3 года назад
It'd be nice to use the max speed to calculate a reasonable radius
@Truephoria
@Truephoria 3 года назад
I love the flashbacks! Brings back memories. :') Still around and as passionate to teach as ever. Thank you for everything you've done.
@nagesh007
@nagesh007 3 года назад
Hi, You are an amazing teacher ... thanks a lot for teaching amazing stuff... I kindly request you teach asymptotic notation Big -O and when we write any algorithm , how to calculate Big - O ... Can you please help
@aaronbell5315
@aaronbell5315 3 года назад
Random question but I really like your videos and wanted to ask you, how can I connect a MIDI keyboard via USB and get the input of the frequency and amplitude of each note being played? I want to map the frequency and amplitude to color! thank you!
@cnoize314
@cnoize314 3 года назад
The montage of you drawing the diagram was great haha
@amirMahmed
@amirMahmed 3 года назад
You are a Wonderful program with a great ambition
@gouravpunani922
@gouravpunani922 3 года назад
why you use p5 in every project? nobody use it. Please stop promoting your library in the name of educational video
@miran248
@miran248 3 года назад
Lots do, actually.
@_miyu
@_miyu 3 года назад
I have used many of the concepts he has taught and applied the same things in my own language. I like to code in c#. It doesn't matter what code he teaches because it's the concepts you are learning not the direct code.
@jetison333
@jetison333 3 года назад
It seems really reasonable to use it to me, I mean it works fine, and has the great bonus of it being super easy to share with people because they don't have to set up an environment for it, just open the link and start playing.
@labwax
@labwax 3 года назад
The knowledge can be used for any programing language. I am sure many people here can help translate the code to any programming languge. Also, I do use p5. Which is basically just javascript.
@DanKaschel
@DanKaschel 3 года назад
Isn't that how these videos are funded? As p5 promotions? Seems like a great deal to me.
Далее
5.5 Wander Steering Behavior - The Nature of Code
15:46
5.3 Flee, Pursue, Evade - The Nature of Code
13:25
Просмотров 51 тыс.
#kikakim
00:10
Просмотров 13 млн
Лучше одной, чем с такими
00:54
Просмотров 758 тыс.
🦊🔥
00:16
Просмотров 396 тыс.
ЭТО НАСТОЯЩАЯ МАГИЯ😬😬😬
00:19
Просмотров 494 тыс.
These 8 Skills Will Make You a GOOD Winger
8:37
Просмотров 789 тыс.
5.7 Path Following (Steering) - Nature of Code
15:41
Просмотров 107 тыс.
3.7: Additive Waves - The Nature of Code
13:03
Просмотров 45 тыс.
Coding Challenge 162: Self-Avoiding Walk
38:27
Просмотров 153 тыс.
Vim Tips I Wish I Knew Earlier
23:00
Просмотров 68 тыс.
2.3 Friction Force - The Nature of Code
14:45
Просмотров 63 тыс.
Coding Challenge 180: Falling Sand
23:00
Просмотров 943 тыс.
Dependency Injection | Prime Reacts
28:34
Просмотров 333 тыс.
#kikakim
00:10
Просмотров 13 млн