2f7982 No.17387
is everyone that develops a game a mathematician or just a sadist?
a0a700 No.17388
>tfw all I know that I can apply to games is the pythagorean theorem, basic fractions, and square root
>can't wrap my head around how easy people make bullshit long equations with symbols or things I have no idea how they work
>I will never be able to do 3D unless I take a few years learning everything from scratch
>I don't want to be a maths fanatic, I just want to understand to to apply something I'm thinking about in 3D space
>I will never understand how everyone knows all these popular physics formulas or how they memorize it for so long
9187cd No.17389
>>17388
>pythagorean theorem
Nice try faggot, constantly comparing distance is a huge processor waste because of sqrt
e81ba1 No.17393
>>17389
He never said it wasn't.
2f7982 No.17396
>tfw all I know that I can apply to games is the pythagorean theorem, basic fractions, and square root
thats pretty much the maximum my brain can handle as well
should I just give up on 3d and focus on 2d retro games? I mean with retro styled games its acceptable to release somethign with gameboy graphics, but once you go 3D people instantly expect it to be state of the art and want it to be as realistic as possible.
8419f4 No.17397
>>17389
>sqrt for comparing distance
>not just squaring whatever you're comparing it to
c37dd8 No.17401
Guess I might be an odd one here. I did Mechanical Engineering and picked up a Mathematics co-major. Game math is simple. 3D is just linear algebra with matrix transforms. Everything else is pretty much vectors.
8d7f49 No.17402
>>17396
You're making assumptions. I just got this one game on 3DS that has like gouraud shading or whatever called X-SCAPE. It's a pretty sweet game. You can make stuff look attractive if albeit primitive in 3D still. I and many others still play PSX classics and I bet it's piss easy to get better quality than most of them.
5499f3 No.17406
>>17387
>GAME MATH
>is everyone that develops a game a mathematician or just a sadist?
You gotta know shit to do shit, otherwise you're yet another rainbow coloured hipster making depressing choose your own adventure "games"
c1417b No.17411
>>17389
we'll, it's all I know, I said I'm not smart with math
8419f4 No.17412
>>17411
You're being rused anyway. sqrt takes about as long as a division these days.
c1417b No.17413
>>17412
I am so bad I didn't even knew I was rused.
Anyway, I am just learning what the fuck cos, sin and tan is, just today, and I'm over 20, pretty fucking weird. I don't know how people use these functions in game, but if someone would explain I'd appreciate it.
c1417b No.17414
>>17413
Alright, so I watched the khan academy video, and I memorized Soh Cah Toa, I can do them. But I have absolutely no idea when I should use them or what do the resulting values even mean.
How the hell would this be useful in a 2D or 3D game for me? How would I use the result of something like this in programming?
8d0e8d No.17415
There are plenty of game genres that don't require math.
If you do want to learn, eh, it would take a bit longer than a forum post to cover. Here's some articles on math in video games. I think the series Math for Game Developers might be what you're looking for, but I haven't looked at them myself.
http://www.gamedev.net/page/resources/_/technical/math-and-physics/
2f7982 No.17416
>>17414
all i know is that its useful when you want to make something move around based on its rotation
z = z + COS(rot) * distance
x = x + SIN(rot) * distance
82d640 No.17418
>>17414
Trig isn't actually that useful in games. Learn basic linear algebra and you'll almost never need to touch an angle or a trigonometric function again.
82d640 No.17419
>>17414
>>17418
Also here's the most straightforward explanation of basic linear algebra I found when I was learning it: http://www.coranac.com/documents/geomatrix/
And then this series does a good job of introducing you to how you would apply those concepts to an actual game (yes it's the vaporware furfaggot SJWfire, but it's still useful): http://blog.wolfire.com/2009/07/linear-algebra-for-game-developers-part-1/
From there, you should be equipped to continue learning more on your own, and implement your own simple vector and matrix math library.
Some final words of advice: Don't bother trying to learn about SIMD just yet. The straightforward implementation will be more than good enough for many 3D games and just about any 2D game you could imagine. And you can't take advantage of the full power of SIMD just by rewriting your "vector class" anyway, it takes much more significant changes to convert your data into an SIMD-friendly format and you really shouldn't be worrying about that right now.
8419f4 No.17421
>>17414
>How the hell would this be useful in a 2D or 3D game for me?
Say you're firing a bullet in a 2d game. The velocity vector for the bullet would then be (m*cos(angle), m*sin(angle)), where m is the muzzle speed.
82d640 No.17424
>>17421
That could be doing more work than necessary, though, which is why it's better to get comfortable with basic linear algebra.
Say you want an enemy to fire a bullet at the player. Instead of messing with angles at all, you can just get a vector from the enemy to the player (player - enemy), normalize it (so it's of unit length), then multiply it by the desired speed.
An orbital or spiral pattern could be made by firing bullets away from the enemy, while accelerating them each frame at a vector from the bullet to the enemy that fired it. Again, just take the vector from the bullet to the enemy, normalize, and multiply by desire acceleration value.
Or say you want an enemy to fire a bunch of bullets in a radial pattern. You don't need to specify an angle for each. You can calculate one rotation matrix from the desired difference in angle per shot. Then, you do a loop, starting with a bullet whose velocity vector is pointing down, then creating another with a vector that has been rotated a bit with the rotation matrix, then creating one that's been rotated a bit from the previous vector, and so on. Same result (barring slight rounding errors), significantly less trig.
8419f4 No.17429
>>17424
>That could be doing more work than necessary, though
Depends on the situation. It could just as well be the player firing.
In any case it was supposed to be an example of those functions. No point in talking about precomputing shit etc.
82d640 No.17431
>>17429
Fair enough. I just want him to learn linear algebra ASAP, because trig isn't anywhere near as useful for game dev. Linear algebra solutions are almost always both conceptually simpler and faster to execute to boot.
ccf0cf No.17433
>>17431
>Linear algebra solutions are almost always both conceptually simpler and faster to execute to boot.
>quaternions
>not simpler
>not faster
There isn't much to know
Understand matrix transformations
understand quaternions
understand the unit circle, angles often matter..
no calculus necessary in most problems
really OP could just go on euclideanspace which explains this shit AND gives the code for pretty much any problem he'd come up on
ccf0cf No.17434
>>17396
>I mean with retro styled games its acceptable to release somethign with gameboy graphics, but once you go 3D people instantly expect it to be state of the art and want it to be as realistic as possible.
Minecraft and voxel games; you can always make the models look better if that is what you are worried about, they are just obj files(the majority of the time)
Lighting is a bitch and you need a good grasp of maths
bba3d9 No.17450
>>17421
I still don't really understand. If I want to fire a bullet in a 2D game can't I just add a variable (speed) to it's current X and Y position? If the bullet is fired can't I just keep substracting Y from it to eventually drop down? I don't understand how to use these sin/cos functions. Also logarithms.
I know that I can have a right triangle, and if I have an angle of let's say 30 degrees I can use sin to get a value from that, but I don't know what that value means or how it could help me. I wish so much that there were tutorials for complete beginners at these math functions, but they all assume that you are decent at math and they just explain it in game terms.
I made guns in games that fire bullets, and they fire where I want too because I use game maker's function point_direction and they drop down because I modify the gravity variable, I wouldn't know how to make these equations myself though.
8419f4 No.17451
>>17431
True, but you'd have a hard time understanding why e.g. a rotation matrix works without the concepts from trig.
>>17450
>I still don't really understand. If I want to fire a bullet in a 2D game can't I just add a variable (speed) to it's current X and Y position?
Sure. But adding the same value to both will get you a bullet that travels diagonally. When you multiply by sin and cos, respectively, you get values that are appropriate for whatever angle you want (including negative ones if you were aiming down).
>I know that I can have a right triangle, and if I have an angle of let's say 30 degrees I can use sin to get a value from that, but I don't know what that value means
Pic related. Say the blue line represents the direction you want the bullet to go in. sin and cos tells you what proportion the Y and X values should be.
Normally, you'd only compute these values once, when you spawn the bullet, store them and keep adding them to the position every frame.
None of this accounts for gravity, of course, the bullets would just keep going forever. But gravity is pretty easy to add also.
4c982f No.17456
>>17414
fuck trig, lern vectors
bba3d9 No.17457
>>17451
Shit man I just don't understand. I spent hours today reading the links from >>17419 and trying to understand how things work.
I get what a vector is, it specifies a direction and a length. If I multiply that with -1 I will get the reverse. If I multiply by some number I can increase it's size. If I normalize the vector I will only get the length of 1, so I can make multiplying easy. Correct me if I am wrong somewhere.
But I don't get the other things. Why the hell is a sine or cosine of something, like 45 degrees always the same? I can calculate sine of 30 on my calculator but I have no idea where it gets that value from because I didn't even specify a hypotenuse or an opposite side. I thought SOH comes from Opposite over hypotenuse, so why can I just calculate sine of 30 without specifying some side lengths? Where does it get that value from?
If I calculate tan of 50, what does it mean really? Let's say I have a player and his angle is now 0, and I want to increase his angle by 60 degrees, what should I even use here, sin, cos, or tan? Why? What if I want to make him turn to 270 degrees? This is so confusing. I never learned this stuff to begin with, I passed classes by copying at my tests in high school, I didn't knew any better then.
And now when I see all the people instinctively use sin, cos, tan, arcsin, arctan and all that it just makes me sad that I can't understand it. Even after reading shit I googled and did the khan academy videos. What the hell is arcsin/arctan anyway? You said sin and cos tells me what proportion X and Y values should be but I still don't get it, proportion to what exactly?
I know I sound super retarded now, but I just want the most basic explanations for these sin, cos, tan, arctan shit. What the values really mean, some examples in game programming, and how can you even calculate sin, cos without any side length input like I thought it could be calculated.
>>17456
Don't I still need to know a bit of trig, like the functions I mentioned in this post, before fully being able to use vectors properly?
8419f4 No.17459
>>17457
>I get what a vector is, it specifies a direction and a length. If I multiply that with -1 I will get the reverse. If I multiply by some number I can increase it's size. If I normalize the vector I will only get the length of 1, so I can make multiplying easy.
Correct.
>Why the hell is a sine or cosine of something, like 45 degrees always the same?
It relates only to the angle. You can think of sin and cos as the opposite and adjacent side, with the hypotenuse always being 1. Or, equivalently, that sin and cos are the y and x of a vector of length 1. Hence in the bullet example you can multiply them by the desired speed to get the Y and X of a velocity vector, since that just amounts to scaling the vector up.
>If I calculate tan of 50, what does it mean really? Let's say I have a player and his angle is now 0, and I want to increase his angle by 60 degrees, what should I even use here, sin, cos, or tan? Why? What if I want to make him turn to 270 degrees?
Usually you'd store the players angle so turning would just be a matter of adding/subtracting, depending on whether you want to rotate clockwise or counterclockwise.
As for tan, I've never had a use for it.
>What the hell is arcsin/arctan anyway?
Reverse sin/tan. You'd use them to find an angle when you already have a vector.
bba3d9 No.17461
>>17459
So when you calculate the sine or cosine of something, without any input of the side lengths, the calculator assumes that the hypotenuse is always 1? What are the other implied values of the two other sides then? Since from what I know you need to know the other lengths too, to calculate sin and cos.
I usually can only learn something if I see it applied in action, I drew a character that is facing at 90 degrees. Can you please explain what are some useful things that cos or sin would do to this character's angle or position, how would it affect it?
Also
> Or, equivalently, that sin and cos are the y and x of a vector of length 1
Can you draw this so I can wrap it around my shitty head?
bba3d9 No.17463
>>17461
Wait, I thought a bit more about cos and sin. Let's say I have an angle that is 65. If I use sin(65) I will get a value between 0 and 1 that tells me what point would A have and if I use cos(65) I will get what point will B have? And since it's between 0 and 1 I could multiply it by whatever I want to make the player move to that new position?
Is this correct?
8419f4 No.17465
>>17461
> What are the other implied values of the two other sides then? Since from what I know you need to know the other lengths too, to calculate sin and cos.
If the hypotenuse is 1, those other sides are sin and cos.
>> Or, equivalently, that sin and cos are the y and x of a vector of length 1
>Can you draw this so I can wrap it around my shitty head?
Pic related.
>Example
Suppose you want the position of the eyes, for the pupose of calculating visibility, firing lasers out of them, drawing them them separately from the main sprite, etc. Say they're about 35 pixels from the center and 40 degrees apart (so +/-20 degrees off center).
The left eye would then be at x=35*cos(90+20) and y=35*sin(90+20), relative to the center. The right one would be similar, except that the 20 degrees would be subtracted instead of added.
If you further wanted to rotate the eye sprites to track some object (e.g. the mouse cursor), you could get a vector from each eye to the target (just subtracting their positions), and use arctan/arcsin to determine the angle.
bba3d9 No.17466
>>17465
So in your image the hypotenuse is the black line, the sin is the green line, and cos is the red line?
>Suppose you want the position of the eyes, for the pupose of calculating visibility, firing lasers out of them, drawing them them separately from the main sprite, etc. Say they're about 35 pixels from the center and 40 degrees apart (so +/-20 degrees off center). The left eye would then be at x=35*cos(90+20) and y=35*sin(90+20), relative to the center. The right one would be similar, except that the 20 degrees would be subtracted instead of added.
Basically if I have a position and I multiply it with the cos of a degree, I would get the values of that position but rotated at the angle I input in cos right? So if I have x = 75, and I want to keep a dot on X at a certain position, can I use x * cos(160) to always keep a point 160 degrees more relative to x's position?
And if so, why did you use cos first and sin later? Can't I just use for left eye x= 35*cos(90+20) and again for the left eye, y = 35*cos(90+20). Why did you use cos for x and sin for y?
bb6ec7 No.17468
>>17461
http://www.businessinsider.com/7-gifs-trigonometry-sine-cosine-2013-5?IR=T
This has some handy animations. Animations are always the best method of explaining trigonometry to people, I find. I don't understand why most math teachers seem to never use them.
8419f4 No.17481
>>17466
>So in your image the hypotenuse is the black line, the sin is the green line, and cos is the red line?
Yeah.
>Basically if I have a position and I multiply it with the cos of a degree, I would get the values of that position but rotated at the angle I input in cos right?
No. You can't rotate a position like that, what you can do is construct it from an angle.
90f001 No.17487
>>17468
>>17481
>>17466
Jesus guys I think I finally get it. The sine of an angle is just the ratio of how much bigger/smaller the opposite side of an angle is compared to the hypotenuse and the cosine is how much bigger/smaller the ratio of the adjascent side of the angle is compared to the hypotenuse. Tangent is how much bigger is the opposite side in comparison to the adjascent side.
And if I input an angle, like 40 degrees into sine, and I will get a number smaller number than 1 which tells me how much smaller is the opposite side compared to the hypotenuse, which in the unit circle is always 1. And so if I keep increasing the angle, after about 90 degrees the sine will start decreasing again because the hypotenuse is going down this time, if it goes past 180 it's gonna be negative because the hypotenuse is reversed. Cosine however will start at a high value and it will keep decreasing because of the hypotenuse moving.
Did I got this thing right?
So I guess I can use the resulting number of the sine of an angle to create a wave, when I for example multiply it with the Y position as it will keep increasing and decreasing as the angle increases.
I'm still trying to think about how would keeping two points (two eyes) on a circle that rotates, would use cos for X though. I realize that when the circle rotates 90 degrees the cos will go from a number close to 1, to 0. And then it will be negative. I don't understand how to use cos and sin as an example to make two eyes stay close to each other on a rotating circle, and this is if I got this whole sin cos tan thing right in the first place.
And I don't know what else can you do with this other than making a wave, I have seen people use it for all sorts of things but I can't think of any. Can someone please correct me where I am wrong?
57223a No.17489
>>17387
> mathematician or just a sadist?
First, you spelled Mathemagician wrong.
Second, why can't I be both?
Having a basic understanding of trig is recommended even in 2D games where it's commonly thought to "not be needed" since trig can help with "gamefeel" when adding "juice", or doing more accurate and faster collision volumes.
A common 3D problem is "what's under my cursor?".
If you're firing projectiles it's easy to just clone the the position / rotation matrix of the player avatar for the object. But what if you want to fire a ray into the scene that corresponds to the screen coordinates?
One way is to get the inverse projection transformation and transform into world space two screen pixels (having different depths, likely the near and far clip draw distances). Then you can compute collisions using that segment.
Such a segment under the cursor is typically called a "picking ray", since you can use it to "pick" objects you're looking at.
I've seen people use Object IDs (one unique color per object) and then see which ID is under the cursor. That works if your scene isn't very dynamic or complex (since pixel readback is SLOW).
Another way is to normalize the screen pixel coordinates such that edges are at -1 and +1, then multiply by scaling factors at the near and far clipping planes. For static cameras this is much faster since the scaling factors can be computed once per Z value needed (the near clip Z and far clip Z), and the screen space to normalized space can be pre-multiplied into the scaling value.
That's just 4 multiplies, compared to 16 multiplies and 9 adds for a matrix transformation.
If the camera can be moved/rotated you just transform the two end points of the segment (N and F) by the camera's (model-view) matrix, rather than transforming by inverse-projection and MV, so it still saves a few multiplies.
Bonus, you get the picking ray's segment in world-space coordinates so you can easily collide them with the game objects' collision volumes rather than having to transform every object into camera space to do collision checks.
Pic related explains how to compute the scaling factors. The key value is the tangent of the field of view angle, and this can be computed just once per window resize / view volume change.
8419f4 No.17494
>>17487
>Jesus guys I think I finally get it. The sine of an angle is just the ratio of how much bigger/smaller the opposite side of an angle is compared to the hypotenuse and the cosine is how much bigger/smaller the ratio of the adjascent side of the angle is compared to the hypotenuse. Tangent is how much bigger is the opposite side in comparison to the adjascent side.
>And if I input an angle, like 40 degrees into sine, and I will get a number smaller number than 1 which tells me how much smaller is the opposite side compared to the hypotenuse, which in the unit circle is always 1. And so if I keep increasing the angle, after about 90 degrees the sine will start decreasing again because the hypotenuse is going down this time, if it goes past 180 it's gonna be negative because the hypotenuse is reversed. Cosine however will start at a high value and it will keep decreasing because of the hypotenuse moving.
>Did I got this thing right?
Yes.
>So I guess I can use the resulting number of the sine of an angle to create a wave, when I for example multiply it with the Y position as it will keep increasing and decreasing as the angle increases.
Yes. cos will create a similar wave. When you combine them (sin wave for Y, cos wave for X), you get a circular motion.
This is also how the eye example would work. Since the angles were 40 degrees apart, one eye would trail the other as the player rotated.
Try making a program that does this, it's easier to get a feel for it when you're playing around with it.
4668e5 No.17498
>>17494
Alright, thanks man. I will try to make a circle that rotates and has two other circles on it.
3fc731 No.17504
>>17387
Almost all mathematics and physics that go into a videogame are highschool tier. Even if you code an engine. Even the harder ones are pretty simple.
t. soon-to-be-grayhaired math student
bb6ec7 No.17505
>>17504
One exception I can think of is quaternions. At least where I live we don't get anything about those in high school. Then again I know a bunch of programmers that have no idea how they work, just how to work with them.
4a0b23 No.17510
>>17504
> highschool tier.
thats the problem, my math skills are elementary school level
57223a No.17512
YouTube embed. Click thumbnail to play.
>>17510
Well, we have some maThematics here. So, I guess, just post any prob you have (with mspaint explaNation if needed). Can't speak for everyone, but I'll try to help.
I actually started a tutorial series on learning coding and math via gamedev (in JS). If / then is simpler to grasp than infinite number lines, and, IMO, kids should learn applied mathematics so they can actually DO SOMETHING with the skills. No more asking, "When am I ever going to need $MATHS", since the answer will be, "Right now, to Just Like Make Games".
I taught myself to code at 9yrs old (BASIC), and learned algebra while other kids were practicing long division. By the time we got to trig I had already independently discovered the Pythagorean Theorem; In QBASIC the sin() and cos() functions existed and weren't well documented, so I had created my own analogous slopeRatioX() and slopeRatioY() functions out of necessity. You can make games with elementary school mathematics so long as you understand the idea of a continuum: Not every possibility of on-screen position need be programmed since an (X,Y) variable pair can represent any point (lots of kids think otherwise). So, I think if we teach kids to code then they'll be able to get a better grasp on mathematics quicker (computers are basically really expensive graphing calculators), and the #1 thing they want to code is games. Eventually I'd like to release a gamedev/learning platform demonstrating the unique way I discovered mathematics on a need-to-know basis, and found algebraic truths to be self evident. I'll probably get assasinated though, since the state wants to dumb kids down (see: vid related, and Common Core).
TL;DR: It's not your fault, but it is your problem. We're not from the government, so we're free to help.
5fd710 No.17622
>>17505
I didn't even get to quaternions in college. They were mentioned in a computer graphics class.
Now I'm doing physics simulations and using quaternions extensively for orientation: and I still have no idea how they work.
675abc No.17626
>>17504
If you want to do 3D graphics, you're looking at first-year university mathematics.
056827 No.17640
>mfw I decided it'd be a good idea to make a 3D space combat game when I am a high school drop out
Luckily I'm pretty good at faking it til I make it, and it's easy to google how to do specific things and copy someone elses solution.
056827 No.17641
>>17640
also when in doubt, lerp
lerp is magic that makes math do whatever you want somehow
2f7982 No.17645
>>17640
as long as you don't need to do collision resolution and wall sliding it shouldn't be too hard. This is the feature that every developer leaves out in their game because its near impossible to do.
ccf0cf No.17691
g=gravitational acceleration
B=Angular Difference between gravitational acceleration vector and normal surface vector
a=g*Sin(B)
This is your new acceleration
b=g*Cos(B)
This is the normal force to the surface(pushing against the block which would be ignored if it were a mountain and non interactive)
a*Cos(B)
a*Sin(B)
will give you your 2d acceleration vector, not harder to do in 3d
So what you are essentially saying is most gamedevs can't into cartesian->normal and tangential components
3fc731 No.17695
>>17645
While I haven't tried to code what's in that image, where's the hitch? Seems pretty easy to get the direction (and speed/force) vector parallel to the surface.
b1796d No.17699
>>17691
maybe you can figure it out, but the average person without a math degree will be completely lost.
I also lost you when you got to the gravitational acceleration part.
8419f4 No.17703
>>17695
It is, but when an object hits a wall, you have to remember to move the remaining distance that frame, which might in turn produce a new collision with another wall etc. You also have to ensure that floating point rounding errors doesn't let you glitch through the wall over several frames. Finally, you have to be careful about how you implement this or you might get funny behavior when you try to slide past a point where two wall segments meet.
I wouldn't say impossible, but it's certainly tricky.
4d250d No.17708
>>17695
trust me, I have tried to implement it numerous times in 3d and there will horrendous bugs waiting. Sure it might work in one direction, but try jumping or moving then sliding and bad things will happen. In the end you have to know physics along with mathematics to fully understand it and get it right.
People have written books and theories on collision response alone, so I would say its far from easy. even in some professional games, if you hug the wall and slide your character diagonally and it doesn't slide it means the devs cheated and left the feature out. its that fucking difficult and makes you appreciate games like Quake where the collision is perfect
1e6692 No.17710
That's not fair, Quake had Carmack
c37dd8 No.17716
>>17708
Difference is supporting contact instead of just collisions.
4c91d1 No.17982
>>17388
>tfw all I know that I can apply to games is the pythagorean theorem, basic fractions, and square root
>mfw the first thing I ever did independently from tutorials was fix diagonal movement speed in Unity via pythagorean theorem (used it to get the number 0.7071 which I multiply the speeds with)
dong.transform.size
Most rewarding experience of my life when the script finally worked.
72ada3 No.18028
>>17456
both are useful imo
>>17489
i never though matrix transformations would be useful
0dfb69 No.18032
Anyone know a simple way to detect collisions when two objects are in motion?
36f19b No.18033
>>18032
Bounding boxes
Mesh intersection
in that order
To start
http://www.blackpawn.com/texts/pointinpoly/
Then
http://www.realtimerendering.com/intersections.html
or just use bullet
but for a "simple way" if going full real time collision is what you mean.
Then just use bounding boxes and the first link
0dfb69 No.18035
>>18033
I guess the only proper approach is to project the mesh of a possible impact surface ahead in the direction of it's movement.
The next step would be making that projection parabolic, if it's under the influence of gravity... that means physics in space is a lot cheaper...
ccf0cf No.18050
>>18035
Of course the bounding boxes before make things way cheaper.
function intersect
If mesh1 and mesh2 bounding box intersects(a simple test)
do complex testing calculations
else
return false
Or you could just use bullet *wink *wink
0dfb69 No.18051
>>18050
I'm thinking of Bullet but my world system would be slow for it, hard surfaces are voxels and dirt/sand/water are layers.
The world format being a 3D matrix of cells means I already have 1 layer of collision checking optimization as each cell has a list of objects within, and intersecting it.
0dfb69 No.18052
>>18050
>>18051
And objects already have XYZ measurements(for placement) so those are usable as bounding box checks.
I need to learn OpenGL more, 3.3 sure is different from way back when I last used 1.3
af1f4a No.18053
>>17413
>>17414
Give me 10 minutes and I'll whip up a vector demo for you. I hope you know Lua.
af1f4a No.18054
af1f4a No.18055
>>17695
While making the force parallel to the surface would work, that's the wrong way to think about the problem. What you should be doing is putting an equal and opposite force vector coming out of the surface, and add it to the object. You'll get less problems and more things will fall into place with that framework set in.
af1f4a No.18056
>>18055
>putting an equal and opposite force vector coming out
Probably not the best way to describe it. Look up "normal force".
0f07b2 No.18194
>>17387
Can someone explain to me briefly how math ties into game programming? I don't have much of a concept of this currently
>I just want to make a 3D platformer
>Collision detection is in-engine
>Physics are in engine
From what I understand a lot of people on here have been getting pretty far with just UE4 blueprints too, I don't get it
5535f5 No.18195
>>18194
Anything that isn't on offering in your software might be impossible for you to implement. You could run into a dead end and find no way around it. One of Unity's advantages is that it lets you use a simplified programming language that gives you more control than blueprint. In Unreal you'd have to program in C++ which is much more complex than Java or C#.
Ultimately the stability and performance of blueprint created games will show if that approach is viable, or for what types of games. I haven't looked into it too much tbh.
22833d No.18221
>>18194
If e.g. you want the enemy to lob a grenade at the player, or hit him with a slow moving shot so it has to lead it. You'd have to calculate shit to know exactly what to do.
e56010 No.21596
>>17387
When you're a pro in your field, there is no such thing as not knowing or not figuring it out.
As a pro you've unlocked the highest level and got so bored that you constantly challenge yourself with almost impossible problems.
It only becomes a matter of time. You will solve it in less than a day.
e19529 No.21768
Making a character jump requires little to no mathematical knowledge, as you know most game engines have a built in Bullet physics engine, however this tool is hugely limited and widely inaccurate.
In order to accurately calculate the trajectory of a bullet in flight as if it where real life you need to have a working model of gravitation. the Bullet-physics engines usually come with a miss-representation of how gravity actually works.
You'd need mathematics, namely linear algebra to make accurate models of kinetic motion and inertia, gravitational and magnetic fields, aerodynamics and atmospheric friction, in-game lighting and shadows, etc...
It must be understood that built in game-engine physics are vastly incorrect approximations of the real thing.
So, if you're making a realistic WWII game and want to correctly calculate the flight trajectory of a bullet at an elevation of 1,000m on a cold Siberian winter in 194X, you're going to need to do the math.
If you use the built-in approximated values for the forces that govern the flight of a bullet then you might end up with a game that is functional and fun to play, but it won't play like the real thing.
That's without even getting into racing, flying, or space simulators.
76b3cf No.21778
>>21768
And then we get games that run like utter fucking shit because muh formula accuracy. For every fucking phenomenon there's good approximation of it that barely consumes any CPU time and is only different from "true" values by minuscule fractions. See fast inverse square root.
>implying you can calculate drag coefficient without carrying out full-blown airdynamics simulation that takes fucking hours to complete
141a4f No.21797
You sound angry about this. Do the mathematics make your brain hurt?
I doubt you can provide a single example of a game that was made worse by accurate simulation of forces.
By the way, if your game consumes all of the CPU on calculating a single force this is because your calculations are not accurate or optimized, nor scaled.
I am genuinely interested in an example of a game that's worse because of its realistic physics. But I know you won't respond.
1850af No.21820
well shit, I guess I should stick to art fagging and some level design. I'm absolutely terrible at math.
785d04 No.21841
>>21797
>I doubt you can provide a single example of a game that was made worse by accurate simulation of forces.
a96f85 No.21842
>>21841
Jurassic park: The lost world?
We're talking about games with realistic physics here. What ever part of this game you think is an accurate simulation, it is not.
Besides, this was a game for the Sega Saturn. Released in 1997.
If your computer can't properly run this game at full frame-rate then you must be using a real piece of crap.
d2edd0 No.21853
YouTube embed. Click thumbnail to play.
>>21842
>>21842
holy shit anon how stupid can you be
147e75 No.21874
>>17626
most unis wont teach linear algebra until after vector calculus
>>17418
Still need trig to make a rotation matrix.
And if you want to actually understand matrix*matrix multiplication thats way harder than trig which is just proportions
4b0016 No.21890
so I just spent the entire day trying to figure out collision detection and collision response.
I've concluded its a trade secret, no one actually tells you how to code it, its all just mathematics symbols and technical jargon. Its a conspiracy I tell you by giant companies to force non-mathematicians like me to use unity and unreal engine.
147e75 No.21916
>>21890
Start with 2d. Its just bounding boxes and triangles.
Response is a bit harder and requires an understanding of torque, but in 2d moment of inertia is simply a scalar instead of a matrix.
Multibody joints are fucking sorcery, youll just have to use the math without understanding it
http://allenchou.net/2013/12/game-physics-motion-dynamics-fundamentals/
147e75 No.21917
>>21890
Ofcourse, you can just do irrotational kinematics with axis aligned bounding boxes, you really don't need physics.
8650a0 No.21930
>>21917
You forgot about how vital rotational velocidensity is for irrotional kynematic online simulations, bro.
41fa08 No.21942
>>21890
Lol, those scary symbols are just predefined values that are hard to write down all the time.
It's like a shorthand, but wikipedia, wolframalpha, and google can all tell you what each symbol means and what the actual number that you have to use for the maths is.
Google every symbol in the equation individually to find out what each thing means and remember the order of operations from 8th grade.
No conspiracy.
b27031 No.21983
>>21890
It's not trade secret. It's just tribal knowledge passed down in informal form. New techniques are constantly being researched and shared. If someone tries to write a book about the current technique, it would be outdated very soon.
You can check out the GDC physics tutorial series, held by the author of Box2D and Blizzard's main physics programmer, Erin Catto, almost every year.
89c15c No.22175
>>22174
in retard-proof way
009015 No.22188
>>17699
Its not that complex is the thing.
If you understand what Sin and Cos mean in a triangle.