I always hate people who say that mathematics beyond basic arithmetic is useless. It's not that math is useless, but that they don't know how to put it to good use!
@@sid98geek yeah, just becz most of them won't go into math related fields doesn't mean it's useless or can say whatever like, "I'm never gonna use these in my life, so I shouldn't study them"
I love the way you provide great visuals when explaining certain concepts. I also love how thorough your lesson is. I thought I knew trig before, but I learned some new things. Amazing video! And great content!!
Can I just say, this is one of the best trig videos about game development I have ever seen. Everything is explained so clearly. Do you by chance have a video that explains trig in 3-dimensions?
if you get 2d down pat, then you can always fall back on it for all your 3d stuff all the time, if your orthonormal to a plane, then its just 2d, even in 3d.
God Yesterday i needed to calculate how many pixels a bulet need to move to mouse cursor in X and Y every each frame with a velocity of x = 5 if y = 0 And i used pythagore and Thales to solve my problem
@r Oh boy, probably one of my least favorite subjects and I apparently have to re-learn in order too be a game dev. If I can use a calculator or computer, then do I still need to learn any forms of trig or calculus? I'm okay Math and Algebra, but those other fields are going to really rattle and stress out my brain especially when I also want to do graphic design, art, and animation. If I even manage to learn all these fields that I want to excel in, I feel like it's going too be hard to juggle them all and I'm going to end up spreading myself too thin as well as being a jack of all trades and master of non.
@r Again, I want to mention I want to do art as well as nice hand drawn animation to some extent, but I don't know if I will remember all of this on top of learning to be a game dev and remember trig/calculus. The thought of me wanting too be good at all these fields does give me anxiety knowing the amount of time as well as attention needed to learn and maintain memory of all these things if I do go forward with learning them either self taught or in college (maybe that's not such a good idea considering student loans). Either way, I feel like I'm going to have very little free time. Though, this is also to say whether or not I will I be successful learning any of what I want.
This is really cool and useful knowledge. I don't fully understand it, and if you have a deeper explanation with of a foundation to build upon, I'm certainly intrigued and would definitely listen.
thank you been scratching my head around arctan2(y,x), cos(x), sin(y) etc (I'm using GameMaker) this is very useful to re-enforce what I've been reading/watching and asking to chat gpt
Driving home in gta5 and listening to the music at sunset 🌅 got me interested in learning trig for games. Like you could have fun learning and put it in a great game.
Yeah, I know what someone will say the moment I ask this, " Just take the angle and subtract/add 180 for it to be flipped ", Doesn't work because although it'll flip it in the opposing direction, it will not add/subtract 180 degrees from any NEW angle made, so let me ask the question in hopes for an answer that works. Alright, So I'm attempting to take the angle of two objects, I want one object to flee from another. what I tired doing was: cos(Enemy.X) & sin(Player.Y + pi) ( according to google, + pi is the equivalent of going negative, or in other words, the opposite direction ) however, when I run this through, it causes my enemy's path finding to go at a Up-Right angle, I presume this is for the same reasons stated 5:53 I have never done trigonometry but painfully Construct 2 and Construct 3's path finding behavior don't have a means of path finding away from a position, only towards it with simplicity. So I have to write a formula within its pathfinding condition which it has two inputs ( Desired X cords ), ( Desired Y cords ) I am forced to specify the X component and Y when writing, C3 offers a Javascript functionality but construct 2 does not, and I do not have a license for C2 so humor me. Construct 2-3's forums from multiple users state its "impossible" to make the pathfinding behavior flee from a given point, I don't agree with this and I managed to partially get this to work with a clamp(Player.X/Y, Enemy.X/Y) which has only one draw back, being that anything within the range of a bottom right corner doesn't return a new path, causing the AI to pause unless it breaches that angle Also, I am _quite_ sure I can do this with a simple math formula, and C2-C3 offers all the trigonometry expressions required to get this to work; So I think those comments stating it's impossible have simply never tried this route. V **QUESTION SUMMARY TO BYPASS ALL THE RAMBLING ABOVE** V if I were to write a formula which uses the player as a point to FLEE from, how would I write that in a way that _ISN'T_ " Player.X/Y - 180 " or " Player.X/Y + 180 "? My goal is to make a cowardly pathfinding behavior, one that flees from the player if they get too close. The distance is already accounted for, as that is part of the condition for the event to be fired in the first place; So if possible don't include "* Distance" to your formula. Thanks in advance for anyone who finds this comment, I realize I am asking someone on the internet to do my 'homework'; But this has genuinely left me stumped regardless of what I've tried. And yes, I did try to learn Trigonometry, I understood it within the 3 hours I did research on it, or at least, have a rough understanding of it.
@@DaFluffyPotato Doesn't seem like its required, Upon flipping sin or angle to negative I get the opposite results to just keeping it positive. Enemy moves towards you if you move toward it, and vice-versa away from it. So I have my sin and angle untouched, I think this has to due with the fact C2 unlike most engines has its 0,0 point start from the bottom left corner rather than the top right. But atlas I could be wrong. Thanks for the quick reply
I might do a video on this. I didn't want to for a while because I didn't feel like I had enough to add, but I think I could make a decent video on it now.
I am 11 years old and I can proudly say that I didn't understand a single thing. I really wanna something to my python game, but I don't know the math for it. I am sad. pls help
So you have used x += cos(direction) * speed y -= sin(direction) * speed But isn't this also the formula for circular motion x = x*cos(direction)-y*sin(direction) y = x*sin(direction)+y*cos(direction) Can anyone explain how are they the same??
Are you sure that’s the formula for circular motion? Did you mean something like: x2 = distance*sin(direction) + x1, and y2 = -distance*cos(direction) - y1
Thanks nice vid but i feel some things were overcomplicated tho its probs just since i learnt it different in school, just like writing a squared = b squared + c squared woulda made me get that part faster
Watching videos about game dev and math is always interesting.
it's a cool way of procrastinating
I always hate people who say that mathematics beyond basic arithmetic is useless. It's not that math is useless, but that they don't know how to put it to good use!
@@sid98geek yeah, just becz most of them won't go into math related fields doesn't mean it's useless or can say whatever like, "I'm never gonna use these in my life, so I shouldn't study them"
@@sid98geek i agree, maths is extremely useful
@@sid98geek also whenever i code i always implement some sort of maths in
I love the way you provide great visuals when explaining certain concepts. I also love how thorough your lesson is. I thought I knew trig before, but I learned some new things. Amazing video! And great content!!
Can I just say, this is one of the best trig videos about game development I have ever seen. Everything is explained so clearly. Do you by chance have a video that explains trig in 3-dimensions?
Nope, because I haven’t used it enough to be confident in teaching it. I’ve only used trig in 3D stuff a few times.
if you get 2d down pat, then you can always fall back on it for all your 3d stuff all the time, if your orthonormal to a plane, then its just 2d, even in 3d.
God
Yesterday i needed to calculate how many pixels a bulet need to move to mouse cursor in X and Y every each frame with a velocity of x = 5 if y = 0
And i used pythagore and Thales to solve my problem
lol same
bruh same
man i study trigonometry at school and know the concepts in the video i feel smart :)
lol this is just some basic trigonometry
advanced level trigono stuff is much harder
@@pranitp.29 So advanced trig and calculus are required in order to be a good game programmer, right?
@r - Action RPG
- Platformer
- 3D Beat Em Up
Which one of these?
@r Oh boy, probably one of my least favorite subjects and I apparently have to re-learn in order too be a game dev. If I can use a calculator or computer, then do I still need to learn any forms of trig or calculus?
I'm okay Math and Algebra, but those other fields are going to really rattle and stress out my brain especially when I also want to do graphic design, art, and animation.
If I even manage to learn all these fields that I want to excel in, I feel like it's going too be hard to juggle them all and I'm going to end up spreading myself too thin as well as being a jack of all trades and master of non.
@r Again, I want to mention I want to do art as well as nice hand drawn animation to some extent, but I don't know if I will remember all of this on top of learning to be a game dev and remember trig/calculus.
The thought of me wanting too be good at all these fields does give me anxiety knowing the amount of time as well as attention needed to learn and maintain memory of all these things if I do go forward with learning them either self taught or in college (maybe that's not such a good idea considering student loans).
Either way, I feel like I'm going to have very little free time. Though, this is also to say whether or not I will I be successful learning any of what I want.
This is really cool and useful knowledge. I don't fully understand it, and if you have a deeper explanation with of a foundation to build upon, I'm certainly intrigued and would definitely listen.
thank you been scratching my head around arctan2(y,x), cos(x), sin(y) etc (I'm using GameMaker) this is very useful to re-enforce what I've been reading/watching and asking to chat gpt
Well.. I got to 53 seconds in before I was utterly lost. hah
Driving home in gta5 and listening to the music at sunset 🌅 got me interested in learning trig for games. Like you could have fun learning and put it in a great game.
I use this for a circle but I was stuck in trajectory calculations so ..... A huge tanks to you
Well paced, visually pleasing, good examples, good video!
Super useful!
Yeah, I know what someone will say the moment I ask this, " Just take the angle and subtract/add 180 for it to be flipped ",
Doesn't work because although it'll flip it in the opposing direction, it will not add/subtract 180 degrees from any NEW angle made, so let me ask the question in hopes for an answer that works.
Alright,
So I'm attempting to take the angle of two objects,
I want one object to flee from another.
what I tired doing was:
cos(Enemy.X) & sin(Player.Y + pi)
( according to google, + pi is the equivalent of going negative, or in other words, the opposite direction )
however, when I run this through, it causes my enemy's path finding to go at a Up-Right angle, I presume this is for the same reasons stated 5:53
I have never done trigonometry but painfully Construct 2 and Construct 3's path finding behavior don't have a means of path finding away from a position, only towards it with simplicity.
So I have to write a formula within its pathfinding condition which it has two inputs ( Desired X cords ), ( Desired Y cords )
I am forced to specify the X component and Y when writing, C3 offers a Javascript functionality but construct 2 does not, and I do not have a license for C2 so humor me.
Construct 2-3's forums from multiple users state its "impossible" to make the pathfinding behavior flee from a given point, I don't agree with this and I managed to partially get this to work with a clamp(Player.X/Y, Enemy.X/Y) which has only one draw back, being that anything within the range of a bottom right corner doesn't return a new path, causing the AI to pause unless it breaches that angle
Also, I am _quite_ sure I can do this with a simple math formula, and C2-C3 offers all the trigonometry expressions required to get this to work; So I think those comments stating it's impossible have simply never tried this route.
V **QUESTION SUMMARY TO BYPASS ALL THE RAMBLING ABOVE** V
if I were to write a formula which uses the player as a point to FLEE from, how would I write that in a way that _ISN'T_
" Player.X/Y - 180 " or " Player.X/Y + 180 "?
My goal is to make a cowardly pathfinding behavior, one that flees from the player if they get too close.
The distance is already accounted for, as that is part of the condition for the event to be fired in the first place; So if possible don't include "* Distance" to your formula.
Thanks in advance for anyone who finds this comment, I realize I am asking someone on the internet to do my 'homework'; But this has genuinely left me stumped regardless of what I've tried.
And yes, I did try to learn Trigonometry, I understood it within the 3 hours I did research on it, or at least, have a rough understanding of it.
A flipped Y means you need to make either your angle or your sine output negative to correct it.
@@DaFluffyPotato Doesn't seem like its required, Upon flipping sin or angle to negative
I get the opposite results to just keeping it positive.
Enemy moves towards you if you move toward it, and vice-versa away from it.
So I have my sin and angle untouched, I think this has to due with the fact C2 unlike most engines has its 0,0 point start from the bottom left corner rather than the top right.
But atlas I could be wrong.
Thanks for the quick reply
yoo, thank you for this video, can you please make videos on particle effects as well as adding pixelated/drawn backgrounds
I'll probably do the particles at some point, but backgrounds are just blitting an image before everything else.
Great trig information. 😎 Thanks.
dude, I love this video, great, great work
First!
i absolutely love ur vids theyre so useful
could you please make a vid about basics of pixel art?
I might do a video on this. I didn't want to for a while because I didn't feel like I had enough to add, but I think I could make a decent video on it now.
Thank you, many times.
I like to do game development. But I'm always afraid with trigonometry shit cuz im very bad at math
Great video !!!😊 Very clever.
what is your favourite palette on aseprite? thank you.
I make most of my palettes.
@@DaFluffyPotato the professionalist Lol
I am 11 years old and I can proudly say that I didn't understand a single thing. I really wanna something to my python game, but I don't know the math for it. I am sad. pls help
Learn trigonometry first.. you can learn it from UA-cam
what did you use to make this video btw just curious
Probably Krita
Nice vid
its cool getting rid of the sqrt, but people will delete your code if you put it on the internet unfortunately.
So you have used
x += cos(direction) * speed
y -= sin(direction) * speed
But isn't this also the formula for circular motion
x = x*cos(direction)-y*sin(direction)
y = x*sin(direction)+y*cos(direction)
Can anyone explain how are they the same??
Are you sure that’s the formula for circular motion? Did you mean something like: x2 = distance*sin(direction) + x1, and y2 = -distance*cos(direction) - y1
how to make the object facing mouse pleaaaaaaaaaaaaaase
Use if statements and flip the image.
@@xerneastrainer8111 hhh 360 if statements to flip img
@@gamingghost7335 Or a switch-case.
size doesn't matter
Hello there
General Kenobi
Thanks nice vid but i feel some things were overcomplicated tho its probs just since i learnt it different in school, just like writing a squared = b squared + c squared woulda made me get that part faster
i am way too stupid to get trigonometry
Don't mind me, just looking for a reason not to say "Fuck math"
Discouraging :-/
what, how?
@@wh0d1s-l this is super complex to me , it’s been years since I’ve been in a math class and frankly can’t remember any of it lol
@@Fullrusher what is so hard for you in this, if you face problems you can come into the discord server.
@@Fullrusher What helped me was to write it all down in simple steps 1 by 1. Jotting down all the key words with definitions
Please make video in hindi😊