• Register
Forum Thread
  Posts  
Math in relation to programming (Forums : Coding & Scripting : Math in relation to programming) Locked
Thread Options
Jan 26 2015 Anchor

I would like to know if learning a lot of the different maths would help me in programming in any language. Would it help in using C++ as well? If so, then how xould I use it to make mods for rpgs? Any advice would help. Thanks

Jan 26 2015 Anchor

Most programming languages tend to require a bit of math for various things, but having said that; most programming languages have math functions so you don't have to mess about writing complicated equations for finding pi, converting radian to degree or vice versa.

I'm not very skilled when it comes to math, but I don't let that stop me from writing scripts. If I don't know the equation / formula for something then I search for it on google (or wherever), as there's often examples available online for what you are trying to do. Even examples taken from other code formats are useful.

In regards to developing mods for RPG's, I have no idea.

Jan 26 2015 Anchor

Well thank you very much.

Feb 17 2015 Anchor

If you're new to programming, you should get familiar with Algebra. Algebra is the basis for all logic involving variables. Being familiar with the concept of reducing equations makes you a good programmer. This is a high level relation though and may seem abstract from programming, but they are very related.

For more hands on math that you use while programming games, you should learn everything to do with Vector math. Vector math forms the basis for moving objects around in 2D or 3D space. Most engines have math functions that you call so you don't have to do the actual math inside these functions, but you still need to know what they are and how and why to use them.

The following are things I use every day while programming games (search around for tutorials that explain and demonstrate these concepts):

  • create a Directional Vector between 2 points
  • Normalizing and using a Normalized Vector
  • moving objects by applying a Scalar to a Normalized vector and adding it to their Position
  • Vector addition to simulate multiple forces (gravity, etc)
  • using Dot Product to determine relations between positions
  • comparing "Distance Squared" for optimization instead of actual distance
  • be familiar with Vector "language", the common terms used to label Vector elements and functions (Euler Angles, Forward, Right, Up, Look At)
  • simple Vector Reflection for bouncing or rebounding movement

Beyond Vectors, then Matrix math and Quaternions give more power to manipulating objects in 2D and 3D space. While I believe it is important to know and understand Matrices, I don't find that I really ever need to do any Matrix Transformations unless I'm writing something very core like a camera from scratch or something like that. Usually Vectors and built in Vector Math functions do all I need. Quaternions are a way of storing position and velocity (for lack of better description) in a single 4 element unit. Like a super Vector with some properties of a Matrix (again, not the best description). Many people only use Quaternions instead of Vectors. I was taught Vectors so that's what I've always used. Many engines have functions that let you translate between Quaternions and Vectors. Unity, for example, allows you to use Quaternions but call vector functions on them.

For modding RPGs specifically, it depends on what exactly you want to change and what game you're modding.

Feb 28 2015 Anchor

Yea I would have to agree with both of them. I myself am not very good in math but what I do use everyday like firstordergames mentioned is angles between 2 points, angles of rotating characters, and movements based on simple math equations!

Reply to thread
click to sign in and post

Only registered members can share their thoughts. So come on! Join the community today (totally free - or sign in with your social account on the right) and join in the conversation.