The relationship between game programming and math

Started by
10 comments, last by Arcand 12 years, 3 months ago
Im not so hot at math, in fact I took a refresher course in college to get my math skills up and didnt do so well at all, so im just wondering, how much can I do in game programming with a not to hot math knowlege? am I doing something here that is beyond me, seeing as math is something im not to hot at?

I am really worried about this, as right now my math skills are fine but ive only been programming for a week or two :-) Please advise!

I am really into this so far, so I am pleading to the gods that I wont run in to something I cant get help with through either a calculator or another programmer :S
Advertisement
In general, it depends on what you're programming. Things like physics and more hardcore graphics (calculating surface normals, projections, etc.) you will probably want to know your math. A lot of things you do in programming are things that don't really seem like math, but are, such as algorithms and whatnot. Math is not all about numbers.

If you're not so hot in math, figure out what's bogging you down, and practice. You'll get better eventually. If you're doing an Algebra problem, what is it that you don't do good at? Do you not understand what to do with the variables? Do you mess up on arithmetics (adding, subtracting)? Nobody has "completely no idea" what they're doing. If you have absolutely no idea what you're doing, you need to start by learning how to add and subtract. Usually a person can understand the math but has a hard time connecting it to the problem that is being worked. It's really all I can say. Try to figure why you're not so good and fix it.

Yo dawg, don't even trip.

You can always get help and for pretty much all cases there is plenty of information around. Thing is you need to know what to ask for, or for the latter, know what to search for. Math == logic and programming is mostly logic as well.

Thing is you can learn anything you want as long as you set your mind to it.
I have to say that I disagree with the people above. Logic is a part of math, but math is not logic. Programming is almost nothing but logic, but logic is not programming.

Understanding the syntax of a programming language and the semantics of the paradigm of your implementation makes you a great programmer. Although there are things you might have to implement with programming that requires math, physics for example.

There was very recently a kid (from Sweden, unless I'm mistaken) who wrote an iPhone application to summarize the information from various sites such as wikipedia, wolframalpha, etc. which was downloaded by several thousand people and which made their life simpler. And there's really not much math needed to append a string to another string or display it in a user-friendly way.

You do not need to understand math to become a programmer, and you do not need to understand the science of nutrition to become a bodybuilder.
Those who can do, do; those who can't do, do teach.

You do not need to understand math to become a programmer, and you do not need to understand the science of nutrition to become a bodybuilder.


Although probably true, this is not a great analogy. Many of the best programmers around have strong Math backgrounds or at least great mathematical ability. It probably doesn't turn out to be that way with nutrition and bodybuilders.

Although you can be a decent programmer and have a very fulfilling career without understanding Math, there are certain parts of programming that you won't be able to delve into. Of the top of my head:
* Analysis of algorithm complexity
* Some areas in AI (Bayes networks, Hidden Markov Models...)
* Signal processing (e.g., audio and video compression)
* Physics simulation
* 3D graphics

You can probably learn enough to be a user of a library in any of those areas even if you don't know Math, but you will have to live with a superficial knowledge of what's really going on.

Understanding the syntax of a programming language and the semantics of the paradigm of your implementation makes you a great programmer. Although there are things you might have to implement with programming that requires math, physics for example.


I think that's a gross oversimplification, but the question proposed was "do I need math for games programming," and since programming games is in large an implementation of algorithms and physics calculations, you will need to know math, however basic.


You do not need to understand math to become a programmer, and you do not need to understand the science of nutrition to become a bodybuilder.


You also don't need to know how your engine, transmission, or breaks operate in order to drive a car, but it certainly helps when your car breaks. Similarly, if you're implementing an algorithm and you're not quite sure what it's doing, you will probably have a hard time figuring out why it doesn't work the way it should.

But it is as you said. All in all, you probably won't need all that much math in the general programming field. It'll help from time to time, but you're not all that hard pressed for it. If you're doing game programming, I suggest to you strongly that you do make friends at least with Algebra. It will definitely help you.

Yo dawg, don't even trip.


You also don't need to know how your engine, transmission, or breaks operate in order to drive a car, but it certainly helps when your car breaks.


Driving a car is different from fixing a car. Solving math problems vs programming problems or understanding abstract mathematical concepts vs abstract programming concepts are far more related. You might have issues programming not because you lack the math skills, but having weak math skills might be a symptom of what causes you issues programming...

That said, there's a number of game development tasks (even programming sort of tasks) that aren't that sort of hard problem solving sorts. Some involve a lot of story-telling sort of mental makeup. Just be aware of your strengths and weakenesses. Play to them.
You'd be severely limiting yourself in game development without math. Even in other areas of software development, having the analytical skills of a decent math background can help a great deal in solving software problems. If you've only started programming, you have plenty of time to polish your math skills. Hell, programming helped me to be better in math because I could always write code to help wrap my head around a concept.

You can program without math but programmers that do not understand the basics can be infuriating to work with. If you're only looking at this as a hobby, I wouldn't worry about it too much. Programming requires studying and, at some point, you'll run into a math problem that requires studying too. Cross that bridge when you get to it. If you want this to be a career, get a well-rounded education and study hard. Like I said, programming requires studying anyway. You'll always be facing things you need to learn. As a professional, you can't back down from a challenge. Taking math head-on will get you into an important habit.
Quit screwin' around! - Brock Samson

Im not so hot at math, in fact I took a refresher course in college to get my math skills up and didnt do so well at all, so im just wondering, how much can I do in game programming with a not to hot math knowlege? am I doing something here that is beyond me, seeing as math is something im not to hot at?

I am really worried about this, as right now my math skills are fine but ive only been programming for a week or two :-) Please advise!

