News: 11 March 2016 - Forum Rules

Author Topic: How much math and physics do you have to know for game programming?  (Read 20332 times)

Zoinkity

  • Hero Member
  • *****
  • Posts: 565
    • View Profile
Re: How much math and physics do you have to know for game programming?
« Reply #20 on: October 05, 2012, 05:19:05 pm »
Good point. 
Actually, having a good mathmatics background is great if you need to know if something is possible.  Nothing like wasting a heap of time trying a particular approach to something to find out no algorithm can ever exist, or that it will sucumb to quadratic growth. 

Geiger

  • Jr. Member
  • **
  • Posts: 39
    • View Profile
    • Geiger's Crypt
Re: How much math and physics do you have to know for game programming?
« Reply #21 on: October 11, 2012, 11:36:20 am »
Even as a 'normal-straight-consumer' programmer you *need* some math, for instance big O.

As a professional programmer for eleven years at three companies (the last six for a Fortune 500), I can tell you the amount of non-basic math I use on a regular basis quickly approaches zero.  All the stuff your professors in college (and high school?) tell you about how computer programming works does not seem to exist in the world of common programming.  Algorithms aren't a thing and code reviews are exceedingly rare.
This is the patent age of new inventions -/- For killing bodies, and for saving souls, -/- All propagated with the best intentions. --Lord Byron

Klarth

  • Sr. Member
  • ****
  • Posts: 498
    • View Profile
Re: How much math and physics do you have to know for game programming?
« Reply #22 on: October 11, 2012, 08:02:56 pm »
If you're automating office workflow or data gathering, you generally don't use math if you were doing it manually, so you won't do it in programming.  So it shouldn't surprise anybody that the skills most companies want don't revolve around post-algebra mathematics.  On the other hand, if you're into scientific programming (a minority), high mathematics and algorithms are very important.

Bregalad

  • Hero Member
  • *****
  • Posts: 2763
    • View Profile
Re: How much math and physics do you have to know for game programming?
« Reply #23 on: October 12, 2012, 08:56:41 am »
Quote
The best programmers-as-creators (computer scientists) are also skilled mathematicians... they have to be since algorithms is what math is. Look at Knuth for a prototypical example
Even as a 'normal-straight-consumer' programmer you *need* some math, for instance big O.
Of course, some math is needed.
I mean the understanding of addition, multiplication, exponential, logarithm, solving equations, and other basic math stuff will be required in your life no matter what you do.

