Trigonometry in Game Development

  Рет қаралды 61,457

DaFluffyPotato

DaFluffyPotato

Күн бұрын

Пікірлер: 70
@atibyte
@atibyte 4 жыл бұрын
Watching videos about game dev and math is always interesting.
@jhonnatanwalyston6645
@jhonnatanwalyston6645 4 жыл бұрын
it's a cool way of procrastinating
@sid98geek
@sid98geek 3 жыл бұрын
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!
@ZAKINGOFDESPAIR
@ZAKINGOFDESPAIR 3 жыл бұрын
@@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"
@mangomanlassi7779
@mangomanlassi7779 3 жыл бұрын
@@sid98geek i agree, maths is extremely useful
@mangomanlassi7779
@mangomanlassi7779 3 жыл бұрын
@@sid98geek also whenever i code i always implement some sort of maths in
@IceForgeOfficial
@IceForgeOfficial Жыл бұрын
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!!
@mouseclicker4955
@mouseclicker4955 4 жыл бұрын
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?
@DaFluffyPotato
@DaFluffyPotato 4 жыл бұрын
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.
@magnuswootton6181
@magnuswootton6181 3 жыл бұрын
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.
@Kilogya
@Kilogya 2 жыл бұрын
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.
@eleos5
@eleos5 3 жыл бұрын
Well paced, visually pleasing, good examples, good video!
@Raphy084
@Raphy084 4 жыл бұрын
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
@zackydev
@zackydev 4 жыл бұрын
lol same
@soupnoodles
@soupnoodles 3 жыл бұрын
bruh same
@zerokun2655
@zerokun2655 4 жыл бұрын
man i study trigonometry at school and know the concepts in the video i feel smart :)
@bill-cipher000
@bill-cipher000 3 жыл бұрын
lol this is just some basic trigonometry advanced level trigono stuff is much harder
@doclouis4236
@doclouis4236 2 жыл бұрын
@@bill-cipher000 So advanced trig and calculus are required in order to be a good game programmer, right?
@doclouis4236
@doclouis4236 Жыл бұрын
@r - Action RPG - Platformer - 3D Beat Em Up Which one of these?
@doclouis4236
@doclouis4236 Жыл бұрын
@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.
@doclouis4236
@doclouis4236 Жыл бұрын
@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.
@hm4266
@hm4266 4 жыл бұрын
Super useful!
@watchingwolf8092
@watchingwolf8092 2 жыл бұрын
I use this for a circle but I was stuck in trajectory calculations so ..... A huge tanks to you
@DiceDrivenGameDev
@DiceDrivenGameDev 11 ай бұрын
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
@jarnoderyck2212
@jarnoderyck2212 3 жыл бұрын
dude, I love this video, great, great work
@Plasterdeath1848
@Plasterdeath1848 4 жыл бұрын
yoo, thank you for this video, can you please make videos on particle effects as well as adding pixelated/drawn backgrounds
@dafluffypotatovr7362
@dafluffypotatovr7362 4 жыл бұрын
I'll probably do the particles at some point, but backgrounds are just blitting an image before everything else.
@cauchy_math
@cauchy_math 4 жыл бұрын
First! i absolutely love ur vids theyre so useful could you please make a vid about basics of pixel art?
@dafluffypotatovr7362
@dafluffypotatovr7362 4 жыл бұрын
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.
@8-bitsteve500
@8-bitsteve500 3 жыл бұрын
Well.. I got to 53 seconds in before I was utterly lost. hah
@unknownuser6757
@unknownuser6757 Жыл бұрын
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.
@kevinw5539
@kevinw5539 4 жыл бұрын
what is your favourite palette on aseprite? thank you.
@DaFluffyPotato
@DaFluffyPotato 4 жыл бұрын
I make most of my palettes.
@zackydev
@zackydev 4 жыл бұрын
@@DaFluffyPotato the professionalist Lol
@qzorn4440
@qzorn4440 Жыл бұрын
Great trig information. 😎 Thanks.
@Byynx
@Byynx Жыл бұрын
Great video !!!😊 Very clever.
@slamsandwich19
@slamsandwich19 2 жыл бұрын
what did you use to make this video btw just curious
@DaFluffyPotato
@DaFluffyPotato 2 жыл бұрын
Probably Krita
@gamingghost7335
@gamingghost7335 3 жыл бұрын
how to make the object facing mouse pleaaaaaaaaaaaaaase
@xerneastrainer8111
@xerneastrainer8111 3 жыл бұрын
Use if statements and flip the image.
@gamingghost7335
@gamingghost7335 3 жыл бұрын
@@xerneastrainer8111 hhh 360 if statements to flip img
@xerneastrainer8111
@xerneastrainer8111 3 жыл бұрын
@@gamingghost7335 Or a switch-case.
@Mupersega
@Mupersega 4 жыл бұрын
Thank you, many times.
@kheosz666
@kheosz666 3 жыл бұрын
I like to do game development. But I'm always afraid with trigonometry shit cuz im very bad at math
@zackydev
@zackydev 4 жыл бұрын
Nice vid
@RasamRohit
@RasamRohit Жыл бұрын
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??
@TheSaintsVEVO
@TheSaintsVEVO 7 ай бұрын
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
@basicallybrand
@basicallybrand 3 жыл бұрын
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
@premlalmahto2997
@premlalmahto2997 3 жыл бұрын
Learn trigonometry first.. you can learn it from KZbin
@magnuswootton6181
@magnuswootton6181 3 жыл бұрын
its cool getting rid of the sqrt, but people will delete your code if you put it on the internet unfortunately.
@Raja-iq5pn
@Raja-iq5pn 4 жыл бұрын
size doesn't matter
@banishedguardian701
@banishedguardian701 4 жыл бұрын
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
@dimitrijekuzmanovic5792
@dimitrijekuzmanovic5792 4 жыл бұрын
Hello there
@zackydev
@zackydev 4 жыл бұрын
General Kenobi
@olivercharles2930
@olivercharles2930 Жыл бұрын
i am way too stupid to get trigonometry
@cjdlegendary1795
@cjdlegendary1795 10 ай бұрын
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
@DaFluffyPotato 10 ай бұрын
A flipped Y means you need to make either your angle or your sine output negative to correct it.
@cjdlegendary1795
@cjdlegendary1795 10 ай бұрын
@@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
@Inevitably_forget
@Inevitably_forget 2 жыл бұрын
Don't mind me, just looking for a reason not to say "Fuck math"
@Fullrusher
@Fullrusher 4 жыл бұрын
Discouraging :-/
@anotherone-e9c
@anotherone-e9c 4 жыл бұрын
what, how?
@Fullrusher
@Fullrusher 4 жыл бұрын
@@anotherone-e9c 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
@anotherone-e9c
@anotherone-e9c 4 жыл бұрын
@@Fullrusher what is so hard for you in this, if you face problems you can come into the discord server.
@phoenixehc
@phoenixehc 2 жыл бұрын
@@Fullrusher What helped me was to write it all down in simple steps 1 by 1. Jotting down all the key words with definitions
@vedanshyadav-ye8bx
@vedanshyadav-ye8bx 10 ай бұрын
Please make video in hindi😊
How to ACTUALLY get into Gamedev
14:01
DaFluffyPotato
Рет қаралды 751 М.
Trigonometry Concepts - Don't Memorize! Visualize!
32:35
Dennis Davis
Рет қаралды 3 МЛН
BAYGUYSTAN | 1 СЕРИЯ | bayGUYS
36:55
bayGUYS
Рет қаралды 1,9 МЛН
Мясо вегана? 🧐 @Whatthefshow
01:01
История одного вокалиста
Рет қаралды 7 МЛН
Tuna 🍣 ​⁠@patrickzeinali ​⁠@ChefRush
00:48
albert_cancook
Рет қаралды 148 МЛН
Introduction to Game Development (E22: trigonometry)
15:08
Sebastian Lague
Рет қаралды 92 М.
Dear Game Developers, Stop Messing This Up!
22:19
Jonas Tyroller
Рет қаралды 800 М.
The Folded Polynomial - N64 Optimization
14:26
Kaze Emanuar
Рет қаралды 248 М.
Essential Maths For Beginner Gamedevs - Which Math is Useful?
20:25
I Beat Minecraft From One Grass Block
35:27
Beppo
Рет қаралды 7 МЛН
A Programmer's Guide to Pixel Art
9:28
DaFluffyPotato
Рет қаралды 200 М.
Trigonometry - Easy to understand 3D animation
16:29
Physics Videos by Eugene Khutoryansky
Рет қаралды 1,2 МЛН
How Math Becomes Difficult
39:19
MAKiT
Рет қаралды 650 М.
What a Low ELO Player Thinks About
15:55
OutrightIgnite
Рет қаралды 441 М.
BAYGUYSTAN | 1 СЕРИЯ | bayGUYS
36:55
bayGUYS
Рет қаралды 1,9 МЛН