Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411281 Posts in 69324 Topics- by 58380 Members - Latest Member: bob1029

March 28, 2024, 11:11:35 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)What Kind Of Math Will I Need To Learn For Programming?
Pages: 1 [2]
Print
Author Topic: What Kind Of Math Will I Need To Learn For Programming?  (Read 3220 times)
Cheesegrater
Level 1
*



View Profile
« Reply #20 on: November 05, 2014, 07:47:39 AM »

One benefit of knowing more math beyond what's absolutely required is that it will tend to save you time. For example: if you know enough calculus to integrate your physics equations on paper, you can quickly check that they are correct before you implement.

Or if you know enough graph theory to notice that the fancy path you were thinking of having an NPC take requires finding a Hamiltonian cycle (expensive!) you won't bother.

If you're still in school, by all means, take a calculus class, or graph theory, or linear algebra. If you're past school, don't panic, it's helpful but not required.


Logged
raigan
Level 5
*****


View Profile
« Reply #21 on: November 07, 2014, 04:44:36 PM »

I'm having a hard time understanding what everyone is using trig for... IMO 99% of the time you should be using vector algebra rather than trig.

Other than linear algebra, calculus seems useful, but I agree that you don't actually need to understand any of these things to make a good game.
Logged
ஒழுக்கின்மை (Paul Eres)
Level 10
*****


Also known as रिंकू.


View Profile WWW
« Reply #22 on: November 07, 2014, 05:39:24 PM »

there are a ton of small applications that probably can't be done (or done as easily) with vector algebra. for instance, let's say you want enemies to wave as they move. or want a bullet to wave. for both you'd use the sine function. it'd help to know how it works and how to make its frequency increase/decrease and amplitude increase/decrease. someone who doesn't know any trig couldn't as easily figure out a way to make enemies wave back and forth as they approach, and that's a pretty common thing in games (example: the medusa heads in castlevania). that's just one example off the top of my head, i could probably come up with more
Logged

InfiniteStateMachine
Level 10
*****



View Profile
« Reply #23 on: November 07, 2014, 06:39:28 PM »

You could also do that with an oscillating function on a vector component. Def doesn't hurt to know it though.
Logged

ThemsAllTook
Administrator
Level 10
******



View Profile WWW
« Reply #24 on: November 07, 2014, 06:53:05 PM »

Yeah, the vast majority of my trig use in games is calling sin() for animation. Once in a while I might need atan2 for something, but it's rare. sin is extremely versatile and useful for a boatload of things.
Logged

raigan
Level 5
*****


View Profile
« Reply #25 on: November 08, 2014, 01:28:29 PM »

Ah.. I guess I never considered "know about sine waves" as trig -- I was thinking more SOH CAH TOA! Smiley

(I sort of doubt the curriculum of a trig class is going to be useful for building this sort of knowledge though, vs eg just playing around with sin())
Logged
Gtoknu
Level 0
***


View Profile
« Reply #26 on: November 08, 2014, 02:00:27 PM »

Ah.. I guess I never considered "know about sine waves" as trig -- I was thinking more SOH CAH TOA! Smiley

(I sort of doubt the curriculum of a trig class is going to be useful for building this sort of knowledge though, vs eg just playing around with sin())

You'd better stop thinking of triangles and starting thinking as horizontal component of an angle(cos), vertical component of an angle(sin), proportion of the components one to each other(tan). Would allow you to go much further with trig
Logged

wut
Sik
Level 10
*****


View Profile WWW
« Reply #27 on: November 08, 2014, 03:14:34 PM »

Yeah, trigonometry in games is mostly used to handle angles (sin+cos to move in a given angle, atan to calculate the angle between two points). In those cases it's used a lot though, provided that angles are relevant to your game. But really it isn't used for anything else.
Logged
hammeron-art
Level 0
**



View Profile WWW
« Reply #28 on: November 08, 2014, 03:23:10 PM »

(I sort of doubt the curriculum of a trig class is going to be useful for building this sort of knowledge though, vs eg just playing around with sin())

Classes are useless to learn math.
They make you so worried about the numerical result instead of the utility/effect you can get from it (eg the sine wave commented above).
Humans are good thinking but not calculating anything more than basic arithmetic in small numbers.
Computers are good and fast with numbers but not thinking.

Applying and playing around with programming is the best way to learn it.
Logged

Tycho Brahe
Level 10
*****

λx.x


View Profile
« Reply #29 on: November 10, 2014, 04:46:56 PM »

This question completely depends on the language, the application and more besides.

If you're trying to write a pathfinding AI with a state machine based internal logic then you'll need to know some graph theory, logic, and maybe a little automata theory.

If you're trying to write some AI utilising a Neural Network in Haskell, you're probably going to know some category theory, probably some calculus and more.

If you're trying to write a small bullet hell game with simple enemies, you'll probably only need a bit of linear algebra.

If you're trying to write a massively multiplayer fault tolerant game with hundreds of thousands of users you're going to probably need some concurrency theory, maybe CSP, possibly some Pi-Calculus

It's completely context dependent, which makes finding a superset of the set of math requirements pretty hard.

I'd say (off the top of my head), for basic game programming: basic linear algebra, cartesian vs polar coordinates, basic trig, predicate/propositional logic, "pre-calc" (or whatever it's called where you live: i.e. logs, exponentials, summations, etc...)
Logged
Photon
Level 4
****


View Profile
« Reply #30 on: November 10, 2014, 07:05:08 PM »

While we're on the subject, I'm curious: anyone ever use parametric equations? None of my finished games so far have really had need of them, but I feel like they could be very useful in certain circumstances. For instance, in a tower defense game enemy movement along the path could be done through a series of parametric equations. Not sure how expensive that would get though, particularly for the curves.
Logged
Cheesegrater
Level 1
*



View Profile
« Reply #31 on: November 10, 2014, 07:42:48 PM »

I do a fair bit of NURBS at the day job. They aren't very expensive. A couple of multiply scalar ops and five vector to matrix multiplications per curve evaluation. Probably a drop in the bucket compared to the CPU you're spending on physics.
Logged
Tycho Brahe
Level 10
*****

λx.x


View Profile
« Reply #32 on: November 11, 2014, 02:52:18 AM »

Interestingly this just popped up on one of my feeds, and might be useful: http://www.essentialmath.com/tutorial.htm
Logged
Pages: 1 [2]
Print
Jump to:  

Theme orange-lt created by panic