A Virtual World - JavaScript Course: Final Lesson [Coding a MiniMap with JavaScript]

  Рет қаралды 5,781

Radu Mariescu-Istodor

Radu Mariescu-Istodor

Күн бұрын

Welcome to the course where we build a self-driving car simulation in a virtual world using HTML, CSS and JavaScript. This is the final video of Phase 2. In it, you'll learn to load the large world from the last lesson and implement a mini-map.
The mini-map really helps when the world we create is very big. Let's learn to code one using JavaScript and HTML Canvas. 🗺️
Have Fun! :-)
⭐PLAYLIST⭐
• Self-driving Car :: Ph...
⭐FINAL APP⭐
radufromfinland.com/projects/...
💻CODE💻
github.com/gniziemazity/virtu...
10. OpenStreetMap = follow along
11. MiniMap = code after this lesson
⭐ALL PREREQUISITES⭐
• Math & Code Fundamentals
☕Buy me a Coffee?☕
www.buymeacoffee.com/radum
⚡️Join this Channel⚡️
youtube.com/@radu/join
⭐Timestamps⭐
00:00 Introduction
00:42 Including the Large World File
02:49 Preparing for the MiniMap
05:48 MiniMap Implementation
07:58 Scaling the MiniMap
11:00 Marking the MiniMap center
11:49 Outro

