Math for games development help please

What are some math lessons i need in order to make a 2D spaceshooter game? i know i need everything in Linear Algebra, but what else? thanks
Linear Algebra helps but isn't strictly necessary.

2D shooters are actually quite simple and don't take a whole lot of math. If you understand the basics of what sin/cos are and how to use them, then that'll be enough to do most of what you'd want to do.

But even that you might not need, depending on how complex (or not) you want the game to be.
but don't u need to know things like vector algebra and such? (thanks for the quick answer)
Like Disch mentioned it really all depends on how complex you want the space shooter to be.

For example if you want to make a top down space shooter like a Asteroids clone the math would be quite simple. You would really only need to know basic Linear Algebra and basic Physics (You might not even need this but movement is always much smoother if you deal with velocities and acceleration forces).

It really amount to how complex you want the game to be. Though if you are looking for some pointers on what maths to study for basic 2D game development here is a little list to start from (Meant to be a starting guide only. There is much much more you can learn that would be helpful).

Coordinate Systems - Get to know exactly how coordinate systems work and how they are used in game development. Specifically make sure you know what World Space and Local Space is. Transforming stuff to local space simplifies many equations.

Vectors - You are going to use vectors A LOT in 2D game programming. It could range from just keeping track of a position to complex AI code. You need to know exactly how they work if you want to do anything serious (Specially AI code). This includes stuff like learning to normalizing to find the direction, getting the angle between two vectors using the Dot product, ect.

Vectors are very useful and I can't stress enough the importance of learning them if you already don't know them. A simple example of how they are useful is this.

Lets say you have a game entity that is standing at position T and facing the direction H (Normalized vector). And you have another entity at position P that you would like to aim at and shoot your bazooka to blow them up. We just need to know how many radians to rotate so that we are facing the target at position P. The only problem is we only have access to the vector H.

This can easily be solved with vectors and the Dot product. I won't go into the maths here and this is only a simple example but it is very important to know vectors.

Trigonometry - This is another that you should know for game programming I would say. So I would advise brushing up on your theorems and get at least a basic understanding of trig if you don't have one already.

Basic Physics - Now you most certainly can do a nice game without having any physics in the game. But more then likely you will want at least some sort of physics in your game. Knowing the basics of how to use forces to direct a entity around your game can make complex AI behaviors quite simple to create (A good starting point would be looking into Steering Behaviors http://www.red3d.com/cwr/steer/ ). So while physics isn't necessary in every game (Some games physics will even ruin the game) it is still very helpful to understand.

Hopefully this might give you a starting point if you looking for one.
Last edited on
Thank you CodeGazer! really helpful.
http://www.helixsoft.nl/articles/circle/sincos.htm

that tshe best link you can get ever
I skimmed that article @ devonrevenge...

That link wrote:
Nintendo calls this trick "Mode 7" and that is what I shall be calling it too.


grumble grumble grumble.

"Mode 7" doesn't have any special meaning other than it's the last of 8 different display modes available on the SNES (commonly referred to as "mode 0" through "mode 7").

Mode 7 does not actually refer to a special graphical effect. It's just called that because to enable it, you literally write a value of '7' to a 'mode' register.

This makes about as much sense as calling the graphic style used in <insert 2D platformer game here> "Mode 4" because mode 4 on the SNES produces a similar effect.

grumble grumble grumble

</pet peeve>



Anyway that article does a decent job of explaining how to leverage sin/cos in common game-related calculations, but when it starts getting into doing graphic effects manually, it kind of goes off the rails.

It's a neat trick to do that stuff manually but you really shouldn't. Stretching/scaling and other pseudo 3D effects are best left to 3D hardware. The way he does those effects is more difficult and slower than 'the right way' to do it.

So if you must... take the math stuff out of that article... but I say disregard all the drawing stuff.
@devonrevenge, nice site, helped me out a bit, thanks ;)
Topic archived. No new replies allowed.