Best way to learn maths required for game development?

Soldato
Joined
1 Nov 2007
Posts
5,615
Location
England
I've been programming for several years but what has always held me back was my poor ability when it comes to maths. I've decided that I am going to break through the pain barrier and learn the maths required to make games. The only trouble is that I have no idea where to start as I haven't done any practical maths since I was in school.

Would starting from GCSE revision guides be a good start? I'm quite keen to keep the learning fun as I don't want to get put off.

Are there any websites which allow you to solve maths problems on them for practice? I'm quite a hands-on learner and would be appreciated being able to practice on my laptop (no desk at the moment, unfortunately, so I can't do much handwriting).
 
Man of Honour
Joined
13 Oct 2006
Posts
91,163
Depending on what you actually want to do games wise the maths is quite varied - if you want to get into engine dev it is almost a bottomless pit but if you work on top of an engine either using something like the Unreal Engine or Godot or a toolkit that implements the fundamentals then the main thing you'll need is an understanding of trigonometry and vectors (mostly for things like distance calculations and rotation).

My maths is pretty poor and I get by - lots and lots of modding and once wrote a DX7 based game engine from scratch.

EDIT: I would say don't just start learning general maths - start with brushing up on things like trig and vectors and work backwards from there filling out as you need - I'd highly recommend grabbing a copy of an older game that has full source code like Quake 2/3 or Doom 3, etc. and doing some simple modding and going from there to understand what you need to know.
 
Last edited:
Man of Honour
Joined
30 Oct 2003
Posts
13,258
Location
Essex
Depending on what you actually want to do games wise the maths is quite varied - if you want to get into engine dev it is almost a bottomless pit but if you work on top of an engine either using something like the Unreal Engine or Godot or a toolkit that implements the fundamentals then the main thing you'll need is an understanding of trigonometry and vectors (mostly for things like distance calculations and rotation).

My maths is pretty poor and I get by - lots and lots of modding and once wrote a DX7 based game engine from scratch.

EDIT: I would say don't just start learning general maths - start with brushing up on things like trig and vectors and work backwards from there filling out as you need - I'd highly recommend grabbing a copy of an older game that has full source code like Quake 2/3 or Doom 3, etc. and doing some simple modding and going from there to understand what you need to know.

I find it is a lot more about the logic than it is purely the maths as well, a mate of mine is a musician and engineer and was doing a piece around music and numbers. Apparently its generally regarded as true that the number pie is melodic if plotted on a stave but he wanted to dig into Eulers number. So with just him explaining the maths I wrote him a function that would convert E to any base for any number of decimal places, base 12 is apparently what you need to plot a stave. The logic just being able to read through code and understand it is for the most part more important than the maths it represents imo.

@Cromulent you should try these: https://projecteuler.net/archives - All the maths for programming you could ever need.
 
Man of Honour
Joined
13 Oct 2006
Posts
91,163
@Cromulent you should try these: https://projecteuler.net/archives - All the maths for programming you could ever need.

Glancing at that - I have never ever used fractions in doing game development - maybe my lacking of knowledge of them means I've gone around things a longer/complicated way than they could be approached or reinvented the wheel but I've got by without ever having to consciously think about fractions.

I find it is a lot more about the logic than it is purely the maths as well

It gets interesting when you are trying to combine multiple events especially if considering 3D space in the equation mentally using both logic and maths :s for instance a teleport routine that doesn't just move a box representing the player through the game world until it gets blocked but allows you to teleport through smaller apertures as well but also needs to not end up with you stuck in scenery and find a space on the other side of smaller openings that the player can fit in at the end point, etc.
 
Last edited:
Man of Honour
Joined
30 Oct 2003
Posts
13,258
Location
Essex
Glancing at that - I have never ever used fractions in doing game development - maybe my lacking of knowledge of them means I've gone around things a longer/complicated way than they could be approached or reinvented the wheel but I've got by without ever having to consciously think about fractions.



It gets interesting when you are trying to combine multiple events especially if considering 3D space in the equation mentally using both logic and maths :s for instance a teleport routine that doesn't just move a box representing the player through the game world until it gets blocked but allows you to teleport through smaller apertures as well but also needs to not end up with you stuck in scenery and find a space on the other side of smaller openings that the player can fit in at the end point, etc.

You see my problem here don't you. I don't read properly :) In terms of game dev though depending on the engine it's generally pretty much done for you. Im fairly poor at maths and have manage to write a few fairly poor games over the years. I made a shocking lego racing clone back in the day. was properly poor but it worked.
 
Man of Honour
Joined
13 Oct 2006
Posts
91,163
Was just commenting on one bit of what is contained in that link BTW just the first thing I noticed amongst the many topics covered there was fractions hah which is something I've largely just kind of glossed over in my mind though I probably use the concepts quite a lot.

Im fairly poor at maths and have manage to write a few fairly poor games over the years. I made a shocking lego racing clone back in the day. was properly poor but it worked.

Yeah I don't think poor maths is a barrier to writing games even good ones - plenty of scope for trial and error and if you are reasonable intelligent these days plenty of information online you can piece together and make it work. Though at least some idea of the reasoning behind the maths is important to avoid bugs.
 
