Hey R&B, I see you are working your way through the back catalogue! I'm just trying to show the programming journey rather than the end result, and hopefully people can relate to it.
I'm playing with this simple physic engine by 3 days and I'm still not tired of it. It's a really great job. Thanks for sharing this video and this serie. I'm learning a lot from you. I reimplemented it with JavaFX and the performance are great.
To create the holes in the landscape, you just need a list of circles created by each explosion. Then in your render function, you check the list of circles to see if the pixel resides in one of them and if so, don't draw it. You can then stick to a tile based map. You don't have to actually change the map data to render the holes in the scenery. The function to see if a pixel exists inside one of your past explosions is also used for collision detection for movement.
you are THE only tutorial maker where i´m truly able to follow along all the way ... and nothing unexpecting happens on my side but not on your side ... THANX!
I used to be a watcher of the Handmade Hero series. Those videos, in my mind are just pitched completely wrong. Far too long and too detailed that they became boring. This series here however, seems to get it spot on. Exactly enough detail to show how things are done without being boring and videos and series that don’t literally go on for years. Keep up the good work javid9x!
Good stuff man, you really have taught me so much. I always thought OOP and the std lib was anathema but Im starting to second guess myself after watching you program. Keep making vids, thanks again.
Great work. I am normally a pure C programmer, but you just may sell me on moving to C++ yet. Though I love the challenge of porting this sort of thing to pure C. :)
I was so excited till I looked for part 2 and seen this was posted yesterday. Im currently working on a 2d engine and your videos are helping me with some vital information. Like I did not even consider the fact that I only need to test the 180 degrees in the direction the creature is moving. This is going to cut my collision time in half thank you so much
Thanks, Yeah I have tried a couple collision test, I am working on an advanced Cellular Automaton using Neural Networks but Collision detection is an issue, I tried 360 degrees, thats to slow. I was currently doing pixel test on the 8 pixels surrounding my creature but I have questions on the accuracy of this and more importantly it does not allow me to scale the creatures size like I wanted to. Doing it this way does. I even seem to be getting good results only performing collision check 90 degrees in the direction they are facing. Do you know if there are any algorithms for calculating the theta? I mean on a single pixel 180 degrees is only 4 pixel area around the source. Surely there has to be an algorithm that helps find the correct Theta over distance.
Thanks for this! Looking forward for this series since Worms was one of my favorite games as a child :) As a side note, you must do a collab with Bisqwit ;) Keep on keeping on!
Very possibly, it starts to get a bit fiddly with the OO if I do that, but maybe a slight redesign could accommodate it. For this simple game, I'm only implementing missiles and grenades, but if you want more weapons, a different approach is probably needed. Thanks for the feedback!
Привет! Скажите пожалуйста, где вы берете идеи реализации ваших проектов? Вы сами их придумываете, или все таки это какая-то литература? По моему мнению, у вас просто шикарные работы!
I'm wondering if this would work to have the balls roll on curved surfaces. Kinda like pinball... seems like it could work. Guess I'll have to try it lol. Awesome vid!
At 34:00, you say that objects closer to the explosion get a larger velocity boost. But you set the velocity to (d / fDist) * fRadius (where d = (dx, dy)), and fDist is the length of d, so (d / fDist) is unit length, and the length of the velocity vector will always be fRadius. So the velocity boost doesn't depend on the distance?
"And this may confuse the player" at 34:26 had me cracking up :D Also, why not update acceleration of the object, instead of velocity in the boom function?
Acceleration requires time to change a velocity, which would require being applied each frame for a duration. This is trickier to manage than just setting the velocity directly, which is fine for very large and brief accelerations, like an explosion. If the physics actually mattered in this case I'd be more considerate, but it's a cosmetic effect.
@Mrcel B, In MSWindows, you'd pay attention to the (HAL) Hardware Abstractoin Layer, but if you are new, a handy way to access some hardware (believe it or not) is via the web-browser these days, if you are after an easy way to do it. That is a very "friendly gentle" way to get into it, albet at a performance overhead, and some of it shares some similarities wiht Adobe Flash ActionScript (which despite being a bit "meh" is an easy way to learn for beginners). However, if you want more difficult or abstruse hardware, you may wish to look at the similarities between various languages, ranging from that of small "maker boards" like the Raspbery-Pi (or Intel equivalent), to Objective-C for Apple, and then look at Microsoft's Visual Studio's way of doing things which are similar to Objective-C. Beyond that there are some very difficult types of hardware programming that can be done but those are things like working with video processing (even before the invention of 3D graphics cards for most domestic computers). To get into that, you'd want to compare programming for something like an arduino with a Raspberry-Pi. This will allow you a gentle way to discover the mathematics behind bit-twiddling and the Discrete Cosine Transform used in video (whereby the DCT is most famously mathematics that can be done by pen and paper via the Cooley-Tukey FFT algorithm, and then computers in binary use Butterly Algorithms via what is known as twiddle factors). I would look at Brek Martin's "freedom platform" and other videos if I were you. So, considering you'd look at the Fourier Series and Fourier anaysis and Fourier Transforms, you'd want to look at arduino projects where people make a MP3 player graphic-Equaliser as they separate a signal into its harmonic series using fourier anlysis and then populate an array (or maybe a dynamically-linked-list) to make the "bars" of treble and middle and bass etc. As a small digression, there is the topic of file systems like ZFS and how linked-lists can make a objects as graph nodes in a super class. Mount a filesystem on a hard-drive is hardware. If you wish to study the mathematics (of FFT- which is hard btw), you'll want to look at all of the GCSE maths and how that goes into, vectors, "K-Graphs" and Quadratic Equations, wich lead into A-Level maths Polynomials (which are used in Cyclic Redundancy checks btw) and the Calculus and differential equations. Also look at "impossible" numbers like "i" used in negative square roots for when you are dealing with waves. Then and only then will you handle some Fourier Analysis or FFT. But quite honestly, beyond the Raspberry Pi (ARM cpu) and Intel equivalent boards with their pertaining languages (or even .net mono etc) or using custom boards with C-Sharp, I'd suggest you look at Amiga Hardware coding when you get to that "bit more confident stage" (as it is "fun" and not a nightmare) but aren't into abstruse Fourier Mathematics by then. The channel "Wei-ju Wu" has recently updated his video series on "Amiga Hardware Programming in C" so search that in quotes exactly. Also see the ScoopexUS channel regarding amiga coding.
One of my first videos ua-cam.com/video/tgamhuQnOkM/v-deo.html was programming a sound synthesizer from scratch in windows. Part 4 of that series talks about how the underlying technology works. On a windows/linux machine you are only really ever going to access hardware via an API.
can somebody help me? where to start? i dont understand anything from this tutorial? where should i begin? i mean which video. thanks all. i think im missing some references...
hey javidx9 I have a question I don't understand c++ that much only know about small things but will I still benefit if I follow your code without knowing what some does?
Hi BBDNuh, sure you will - as much as possible I try to make videos that are not about the language, but more about the algorithms and thinking behind the solutions. My videos dont really use any advanced C++, but should introduce some useful ideas and techniques you might not have seen before.
Im really struggling with running this for myself because i dont understand how to get the olcConsoleGameEngine.h file to which the code can reference, and how to define the vector function. pls help
Hi Byron, you can get the files you need form my github here github.com/OneLoneCoder/videos As for the vector function, that should be included as part of the C++ standard library, are you using a very old version of C++?
Thats exactly what i thought because ive used the function before but its the 2017 version of Visual Studio. Is there a library i havent imported or somehing?
Ahh I see what might of happened - I used to include in olcConsoleGameEngine, but I've since removed it, so if you #include in your main program you should be ok :S
Hey man, great tutorial as usual I really like where this one is going with the OOP. I'm having problems again with the Console Game Engine tho. I think it has to do with the size of the console, as if i set it to 256x160 it throws an exception at line 273 of the olc header file as soon as i run it. If i construct the console 50x50 then it runs but the actual window is longer than it is wide (i.e. not 50x50) any ideas why this might be?
Hi Yankee, sorry I missed this one, This sounds to me like you are constructing a console larger than your desktop resolution. What pixel sizes are you specifying, and what is your display resolution? As for the distorted winsow size, this is likely because your windows is a specific version which causes problems :D In the header file, you can specify the font to be "raster", and this should correct the aspect ratio.
I am new to this channel and today i started with this project. Any recommendation for better understanding material, engine, ... Maybe there are some easier videos/projects on this channel to go through them first??
This reminds my of an episode of the ITV kids show "Bad Influence!" where the programmer created a dynamic platform level in the game Earthworm Jim 2 see it here ua-cam.com/video/b7Z-t-38VFo/v-deo.htmlm22s
I can definitely second that. The value in these videos is the fact that ideas are conceptually explained such that the platform is irrelevant. The only limitation that has occurred to me so far is the language must have float variables.
Floats can be avoided in many cases by making the number huge and treating it like a decimal is in there somewhere. I have never seen a lang without FP but still my statement stands. I am working on a program now in which I need precision but instead of using floats I am using a max value of 10000 when I really just need a percentage. I just treat it as a percentage and if needed I can divide it appropriately to get the true float value
Sedit T I had 8 bit pic microcontrollers in mind, for which the largest variable is a 16 bit word, so no large numbers, and integer only. There are still ways around it, but it becomes difficult. That might sound like a fringe case, but I have been following OLC tutorials to write some of the programs for microcontrollers.
Yeah I see your dilemma, most you can get is 32768 signed int that way which if treated as a decimal would significantly limit the value you were able to achieve down to a few thousand even with a single decimal. Attempting to get 2 decimal places would limit you to a few hundred and so on if one wanted to treat the last few numbers as the decimal. Workarounds my friend... workaround everywhere lol, I'm sure you'll figure it out. IDK much about your project but what about allocating multiple words for a single number giving a much wider range to work with.
if you wanna teach, you should use a pure language that doesn't contain any libraries neither frameworks. like Javascript make its better for understanding the algorithm
These videos are really underrated. Some of the best programming videos on youtube. Even for a professional developer they are enjoyable
Hey R&B, I see you are working your way through the back catalogue! I'm just trying to show the programming journey rather than the end result, and hopefully people can relate to it.
The beauty lies in its simplicity as a good starting project or just something to do in your free time.
When my daughter was a baby back in 2000 she used to sit on my lap as I played this game for her thank you David for this wonderful video
Hi Charles, thanks man - its strange how games can really bring back strong nostalgic memories. I love it!
I'm playing with this simple physic engine by 3 days and I'm still not tired of it. It's a really great job. Thanks for sharing this video and this serie. I'm learning a lot from you. I reimplemented it with JavaFX and the performance are great.
To create the holes in the landscape, you just need a list of circles created by each explosion. Then in your render function, you check the list of circles to see if the pixel resides in one of them and if so, don't draw it. You can then stick to a tile based map. You don't have to actually change the map data to render the holes in the scenery. The function to see if a pixel exists inside one of your past explosions is also used for collision detection for movement.
I have watched every one of your videos at least twice now. Seriously, these are just plane fun to watch, to get into that logical programmer mindset.
Hey thanks buddy! Im pleased you enjoy them, makes it all worthwhile!
you are THE only tutorial maker where i´m truly able to follow along all the way ... and nothing unexpecting happens on my side but not on your side ... THANX!
Hey thanks Ulfar!
Sir, you are delivering pure gold in these videos!
I used to be a watcher of the Handmade Hero series. Those videos, in my mind are just pitched completely wrong. Far too long and too detailed that they became boring. This series here however, seems to get it spot on. Exactly enough detail to show how things are done without being boring and videos and series that don’t literally go on for years. Keep up the good work javid9x!
Priceless information in these videos.
Thank you very much!
I can´t wait to see part #2 !!. Excellent work javidx9 !. Thank you!.
Good stuff man, you really have taught me so much. I always thought OOP and the std lib was anathema but Im starting to second guess myself after watching you program. Keep making vids, thanks again.
Hey thanks Chase, I'm pleased you're finding the videos useful. OOP can look a bit strange at first, but it is efficacious, so you write less code!
I love your work! I'm glad I stumbled across your channel. Thanks for putting time into these videos!
Hi Feengur, you're welcome, thanks for stumbling!
Great work. I am normally a pure C programmer, but you just may sell me on moving to C++ yet. Though I love the challenge of porting this sort of thing to pure C. :)
Hey Neil! Do it! Do it! Do it! Move to the plus-side :D
Wow, who knew that the console could be this powerful?
It just needs leveraging in your favor!
I was so excited till I looked for part 2 and seen this was posted yesterday. Im currently working on a 2d engine and your videos are helping me with some vital information. Like I did not even consider the fact that I only need to test the 180 degrees in the direction the creature is moving. This is going to cut my collision time in half thank you so much
Lol, thanks and you're welcome Sedit - optimisation is never obvious until somebody shows you :)
Thanks, Yeah I have tried a couple collision test, I am working on an advanced Cellular Automaton using Neural Networks but Collision detection is an issue, I tried 360 degrees, thats to slow. I was currently doing pixel test on the 8 pixels surrounding my creature but I have questions on the accuracy of this and more importantly it does not allow me to scale the creatures size like I wanted to. Doing it this way does. I even seem to be getting good results only performing collision check 90 degrees in the direction they are facing. Do you know if there are any algorithms for calculating the theta? I mean on a single pixel 180 degrees is only 4 pixel area around the source. Surely there has to be an algorithm that helps find the correct Theta over distance.
Have you ever done, or Can you do a tutorial on a simple Neural Network Back propagated through one or maybe two hidden layers?
lol Sedit T, my research career was focused around neural nets, I should probably put something together!
OMG Awesome, Can't wait, you already got a subscriber so ya don't have to try to hard lol.
Javidx9 you are awesome. I like watching your tutorials😄 This is honey for my programming soul:))) Thanks
Best programming videos ever
lol thanks soft!
Thanks for this! Looking forward for this series since Worms was one of my favorite games as a child :)
As a side note, you must do a collab with Bisqwit ;)
Keep on keeping on!
Thanks aryesegal1988, lol I don't think Bisqwit needs me! The guys one of the most talented programmers out there!
As you described this my first thought was of a game I grew up with called tank wars
You are a wizard sir..
@14:56 so we can assign static variable of data structure from a class using a function to populate that static data structure
I was looking so long for this
You should call the boom function in the bouncedeathaction function, because maybe you want it to do other things
Very possibly, it starts to get a bit fiddly with the OO if I do that, but maybe a slight redesign could accommodate it. For this simple game, I'm only implementing missiles and grenades, but if you want more weapons, a different approach is probably needed. Thanks for the feedback!
Привет! Скажите пожалуйста, где вы берете идеи реализации ваших проектов? Вы сами их придумываете, или все таки это какая-то литература? По моему мнению, у вас просто шикарные работы!
Awesome - like always:))) Thanks for your big job!
javidx9 is a Legend
...pssst - some say he's 9 feet tall and codes with 3 hands!
I'm wondering if this would work to have the balls roll on curved surfaces. Kinda like pinball... seems like it could work. Guess I'll have to try it lol. Awesome vid!
At 34:00, you say that objects closer to the explosion get a larger velocity boost.
But you set the velocity to (d / fDist) * fRadius (where d = (dx, dy)), and fDist is the length of d, so (d / fDist) is unit length, and the length of the velocity vector will always be fRadius. So the velocity boost doesn't depend on the distance?
INCREDIBLE ! :-D
I'm attempting to make totally alone a Tetris game, it's so fun to made :-)
It can be very cool a tutorial of you on a tetris-like !
Hi Coding Addiction, you're lucky! ua-cam.com/video/8OK8_tHeCIA/v-deo.html
Ohhhhhhhhh ! You're so amazing, haha, thanks a lot :-)
Just a small thing: at 34:00 I think it would be more efficient to square the radius and compare the squared values instead of calling sqrt()
No because you need the actual fDist to set the vector if the check passes.
Yeah, so you calculate it when the check passes.
Fantastic work buddy.
Cheers sad and dead buddy!
Awesome videos! Btw which program/pad are you using for your notes? Looks like you are using a drawing table?
Thanks buddy! I use a wacom intuous 4 tablet, and OneNote light version.
I really like C++, but it seems there are more job opportunities for C# developers. Which one should I choose?
fair to say, you would get a biased response here.
now i really want to know how to make those type of pixels in the console and i want to know how to construct the console window please Javid 🙏🙏
"And this may confuse the player" at 34:26 had me cracking up :D
Also, why not update acceleration of the object, instead of velocity in the boom function?
Acceleration requires time to change a velocity, which would require being applied each frame for a duration. This is trickier to manage than just setting the velocity directly, which is fine for very large and brief accelerations, like an explosion. If the physics actually mattered in this case I'd be more considerate, but it's a cosmetic effect.
Fuck yeah, this is dope.
I'm writing Python code.
But this looks way more interesting.
Way more complicated though.
30:42 why to use bDead flag and not NBounceBedoreDeath == 0 or
Really impressive. Nice video.
Thanks Halla!
hi, does anyone know how to implement worms in godot or gdevelop? This sounds like it's only for consoles? thanks
This is incredible
beautiful and clean tutorial ;)
GG dude
Thanks Matteo!
This. Is. Awesome!
any tutorial suggestion for better understanding of bresenham's algorithm??
Dear sir please make video on Intel realseans 3D depth camera for robot navigation in visual studio
Can you do a tutorial about how to acces hardware, please? I love your work!
Hi Marcel, Thanks! Hardware is a big topic! Any hardware in particular you're interested in?
@Mrcel B, In MSWindows, you'd pay attention to the (HAL) Hardware Abstractoin Layer, but if you are new, a handy way to access some hardware (believe it or not) is via the web-browser these days, if you are after an easy way to do it. That is a very "friendly gentle" way to get into it, albet at a performance overhead, and some of it shares some similarities wiht Adobe Flash ActionScript (which despite being a bit "meh" is an easy way to learn for beginners).
However, if you want more difficult or abstruse hardware, you may wish to look at the similarities between various languages, ranging from that of small "maker boards" like the Raspbery-Pi (or Intel equivalent), to Objective-C for Apple, and then look at Microsoft's Visual Studio's way of doing things which are similar to Objective-C. Beyond that there are some very difficult types of hardware programming that can be done but those are things like working with video processing (even before the invention of 3D graphics cards for most domestic computers).
To get into that, you'd want to compare programming for something like an arduino with a Raspberry-Pi. This will allow you a gentle way to discover the mathematics behind bit-twiddling and the Discrete Cosine Transform used in video (whereby the DCT is most famously mathematics that can be done by pen and paper via the Cooley-Tukey FFT algorithm, and then computers in binary use Butterly Algorithms via what is known as twiddle factors). I would look at Brek Martin's "freedom platform" and other videos if I were you. So, considering you'd look at the Fourier Series and Fourier anaysis and Fourier Transforms, you'd want to look at arduino projects where people make a MP3 player graphic-Equaliser as they separate a signal into its harmonic series using fourier anlysis and then populate an array (or maybe a dynamically-linked-list) to make the "bars" of treble and middle and bass etc.
As a small digression, there is the topic of file systems like ZFS and how linked-lists can make a objects as graph nodes in a super class. Mount a filesystem on a hard-drive is hardware.
If you wish to study the mathematics (of FFT- which is hard btw), you'll want to look at all of the GCSE maths and how that goes into, vectors, "K-Graphs" and Quadratic Equations, wich lead into A-Level maths Polynomials (which are used in Cyclic Redundancy checks btw) and the Calculus and differential equations. Also look at "impossible" numbers like "i" used in negative square roots for when you are dealing with waves. Then and only then will you handle some Fourier Analysis or FFT.
But quite honestly, beyond the Raspberry Pi (ARM cpu) and Intel equivalent boards with their pertaining languages (or even .net mono etc) or using custom boards with C-Sharp, I'd suggest you look at Amiga Hardware coding when you get to that "bit more confident stage" (as it is "fun" and not a nightmare) but aren't into abstruse Fourier Mathematics by then.
The channel "Wei-ju Wu" has recently updated his video series on "Amiga Hardware Programming in C" so search that in quotes exactly. Also see the ScoopexUS channel regarding amiga coding.
javidx9 maybe the soundcard to start small?
ObsoletePowerCorrupts thank you for your response! It helped me out a lot!
One of my first videos ua-cam.com/video/tgamhuQnOkM/v-deo.html was programming a sound synthesizer from scratch in windows. Part 4 of that series talks about how the underlying technology works. On a windows/linux machine you are only really ever going to access hardware via an API.
can somebody help me? where to start? i dont understand anything from this tutorial? where should i begin? i mean which video. thanks all. i think im missing some references...
I LOVE THESE!
hey javidx9 I have a question I don't understand c++ that much only know about small things but will I still benefit if I follow your code without knowing what some does?
Hi BBDNuh, sure you will - as much as possible I try to make videos that are not about the language, but more about the algorithms and thinking behind the solutions. My videos dont really use any advanced C++, but should introduce some useful ideas and techniques you might not have seen before.
Anyone here remember gorilla.bas?
Im really struggling with running this for myself because i dont understand how to get the olcConsoleGameEngine.h file to which the code can reference, and how to define the vector function. pls help
Hi Byron, you can get the files you need form my github here github.com/OneLoneCoder/videos As for the vector function, that should be included as part of the C++ standard library, are you using a very old version of C++?
Thats exactly what i thought because ive used the function before but its the 2017 version of Visual Studio. Is there a library i havent imported or somehing?
Ahh I see what might of happened - I used to include in olcConsoleGameEngine, but I've since removed it, so if you #include in your main program you should be ok :S
I love you
Hey man, great tutorial as usual I really like where this one is going with the OOP. I'm having problems again with the Console Game Engine tho. I think it has to do with the size of the console, as if i set it to 256x160 it throws an exception at line 273 of the olc header file as soon as i run it. If i construct the console 50x50 then it runs but the actual window is longer than it is wide (i.e. not 50x50) any ideas why this might be?
Hi Yankee, sorry I missed this one, This sounds to me like you are constructing a console larger than your desktop resolution. What pixel sizes are you specifying, and what is your display resolution? As for the distorted winsow size, this is likely because your windows is a specific version which causes problems :D In the header file, you can specify the font to be "raster", and this should correct the aspect ratio.
I am new to this channel and today i started with this project. Any recommendation for better understanding material, engine, ... Maybe there are some easier videos/projects on this channel to go through them first??
The tetris, snake and first person shooter videos are pretty simple
@@javidx9 Thanks. What about asteroids and perlin noise?
@@aleksandarfranc1094 lol, i have videos on those too!
Anyone see the purpose of bStable variable in this tutorial or it will be in next part?
it seems to be unused.
wonderful
Thanks Skyhorn!
Nice !!
Thanks Robert!, you woudn't happen to be RobIII on the discord server would you?
No
Can anyone tell.me.how this isn't throwing an error with the PerlinNoise function. Where is it included
Hi IdiakosE, How do you mean it isnt included? @6:24
Ooh my bad, was expecting an include. Didn't see the definition
Who is that one guy that dislikes all your videos? Lol
I know! I must have a nemesis!
@8:39
how to delete pointer inside a function
99.7% likes to dislikes ratio!
Make a video using a quadtree
This reminds my of an episode of the ITV kids show "Bad Influence!" where the programmer created a dynamic platform level in the game Earthworm Jim 2 see it here ua-cam.com/video/b7Z-t-38VFo/v-deo.htmlm22s
Oh man, I remember that show! I had a proper Violet Berlin crush lmao :D
javidx9 haha yeah she was alright but fit body
Can i make this little game on other languages?
Hi Raposo, sure you can! The syntax will be different, but fundamentally the algorithms and ideas are the same.
I can definitely second that. The value in these videos is the fact that ideas are conceptually explained such that the platform is irrelevant. The only limitation that has occurred to me so far is the language must have float variables.
Floats can be avoided in many cases by making the number huge and treating it like a decimal is in there somewhere. I have never seen a lang without FP but still my statement stands. I am working on a program now in which I need precision but instead of using floats I am using a max value of 10000 when I really just need a percentage. I just treat it as a percentage and if needed I can divide it appropriately to get the true float value
Sedit T I had 8 bit pic microcontrollers in mind, for which the largest variable is a 16 bit word, so no large numbers, and integer only. There are still ways around it, but it becomes difficult. That might sound like a fringe case, but I have been following OLC tutorials to write some of the programs for microcontrollers.
Yeah I see your dilemma, most you can get is 32768 signed int that way which if treated as a decimal would significantly limit the value you were able to achieve down to a few thousand even with a single decimal. Attempting to get 2 decimal places would limit you to a few hundred and so on if one wanted to treat the last few numbers as the decimal. Workarounds my friend... workaround everywhere lol, I'm sure you'll figure it out. IDK much about your project but what about allocating multiple words for a single number giving a much wider range to work with.
if you wanna teach, you should use a pure language that doesn't contain any libraries neither frameworks. like Javascript make its better for understanding the algorithm