Пікірлер: 72
@axonile836
@axonile836 4 ай бұрын
I watched the 11 vids and here is the main lesson : the most important is not the code and the math but what you actually want to do. Those are just tools to be wisely used .
@Radu
@Radu 4 ай бұрын
Probably the best lesson one can learn from the course.
@thespiritninja11
@thespiritninja11 Ай бұрын
You're an absolute genius man, Thank you for this!
@Radu
@Radu Ай бұрын
Not really... just a lot of practice. You're welcome :-)
@JeremiKress
@JeremiKress 5 ай бұрын
I've started recommending your videos to my class. We absolutely love your enthusiasm for Computer Science 💜💜💜
@Radu
@Radu 5 ай бұрын
Wow, thank you :-)
@Pwnstara
@Pwnstara 3 ай бұрын
Awesome project, thank you! Learned a lot about JS so far and looking forward to phase 3!
@Radu
@Radu 3 ай бұрын
You're welcome. Phase 3 just started, btw :-)
@pablovaldes2397
@pablovaldes2397 4 ай бұрын
love these projects man, ever since i stumbled upon creative coding i've enjoyed it so much more
@Radu
@Radu 4 ай бұрын
Great to hear! :-)
@javifontalva7752
@javifontalva7752 5 ай бұрын
Amazing 🎉. This is probably the project I have learnt the most (also the most difficult one by far). Thanks
@Radu
@Radu 5 ай бұрын
Really happy to hear that :-)
@adilsonbuset738
@adilsonbuset738 4 ай бұрын
Muito obrigado, Mestre Radu! Concluí o projeto e foi no mínimo muito divertido.
@Radu
@Radu 4 ай бұрын
Happy to hear you made it to the end :-)
@wagnerperin9455
@wagnerperin9455 5 ай бұрын
Mannn.... you're amazing!!! Will try to follow all videos... but for now... congrats from Brazil.
@Radu
@Radu 5 ай бұрын
Thank you :-) and season's greetings from Finland!
@javifontalva7752
@javifontalva7752 5 ай бұрын
My goodness! This was probably the easiest past of the project! Great job! Actually I know when I start doing the minimap it won't be as easy as you make it look. Terrific vid!
@Radu
@Radu 5 ай бұрын
If you got this far, I'm sure you'll manage :-)
@javifontalva7752
@javifontalva7752 5 ай бұрын
@@Radu yes. I also added a clip. I didn't know how to do it at first but I managed.
@Radu
@Radu 5 ай бұрын
@@javifontalva7752 clip?
@ahmedshalaby948
@ahmedshalaby948 4 ай бұрын
When are you going to start implementing Phase 3, man? By the way, this is an absolute masterpiece!
@Radu
@Radu 4 ай бұрын
February 2nd will be the first lesson.
@fmaion
@fmaion 5 ай бұрын
Amazing!!! Thank you!!
@Radu
@Radu 5 ай бұрын
You're so welcome! :-)
@malaysiastreetview
@malaysiastreetview 5 ай бұрын
Thank you for great video
@Radu
@Radu 5 ай бұрын
You're welcome!
@2difficult2do
@2difficult2do 3 ай бұрын
Thank you for this very interesting course. 12 out of 11 👍👍👍. That's impressive!
@Radu
@Radu 3 ай бұрын
Thank you :-)
@martintmv
@martintmv 4 ай бұрын
legend
@Radu
@Radu 4 ай бұрын
Thanks!
@astkh4381
@astkh4381 4 ай бұрын
Wow , very impressive
@Radu
@Radu 4 ай бұрын
Thank you :-)
@AyorindeAdesugba
@AyorindeAdesugba 5 ай бұрын
This is wonderful content. Waiting for Phase 3
@Radu
@Radu 5 ай бұрын
Working on it. Still have 4 videos to film on Monday, and then all the intros on Tuesday... Editing happens after the holidays. Planning to start posting it at the end of January / beginning of February.
@AyorindeAdesugba
@AyorindeAdesugba 5 ай бұрын
@@Radu Its going to be the longest wait for great content. Thanks for the ability to teach well - I stumbled on this and I am hooked.
@Radu
@Radu 5 ай бұрын
@@AyorindeAdesugba People waited over a year for phase 2 :-)) this is nothing. Phase 4 will probably be a really long wait again, though...
@user-or3yg6sr4d
@user-or3yg6sr4d 11 күн бұрын
These programs are so beautiful! I'm wondering, in the final version, if the buildings and landscapes inside have different styles. How are those customized? I want to use them in the maps I create during the course.
@user-or3yg6sr4d
@user-or3yg6sr4d 11 күн бұрын
He's currently stuck because the buildings are automatically generated, and he's not sure how to handle them.
@Radu
@Radu 9 күн бұрын
Not sure what you mean... You want to style the buildings differently? What do you mean by landscapes?
@mahimabhardwaj1807
@mahimabhardwaj1807 5 ай бұрын
amazing radu:)
@Radu
@Radu 5 ай бұрын
Thanks!
@himanshurai2854
@himanshurai2854 16 күн бұрын
Thank you for making such projects for us . I learnt a lot from these videos of yours ,but I wanna know How did you create your virtual world app? How did you add destination feature?
@Radu
@Radu 14 күн бұрын
It's basically the dijkstra lessons from Phase 3. I have a set of destinations and when the car approaches one I randomly choose a new one... I also do some slight manipulation to the graph (I cut the last segment traveled by the car, so it doesn't turn back the same way if that is the shortest path to the new place).
@inowatchvideos
@inowatchvideos 5 ай бұрын
Will you be doing any viewport culling? It’s crazy how you can just draw all items and its performant. (I’m thinking of simondev latest video). (I’m still on part 4, but i took a sneak peak, the cheat!)
@Radu
@Radu 5 ай бұрын
Cool, that video was recommended to me few days ago, but didn't have time to check it out. We don't have such complex shapes, just few polygons, really... To make huge worlds like described in that video you need a lot of steps (just as explained there), but I don't bother because... too much work and you get bored watching the cars in about 5 minutes or so :-D so... not worth to make them go around the planet :-D
@lahcsinayrahca
@lahcsinayrahca 4 ай бұрын
Still waiting for next phase bro... 🎉❤
@Radu
@Radu 4 ай бұрын
Will start on February 2nd.
@karthikm.1804
@karthikm.1804 5 ай бұрын
can we run bfs algorithm in this map to find distance between any two location?
@Radu
@Radu 5 ай бұрын
Sure, you can learn bfs on it. But it won't give you the (min) distance between two locations. It will give the minimum number of segments between the two locations. They can have any size. Imagine two ways to go from A to B: one with 10 small segments, almost in a straight line and another with 2 big segments going on a significant detour. You will find the second way with bfs. To find the first, you need Dijkstra's shortest path (spoiler alert: I'll teach it in Phase 3 :-))
@hau3371
@hau3371 5 ай бұрын
Can you show me how to make a sensor like in Final App?
@Radu
@Radu 5 ай бұрын
Sure, I will explain some of that in Phase 3 of the course. But, in short, I use the same sensor object we created in Phase 1. But one for each of these things: checking borders of the stop markings / traffic lights / other cars. The stop and lights has just one ray, but the one for the car has more of them since they can be coming from the side. Hope it helps.
@miniontoby
@miniontoby 2 ай бұрын
Hi! I have found some bugs: - Wheel emoji doesn't load on windows, since this is an apple emoji - Neural network visualizer is squeezed (like all the 'circles' from all levels are on 1 line...) - Nothing is FPS based, so with my phone it goes with like 10 fps and really slow. And with my good computer with 120 fps it goes really fast... (Just check how much time has past, devide the wanted fps by that amount and then multiply like the car speed by that value) - I can press minus to zoom out, but I have to hold shift and then the plus to zoom in (because it is the equals = key...)
@Radu
@Radu 2 ай бұрын
Thanks for pointing these out! - I use windows as well and it works for me on Chrome, Edge and Firefox, which browser (version) do you use? - Hmmm... it happens to me sometimes too, when my page is zoomed in to 120%. Probably zooming out the entire web page (Ctrl + minus) will give you more space for that - It's a good idea, but there is one problem with that. Consecutive runs will have slightly different behavior depending on how 'busy' the processor is. It can also make the car jump over the road borders if the speed is too large (collision handling doesn't interpolate between the past frame and current frame at the moment). - About zooming, are you talking about the more advanced demo on my website? The asterisk (*) could be used to zoom in even more on that one (or pressing one of the 1,2,3,4 number keys if you want to focus on one of the cars).
@miniontoby
@miniontoby 2 ай бұрын
- Running Chrome 122.0.6261.58 - My screen is always zoomed in (150%), this is a windows setting. If I zoom out on the page, the elements aren't adjusting. If I refresh after zooming out, it does compensate. But the screen (with the cars) is also zoomed out really far - Yeah, I understand. Maybe adding in a MAX for the multiplier. Like if (delta > 2) delta = 2; - I am using /projects/virtualworld/ and I know about the 1,2,3,4 keys. But I said that I am able to zoom in and out, but I need to hold shift to zoom in manually, since it is else recognized as the equals key instead...
@Radu
@Radu 2 ай бұрын
Ok. Thanks for clarifying some things. Everything clear! Just that setting delta = 2 there helps with the collision detection, but not with the... multiple runs behaving in exactly the same way. Hard to explain in the comment, but, imagine the car entering a turn so that sometimes it's closer to the border and sometimes further away, but the sensor registers it in both times. The way the curve will look will be different and these differences add up, like a butterfly effect leading to lower consistency. The solution is great for applications that should be real-time, like, if you want to make this into a game, it's the way to go! But if you want some systematic research, my way is better, even if the cars go slower on some computers than others, it doesn't matter in that case.
@joiadecristo319
@joiadecristo319 4 ай бұрын
Tu podes criar uma machine learning para avaliar anomalias nos jogos online.
@Radu
@Radu 4 ай бұрын
I'm not sure I understand :-) Do you mean that if I ask people to drive, then I can train the neural network using the data?
@joiadecristo319
@joiadecristo319 4 ай бұрын
@@Radu, I said to create Machine Learning to evaluate anomalies in online games.
@joiadecristo319
@joiadecristo319 4 ай бұрын
@@Radu You can create a lesson about anomalies in games using machine learning.
@joiadecristo319
@joiadecristo319 4 ай бұрын
This will be a good lesson.
@Radu
@Radu 4 ай бұрын
Maybe someday I will :-)
@domprodutora9910
@domprodutora9910 3 ай бұрын
Could you dub, translate into Portuguese?
@Radu
@Radu 3 ай бұрын
I don't know Portuguese :-\
@domprodutora9910
@domprodutora9910 3 ай бұрын
Translate to Portuguese, please.
@Radu
@Radu 3 ай бұрын
I don't know Portuguese :-)
@pizdaxyu
@pizdaxyu 5 ай бұрын
I'm stuck again, "big.world" that I have came from Overpass API but it doesn't start with graph but rather with elements array unlike yours, when did the change happened that I've missed it?
@Radu
@Radu 5 ай бұрын
I'm not exactly sure what you mean. Did you follow at 1:13?
@pizdaxyu
@pizdaxyu 5 ай бұрын
@@Radu data from overpass website, not sure when you cleaned it up
@Radu
@Radu 5 ай бұрын
@@pizdaxyu In the last lesson I wrote a parser for it so it's compatible with our code.
@pizdaxyu
@pizdaxyu 5 ай бұрын
@@Radu ooh I see the problem. I saved data from turbooverpass data export into big.world instead of file that was downloaded when we imported data first then pressed save (even though we got an error in console due to unable to save it in localstorage)
@Radu
@Radu 5 ай бұрын
Good you found the issue :-) There are many things going on in this codebase. It's not easy to remember it all!
Understanding AI - Lesson 1 / 15: A Simple Neural Network
32:09
Radu Mariescu-Istodor
Рет қаралды 16 М.
3 PYTHON AUTOMATION PROJECTS FOR BEGINNERS
17:00
Internet Made Coder
Рет қаралды 1,5 МЛН
Glow Stick Secret 😱 #shorts
00:37
Mr DegrEE
Рет қаралды 132 МЛН
The World's Fastest Cleaners
00:35
MrBeast
Рет қаралды 159 МЛН
顔面水槽がブサイク過ぎるwwwww
00:58
はじめしゃちょー(hajime)
Рет қаралды 110 МЛН
A Virtual World - JavaScript Course: Lesson 10 / 11 [OpenStreetMap Tutorial]
43:48
ChatGPT Can Now Talk Like a Human [Latest Updates]
22:21
ColdFusion
Рет қаралды 193 М.
I Found Minecraft's Hardest Mod
42:54
RageTrain
Рет қаралды 4,3 МЛН
Distance from Point to Segment Explained using JavaScript
25:11
Radu Mariescu-Istodor
Рет қаралды 4,5 М.
5 Coding Projects That Give You An UNFAIR Advantage
9:40
Tech With Tim
Рет қаралды 162 М.
ASMR Programming - Spinning Cube - No Talking
20:45
Servet Gulnaroglu
Рет қаралды 3,5 МЛН