Required Maths

Now I know most people say “You don’t need maths to do programming or game programming”

However, I really want to know what Maths is required or useful when learning Programming in general and Game programming.

Could anyone list for me the subjects of Maths that will be helpful for me to get into and perhaps a stage in which to study these.

well, when you get a computer science degree, you take courses in calculus, linear algebra, and most importantly Discrete mathematics! In fact, in many schools, you will only need to take a few more math classes to get a minor in math while you are getting a CS degree. Thats alone tells you how important math is for programmers. You also take courses in calculus based physics to go on top of all of this. With game programming, these subjects are even more important.

Who ever told you that you dont need to do any math to do programming did you a great disservice. Sure its technically true, but I can also say “you dont need to know how a computer works, its basic terms to do any programming.” Sounds silly doesn’t it? Same with math.

In short, if you want to be at least a decent coder, you should get very familiar with different types of math. You dont have to be a super hard core math lover, but you can not ignore math. This is coming from someone who works in the game industry as a programmer.

After all, everything that goes beyond coding some beginner stuff or just stringing some prefabed algorithms together, will definitely require math… Writing algorithms in fact is some kind of math, even though not usually what one thinks about but theoretical CS and math are usually highly interoperable… A usual programmer though might not see much of it, since they don’t need to invent fancy algorithms. A CS degree is also not really a programmers degree. When you study CS you probably want to lead programmers ;)… But still you can do well without math if you don’t want to invent algorithms. In my experience most CS students don’t know jack about math and even if they did for their exams they have no understanding of this stuff whatsoever… So don’t take it too hard ;). I am a math instructor for computer science students and it is impressive how many things they actually don’t know :wink: well and don’t understand…

For game programming you should look at linear algebra… If you find a game oriented book, you will also get started without much references to other fields of math. I would avoid theoretical books if you only want to learn this stuff for programming…

I majored in mathematics and was hobbyst programmer, I landed myself a job in the games industry as a programmer quite easily. Having said that, most of what I learned at uni was very abstract and not applicable to the real world anyway. I think for a team having at least one person which has a strong maths background is adventageous.

The level of maths used in day-to-day game dev is quite simple, here are a few things which i find useful:
vector dot product
vector cross product
interpolation

Unity will handle most of this for you, but knowing what is going on behind the scenes makes it a lot easier to debug errors when things go awry.

Yeah, Vector Math and Trig is the bare minimum you really need to understand to be able to do much in game programming, and Matrices is also very close to a must to. I hate maths, and have never been super good at it, but I can’t get away from much of it when making my games, so better to learn it and embrace it :slight_smile:

But this really depends on which subjects you choose ^^. I mean if you dig into Topology and Logic, then you probably are out of luck ;). But things like discrete differential geometry are quite important for game middleware or software renderers for example and also a lot of other stuff like algorithmic geometry, probability theory, discrete math in general, differential equations (speaking of fluid simulations, clothing, etc) and numerics and stuff… There are really only a few things that are not of high importance to the industry in a math major. What might be more problematic is to find a job (there are sure not so many) they really need this advanced knowledge AND you liking this job… If you really have no use of your math major then you either choose the wrong job or specialized in the wrong subjects… But maybe you are more happy with the job you have now so its no problem ;). But I couldn’t bare to study 5 years just for the paper they hand you…

To answer your question:
-Algebra
-Trig.
-Calculous
-Stats.

Also focus on anything that has to do with matrices.

The important thing with math when it comes to programming is that you know whats happening. Its not important to be able to actually calculate things in your head as much as it is you understand whats happening.

If you happen to find a 9th-12th grade math book it can be a great resource. The problem with books that aren’t game related is they’ll give you problems which you cannot always tie into situations you may run into but again focus on whats happening, remember what does what, and try and understand simplification as much as possible.

After that the most benefitial thing relating to math and programming is getting a understanding of the power/cycles some things take. For example:
tangent, sine, cosine those are more expensive.
square root is somewhat expensive (sqrt).

one example of how to optimize code using sqrt to check if a unsquared number is less that the square root of a squared number is to just square the unsquared number instead of calling sqrt.

Give it a year and you’ll be understanding everything, a couple years after that you’ll feel very comfortable.

One other thing i think is really under-valued with programming and understanding it can really make you eons better of a programmer is binary math. This really gives you a very very basic idea of how binary works. http://www.youtube.com/watch?v=qdFmSlFojIw

What about Physics? Isn’t that a little more important?

Only if you’re writing a physics engine.

Problem solving is much more important than maths. Certainly you’ll be able to calculate the odd job here and there being a math wiz, but with so much abstracted and the hard work done in unity, your maths basically boil down to logically solving a problem with the unity commands available.

I can’t honestly, hand on heart say that my current game actually requires anything more than a secondary (high school) level of maths.