Soldato
OP
Joined
1 Nov 2007
Posts
5,615
Location
England
Thanks, guys. I'll see what I can do when modding a game in that case and I'll check out Project Euler as well. I'm motivated at the moment and want to put that motivation to good use. I'd like to understand the maths behind games, but I'll settle for a working knowledge if it means I can make games.
 
Soldato
Joined
17 Jun 2012
Posts
11,259
Always useful to download an open source game engine and have a look at the maths in it. It's generally high school level, bringing a whole project together though including the physics, ai, character control, music and all the rest is the real challenge then you have to get it to run over a range of platforms/systems.

Why not use a game engine like unreal?
 
Man of Honour
Joined
13 Oct 2006
Posts
91,163
Why not use a game engine like unreal?

Personally I don't gel well with stuff like the Unreal engine - too much seems fragmented and unintuitive and depending on engine often sculpted around a specific pipeline - these days I don't have the time or motiviation to sit down and code something like that from scratch in C/C++ so I miss the days of games programming languages (for instance Blitz Basic 3D) that provided a more in-between platform with solid but flexible building blocks you could use to expand to something more complex. Godot seems fairly good in that regard once you get upto speed with it but so much is obscure that you can't simply figure out without watching tutorials and exactly replicating example code.
 
Soldato
OP
Joined
1 Nov 2007
Posts
5,615
Location
England
Going straight to Unreal is jumping in at the deep end. You may want to consider starting off easy by doing some 2D work in in Unity first. Here's a good video covering an example: https://www.youtube.com/watch?v=RF04Fi9OCPc

In fact his whole channel is great for Unity related work: https://www.youtube.com/user/Cercopithecan/videos

I do have the advantage of doing C++ programming in the past so hopefully, it won't be too much of a jump. Having said that if I struggle then I'll certainly switch over to Unity (or as another person in this thread suggested I'll look into modding games with the full source code available).
 
Soldato
Joined
17 Jun 2012
Posts
11,259
Soldato
Joined
20 Dec 2004
Posts
15,844
I do have the advantage of doing C++ programming in the past so hopefully, it won't be too much of a jump. Having said that if I struggle then I'll certainly switch over to Unity (or as another person in this thread suggested I'll look into modding games with the full source code available).

If you know some C++ then you should be ok with Unreal, there's just a bit of learning curve to understand it's reflection system, and the macros and stuff required to get it to work. In terms of maths, speaking as a profession game dev...the basic things you need to know are :

Vectors
Dot Product
Cross Product
Quaternions (not necessarily how they work, just what they're useful for)
Basic Trigonometry (pythagoras, sine, cosine etc)

With those basics you can get on your way. You'll soon get into things like calculus, various collision detection techniques and other algorithms, but you can just look them as you need em.

Really in game dev you're not so much interested in the Maths side of things, mostly algorithms, which ones to use and what for.
 
Soldato
OP
Joined
1 Nov 2007
Posts
5,615
Location
England
If you know some C++ then you should be ok with Unreal, there's just a bit of learning curve to understand it's reflection system, and the macros and stuff required to get it to work. In terms of maths, speaking as a profession game dev...the basic things you need to know are :

Vectors
Dot Product
Cross Product
Quaternions (not necessarily how they work, just what they're useful for)
Basic Trigonometry (pythagoras, sine, cosine etc)

With those basics you can get on your way. You'll soon get into things like calculus, various collision detection techniques and other algorithms, but you can just look them as you need em.

Really in game dev you're not so much interested in the Maths side of things, mostly algorithms, which ones to use and what for.

Cool. Thanks. That is a really useful post. I think I should be able to get up to speed on those pretty quickly. It is nice to know that the maths side of things isn't as important as I once believed since I've always been hopeless at maths. I just want to make a game really badly.
 
Soldato
Joined
20 Dec 2004
Posts
15,844
Cool. Thanks. That is a really useful post. I think I should be able to get up to speed on those pretty quickly. It is nice to know that the maths side of things isn't as important as I once believed since I've always been hopeless at maths. I just want to make a game really badly.

There are aspects of game development where you can go very deep into the mathematics side of things....but a decent grasp of vectors and associated stuff is all you really need to commit to memory. I have a big reference book of Mathematics for 3D game programmers that I dive into when I need anything I don't know off the top of my head....

Wouldn't hurt to be a maths whiz of course, but Matrix learning tech isn't a thing yet, so....
 
Soldato
OP
Joined
1 Nov 2007
Posts
5,615
Location
England
There are aspects of game development where you can go very deep into the mathematics side of things....but a decent grasp of vectors and associated stuff is all you really need to commit to memory. I have a big reference book of Mathematics for 3D game programmers that I dive into when I need anything I don't know off the top of my head....

Wouldn't hurt to be a maths whiz of course, but Matrix learning tech isn't a thing yet, so....

Oh, what is the book called? Sounds useful.
 
Soldato
OP
Joined
1 Nov 2007
Posts
5,615
Location
England
The ISBN is 1435458869. It's not particularly beginner friendly, you're better off with online tutorials for the basics tbh, but a good reference.

Thanks. I'll see what I can come up with. There is a video series on GameDev.tv that I got from a Humble Bundle which I am going to watch. No idea if it is any good or not though.
 
Back
Top Bottom