I am really into this so far, so I am pleading to the gods that I wont run in to something I cant get help with through either a calculator or another programmer :S


There are some good bits of advice here. I'd like second a few opinions here and throw in my own. For starters, I don't think anyone has yet asked the necessary questions to get to the core of the issue.

  • What kind of math refresher did you take in college? Was it basic arithmetic, differential equations, or something in between?
  • What kind of games are you working on? This will largely determine the amount of math/physics/trig you'll need to know.

For some simple action games with 'sane' physics simulations (such as basic 2D platform games, for example), you'll need to know algebra, some basic physics, trig, and geometry. For super-basic stuff, you can probably get away with not knowing calculus for a while, but eventually you're going to need to have a grasp of derivatives and integrals.

With respect to actually learning the math, boogyman19946 (implicitly) gave the best piece of advice here, in my opinion: a link to the Khan Academy in his signature. (http://www.khanacademy.org/)

On a final note, there's no need to get discouraged about developing games if you're math knowledge isn't so good. You don't necessarily need a bunch of math classes under your belt to program games. However, if you have haven't learned the math in school, you're going to need to learn things as you go along. In my experience, that means as you progress in your game projects, you'll need to occasionally stop and review or learn some math or physics subject to solve a particular problem.

This is what John Carmack (id Software) did. There was an interview with John Carmack a few months ago that I found pretty interesting. The transcript of the interview is here: http://pcper.com/reviews/Editorial/John-Carmack-Interview-GPU-Race-Intel-Graphics-Ray-Tracing-Voxels-and-more/Intervi The entire interview is pretty interesting, but at least check out the interviewer's first question; it's about math. This (for me) is the highlight of his answer: "... [color=#000000][font=arial, verdana, helvetica, sans-serif]

knowing how to apply them to situations that weren't in the textbook and actually [knowing] how to use them for a problem that comes to you rather than something that's sitting down on a test, is what's really important."

[/font]

I'll give you my two cents. I was really struggling with math in school foremost because I never understood the real life application beyond addition, subtraction, division and multiplication. I payed no attention and had trouble understanding what was going on, and why.

When I started game development (which wasn't long ago) I had to take on linear algebra and dot product (I'm not english speaking so my math terms might be inaccurate) in order to make my bots move on a plane. Because of that, the math logic itself made sense to me and I actually learned it by myself. I'm not saying I'm good at math now obviously, but at least there's progress.

What I'm trying to say is that if you're considering game development as a hobby, don't be afraid of the math. Unless this is a phase I see no reason why you couldn't do it. There's opinions with regards to the requirements of math skills, but as far as I know there will be math involved no question about it. Just accept it. There's different degrees of depth of course.

Take it from me, who never liked math. You'll hate it for not working and you'll probably hate it even more as you delve into tougher subjects. Though once you get it, and you create something that works - the satisfaction is immense. Then again the same is also true for any programming language out there. Your eyes will bleed from documentations and books.

This topic is closed to new replies.

Advertisement