However, anything advanced, like solving differential integrations by hand, solving integrals by hand or anything in the like is totally useless. Some of the even more advanced stuff I had to do, like complex calculus are even more totally useless, there is no doubt they are teached at university in the unique goal to discourage students. (at least where I'm studying).
Same applies for physics, you have to know what is speed and acceleration, but quantum phisics knownledge will be totally useless.

FAST6191

  • Hero Member
  • *****
  • Posts: 3393
    • View Profile
Re: How much math and physics do you have to know for game programming?
« Reply #24 on: October 13, 2012, 06:04:46 am »
but quantum physics knowledge will be totally useless.

I agree in part but the way some of the light physics is going in games these days means I would take quantum mechanics as far as light goes up to a reasonable level and water physics without Brownian motion means you might as well not have bothered past what we have today (approximations and "water effects").
It seems to have stopped for now (the first Halo era stuff gave us Doppler effect) but I imagine aspects of sound will return at some point in the not too distant future and that usually sits in the same level of books as the quantum physics for light.

Zoinkity

  • Hero Member
  • *****
  • Posts: 565
    • View Profile
Re: How much math and physics do you have to know for game programming?
« Reply #25 on: October 13, 2012, 01:22:55 pm »
A 100% fluid dynamics engine would be brilliant, but then our understanding of vortices isn't exactly there yet.

Again though, if you're a programmer you may never need to know that stuff even if you are using it simply because you rely on a library that does it all for you.  All depends what kind of programmer you are in the end.

Klarth

  • Sr. Member
  • ****
  • Posts: 498
    • View Profile
Re: How much math and physics do you have to know for game programming?
« Reply #26 on: October 14, 2012, 07:16:16 pm »
However, anything advanced, like solving differential integrations by hand, solving integrals by hand or anything in the like is totally useless. Some of the even more advanced stuff I had to do, like complex calculus are even more totally useless, there is no doubt they are teached at university in the unique goal to discourage students. (at least where I'm studying).
Same applies for physics, you have to know what is speed and acceleration, but quantum phisics knownledge will be totally useless.
The software I use requires techniques from linear algebra, advanced calculus, differential equations, group theory, and quantum mechanics, for starters.  If you're going into scientific computing (physics or chemistry), then you need this core set of skills.  If you want to develop databases, automation tools, webpages, or other "low-end" software, why go to a university?  Go to a technical school instead, where the curriculum is more practical.

Karatorian

  • Sr. Member
  • ****
  • Posts: 381
  • "Gotta get get ... 6502"
    • View Profile
    • Studio Karatorian
Re: How much math and physics do you have to know for game programming?
« Reply #27 on: October 19, 2012, 10:42:42 am »
Deep down, programming is math. Even if it doesn't seem that way. Honestly, about the only time I actually use algebra or trigonometry is when programming stuff. And don't think the more complex math courses are forced on CS students out of spite. The more groundbreaking your program is, the more maths you're gonna' need. Generally, computer science is formally treated as a kind of mathematics. (Here's a hint, they have proofs, which sciences don't.)

In game programming, it may seem like a little algebra and a few (library provided) vector and matrix operation are all you need, but that's not the case. (Besides, most high school maths are weak in the vector and matrix department.) Once you get into physics (or physics like systems, there are many), calculus becomes important too. Generally, you'll need a good grasp of Newtonian mechanics, but relativity and quantum stuff isn't relevant (yet). I'd say you need at least a high school understanding of physics even if you're using someone else's engine. You'll want college level if you write your own or have to modify one because your game universe is unusual. (Which is becoming more common these days.)

Yes, generally, you can get by with minimal math. However, you'll be limited and things will be harder on you.
Current ProjectsFinal Fantasy EngineSMB Special for NESStudio Karatorian
@loop: lda (src),y — sta (dst),y — iny — bne @loop — inc src+1 — inc dst+1 — dex — bne @loop

fellowroot

  • Jr. Member
  • **
  • Posts: 46
    • View Profile
Re: How much math and physics do you have to know for game programming?
« Reply #28 on: November 11, 2012, 07:21:51 pm »
Funny thing is that I am a double major in math and physics, but I haven't really got into programming that much.

The only real programming class I took was visual basic and unfortunately it was a self study over the summer and I felt as if I really didn't learn much.

I'm thinking about taking a programming class next semester. What I would really like to do is learn the programming skills that would allow me to hack NES and SNES games and write game editor programs for those games on those systems.

FAST6191

  • Hero Member
  • *****
  • Posts: 3393
    • View Profile
Re: How much math and physics do you have to know for game programming?
« Reply #29 on: November 12, 2012, 07:11:30 am »
What I would really like to do is learn the programming skills that would allow me to hack NES and SNES games and write game editor programs for those games on those systems.

Those are probably two fairly different skills

On some newer systems you can do things like guess what C(++) functions are being used in a given routine and work from there (indeed the faster emulators from the N64 up do exactly that) or even see a true high level language, but the NES and SNES are more or less ASM country. Here you are going to want to learn all about hardware (and both those pushed ideas to the limit to work around limitations) and how to make functions from what amount to fairly basic mathematical (conventional and boolean) principles and some of the higher level things can fall by the wayside a tiny bit.

Tool building is a different game again. You can get away without masses of user interface design but nobody will code a general use program in ASM let alone the style of ASM the NES and SNES use (quite simplistic instructions with sharp limitations is not that much alike the potentially elaborate instructions without so many limitations X86 compatible thing that your machine is probably running on right now).
Here you are going to want to learn about data types, data handling, probably some OS level programming (what directories to sit things in, what functions the OS has), maybe some network programming, conventional formats (if you thought ROM hacking formats were hard to wrap your head around you have seen nothing until you delve into the history of say HTML or some of the multimedia formats) and the functions of a language. This is usually reflected in the language used- back when a lot of hacking work was done in visual basic but MS have more or less put a stop to that language and replaced it with C# (more or less aka .net which leads to things like vb.net) and indeed many hackers use that language. Others use things like python and java where others might still use a version of C++ or even plain C.

That you have a project is a good start as trying to learn programming without a project in mind is not the easiest for most people. You will probably rewrite the program at least twice and if you share the code it will probably be torn apart, but if you make something you have made something which is more than most manage.

I have not explained it terribly well and I should also note both reinforce each other in various subtle and not so subtle ways (and sometimes not even for the best) so I think I should probably end this post for the time being.

relminator

  • Jr. Member
  • **
  • Posts: 27
    • View Profile
Re: How much math and physics do you have to know for game programming?
« Reply #30 on: November 16, 2012, 02:52:00 am »
If you just want to make point and click games, then there's not much involved but if you're into arcade style stuff you should  at least have rudimentary knowledge with:

1. Algebra (Notably Vectors and Matrices)
2. Trigonometry
3. Geometry
4. Some calculus

Here's an example of  a game I made for the Nintendo DS (you could peruse the source to get an undertanding of how arcade games are made ).

http://rel.phatcode.net/index.php?action=contents&item=Space-Impakto-DS


Some of my projects(all open source):
http://rel.phatcode.net/index.php?action=contents&item=Projects

Ryusui

  • Hero Member
  • *****
  • Posts: 4989
  • It's the greatest day.
    • View Profile
    • Tumblr
Re: How much math and physics do you have to know for game programming?
« Reply #31 on: November 16, 2012, 04:37:45 am »
Mostly I wanna know how you made those sprites. Especially for Space Impakto.
In the event of a firestorm, the salad bar will remain open.

relminator

  • Jr. Member
  • **
  • Posts: 27
    • View Profile
Re: How much math and physics do you have to know for game programming?
« Reply #32 on: November 19, 2012, 01:38:08 am »
Mostly I wanna know how you made those sprites. Especially for Space Impakto.

About 80% of the sprites are made by an artist friend of mine.  The other 20% I ripped from games using various tools(some I made).