• Advertisement
Sign in to follow this  

math in games

This topic is 4555 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I just was reading the thread below and I didn't want to steal a thread so I'm asking this related question in a new thread. Is complex math really necessary to make games? Or just for really complicated 3D games? I have some books that I haven't read yet that mention some stuff about physics and somebody in that other thread said that game physics is all calculus?? I don't know calculus at all. I don't know trigonometry (sp?) at all either. I know basic algebra i guess. And I think I know C++ ok. But If I want to make games like 'columns' would I really need to know calculus? Or is that just for games like some space first person shooter? I don't even know what calculus is really :D But I don't want to have to learn it just to make games. I'm hoping simple games but still fun to play and can look ok with good graphics could maybe be made without complex math? I don't think a game like Final Fantasy would require complex calculus right? I don't plan on ever making 3D complex physics games anyways.

Share this post


Link to post
Share on other sites
Advertisement
Unless you're planning to implement some heavy physics, you shouldn't need calculus. For 3D work, you'll need some trig and you'll need to know how to work with vectors(the mathematical kind) and matrices.

Share this post


Link to post
Share on other sites
With programming, the more mathematics you know, the better. However, you don't need a huge amount of knowledge to be effective.

For simple games, you won't need to know any calculus at all. Trigonometry would be very useful even for 2D game work, but isn't necessary for games like Tetris.

The bare minimum that I think you really should know would be arithmetic, algebra, logic, probability and of course problem solving. In fact, learning how to solve prolbems is the best part of mathematics.

I'd recommend that programmers also learn linear algebra (simultaneous equations, vectors and matrices), trigonometry and geometry, calculus, number theory, and set theory, but you can get to that after you've starting working on some games [smile]. You can never have enough mathematics. If only I could get my head around infinite dimension topology, I just can't understand that stuff!

Share this post


Link to post
Share on other sites
You don't acctualy need to know anything, just have a good physics engine like Newton Game dynamics, And good Graphics API.
You can simply say:
PutBox(x,y,z);
Box->setMass(45); // thats it

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
...and when it doesn't do what you expect, cpprules?

Share this post


Link to post
Share on other sites
Quote:
Original post by Anonymous Poster
...and when it doesn't do what you expect, cpprules?


Then you post a new thread here on gamedev ;)

Share this post


Link to post
Share on other sites
First you should note that there is no simple answer to your question. It all depends on what and how you want to program. If you aim to be a memeber of a professional team of programmers now or later on that do game programming, then that team will probably consist of experts of different areas of programming. But at least one of the memebers will need to be very proficient with math. It is really up to you if you want to be that individual or leave it to someone else.

For example if you wish to deal a lot with data storage, handling, sorting, manipulating and the like, then you would probably be better off with some degree in algorithms and data structures. But if you are into presentation (not just the actual drawing but the auxiliary things like camera movement and animation), hit-detection and other types of real-valued game logic, then math is very useful.

If you are the one person team you need to know a little of everything. Depending on the game you make the required math needed differs and if you wish to avoid it you can do so by choosing projects that don't involve very much math. But mark my words when I say that many things become greatly simplified if you have knowledge in math, and the more math you know the more possibilities and applications you will see.

In short I would say that the applications of math of any degree in game programming are vast and literally exist in every area of the game. The relation between programming knowledge (like algorithms and data) and mathematics to me is analogous with the realtion between a wrench and a screwdriver. You probably could manage without one of them but if you have both there is no limit to whar you could construct/repair.

I guess that it all comes down to the old paradox of mathematic studies: you don't know why you should learn it until you've learned it, and once you've learned it you couldn't for the world imagine how you could live without it before.

Sorry about the long ramble. [smile]

Share this post


Link to post
Share on other sites
Quote:
Original post by boontje
Quote:
Original post by Anonymous Poster
...and when it doesn't do what you expect, cpprules?


Then you post a new thread here on gamedev ;)


Thats Right!!!

Share this post


Link to post
Share on other sites
Programming doesn't really require any skill, other than, well, programmnig.
But depending on what you program, a lot of extra skills come in handy. To write a spell checker for a word processor, you better know everything about the language you're checking the spelling of.
To write a database, you'd better know everything there is to know about how to efficiently store, manipulate and access huge amounts of data.
And to make a game, you need... Well, it depends on the game.
You need to be able to describe what happens in the game mathematically.
If you want to make a game like Columns, as you mentioned, you need to be able to keep track of the score, you need to keep track of which blocks are at which x,y positions. (I can't remember the details of the game, so that'll have to do)
Neither requires any advanced math. You basically need to see if square x,y is occupied, what color blocks are in the neighboring squares, and possibly remove the block and add a few points to the score. And you need to be able to compute where the current block is next time you update the screen.

But what if you want to make, say, Half-Life 2?
For the graphics, you need to be able to describe the orientation, size and position of every model in the game. You need to be able to computer the new coordinates if the model turns 10 degrees to the left.
When the player throws an item, you need to calculate its trajectory. And so on and so on.

Share this post


Link to post
Share on other sites
god damn it you dont need to calculate anything if your using APIs. Like you should calculate every point on a module when it turns by 10 deggres. Just say:
DrawModel();
Model->Rotate(0,20,0);

// But i do have to agrea about that non-game related stuff

Share this post


Link to post
Share on other sites
You're still using and dealing with math when working with APIs.
The more you know about math, the more you will know about the API and what makes it work. THe more you know of that, the more you will know about you're game and the better you will be able to work with it.

I remember reading a while ago about someone who learned Calculus and said they only used it once in all the games they have programmed. Calculus is actually rather easy. If you can do Algebra you can do Calculus. It just takes a little longer to work problems out.

As people have mentioned before me, Trig and Algebra will be fine but the more math you know the better as games are really nothing but math when it comes down to it.

Share this post


Link to post
Share on other sites
I gues so, You have to understand it deeply. Like i do, hahaha.
But actualy you can't make anything without any math skills. You have to think in C.

Share this post


Link to post
Share on other sites
Quote:
Original post by cpprules
You have to think in C.


Absolutely!


Unless you're coding in C++.

Or Java.

Or Pascal.

Or Perl.

Or Python. Or Ruby. Or VB. Or LISP. Or Flash. Or C#. Or...


Programming has nothing to do with languages. Programming is in the mind, and the more your mind is attuned to thinking in terms of rigorous logic (the sort that formal mathematics employs) the more prepared you will be to think in the ways that programming requires.

Share this post


Link to post
Share on other sites
The more math you know, the more it will help.

However you can still get far with some simple math like equations, some basic trig and vectors. If you plan on making 3D graphics i can recommend matrices also.
I'm not that good at math myself, but i do know how to use vectors and matrices, and i find it's often enough. If there's something i don't know, i just look it up and learn what i have to. Of course there are times when i wish i were a math genious. The more you know the easier it will become...

Share this post


Link to post
Share on other sites
Despite some of the comments made about it, Beginning Math and Physics for Game Programmers by Wendy Stahler is a good book that covers all the basics you'll need for vector and matrix math. It goes though some of the concepts that are required in 2D and 3D games as well as tells you why you need to know them. Just go to your local bookstore and take a look through it. And don't be scared of bringing out your own peice of paper and pencil [wink].

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement