How do video game characters move?

When I was a kid, a saw an arcade machine near my house. Although I only got to play it a couple of times, I do remember how curious I was with it. My curiosity was not linked to any gameplay but the science behind the games. I was curious how the characters followed the motion of the joystick; how the joystick was able to rotate or move the characters across the screen.


At the time, I was too small to comprehend the math involved. It took several decades until I was able to understand how game-controllers rotate and move game characters.

If you are interested in how it works, keep on reading.

Space Coordinates

A Space-Coordinate defines the position of an object. Since a game character is made up of hundreds or thousands of vertices, a space-coordinate is assigned to the character, which defines the position of its vertices.


Mathematically, a space coordinate is defined as a 3x3 Identity Matrix.

However, since a character also moves across the screen, the 3x3 matrix is extended to a 4x4 matrix which contains a translation vector.


The upper 3x3 matrix controls the rotation of the character, whereas the rightmost column determines the position of the character on the screen.

Therefore, the rotation and translation of a game character is defined per the components of a 4x4 matrix.


During the initialization of a game, the vertices of a game character are sent and stored in the GPU; the Graphics Processing Unit.

Once a game starts, the space coordinate, i.e., the 4x4 matrix values, is continuously sent to the GPU. Each character's vertex is transformed by the 4x4 matrix right before the character is rendered on the screen.

If the space coordinate matrix is the Identity Matrix, then the character is rendered without any rotation or translation.

However, if the space coordinate is modified, the GPU renders the character as rotated or translated.


Game Controller

The components of the space coordinate are modified when you move a joystick or press a button of a game controller. For example, when the joystick is moved left or right, the upper 3x3 matrix is modified causing the character to rotate.

And when you press a button (or move a second joystick) the translation vector in the 4x4 matrix is changed, causing the character to move across the screen.


This is how game controllers control a game character. They directly modify the Space-Coordinate of the game character. There is of course more to it, but this is the gist to how it works.

Hope it helps.

Untold Engine’s improvement goals for 2019

One of the weaknesses of the Untold Engine is the Collision Detection System. At times it fails to detect collisions and produces the incorrect collision response. Developing a stable Collision Detection System is tough. And I have realized that it can’t be taken lightly. Thus, my primary goal for 2019 is to focus solely on improving the Collision Detection System of the engine. 

As you are aware, the GJK algorithm is in charge of detecting collision among convex objects. The current GJK implementation has helped several ill-Conditioned Error Bounds which I have yet to improve. For example, the engine fails to detect collisions between objects of disproportionate sizes. As another example, rotation causes the algorithm to miss detections.

Moreover, the BVH algorithm, which is in charge of parsing the space between objects, is inefficient. It is currently implemented as a “Recursive” algorithm, instead of as an “Iterative” algorithm.  And The algorithm slows down after a few dozen objects. 

Finally, the Sutherland-Hodgman algorithm also has flaws. Most of the time, it produces the correct Collision-Manifolds, but at times it provides the incorrect manifolds, thus affecting the collision response of the engine. 

Getting Collision Detection to work is extremely complicated, especially for 3D convex objects, but I’m looking forward to improving the Collision Detection System and have a better engine by the end of 2019.

Thank you for reading. 

What strategies do you use to finish a project?

I'm sure you have read so many different strategies on how to successfully finish a project. To be frank, most of the well-known procedures don't work for me since they do not take into account behavioral aspect.

Over the years I've kept track on what works and what doesn't. These are the strategies that have worked for me:

Manage Energy Level

We all have limited amount of energy per day. And just like you would manage time, you must also manage your energy level.

In my case, my energy level is at its peak early in the morning. I have the least amount of energy around 2– 7 pm. And for some reason, I’m more focused late at night.

Therefore, I use my energy level to my advantage whenever I'm working on a project. I try to complete critical tasks early in the morning. If I need to read, I'll do that at night since I'm more focused. And any not so critical tasks I try to do in the afternoons.

Avoid Perfection

Seeking perfection slows you down. And more importantly, it prevents you from quickly learning what works and what doesn't.

Moreover, you don't know what you don't know. So it is a waste of time to complete a task to perfection, when you don’t know how it will affect your project as a whole.

A better approach is to implement the task until is Just Good Enough. Doing so will allow you to quickly test, debug and fix. Moreover, it will reveal weaknesses of your project that you were unaware of.

Make it a habit

The key to finish a project is Consistency. And one way to be consistent is by making things a habit.

I suggest to do at least one thing a day related to your project, no matter how small. The key is to trick your mind that you are moving forward with your goal.

Most of the time, we give up and abandon a project due to psychological factors, more so than technical ones. So, manage your energy level, try to build momentum. Avoid wasting time trying to reach perfection and do at least one task a day, no matter how small it is.

Can I develop games without a Game Engine?

You definitely can. However, you will be reinventing the wheel every time you want to develop a new game.

A game engine is a set of rendering and mathematical operations that simplifies the complexity of game development.

In layman’s term, it provides a set of tools that you can re-use every time you need to develop a new game.

For example, to build a house you need, at a minimum, the following tools: hammer, nail, saw, wood and a blueprint.

No matter how many houses you build, the only items that changes are the wood, nails and the blueprint. There is no need for you to manufacture your own hammer and saw. You simply buy them once and reuse them every time you build a new house.

A game engine provides you the algorithms and components, i.e., hammer and saw, to build a game. You simply provide the characters and the gameplay. i.e., nails, wood and blueprints.

So what exactly does a game engine provide?

A game engine provides you with the following components:

  • Math Engine: Responsible for all Linear Algebra computations, such as Space Transformations.

  • Rendering Engine: Responsible for interacting with the GPU and manages all Shaders (GPU programs) accountable for rendering 3D models and various graphics effects, such as shadows, lighting and particle systems.

  • Physics Engine: Responsible for solving the equation of motion

  • Collision-Detection System: Responsible for detecting collision among Convex objects.

You can definitely develop a game without a game engine, but you will need to implement the components mentioned above. Moreover, developing these components require a different set of expertise than what is required in game development.

What are the Pros and Cons of writing a game engine in C++?

C++ is efficient. It is as close to the metal as you can get(i.e., fast) and yet have all the Object-Oriented Programming features.

This efficiency comes, not at a cost, but with responsibility. As opposed to other Object Oriented languages, you are responsible for memory management.

C++ may be harder to grasp than other languages. And this may be a reason why people shy away from it. However, when it comes to Game Engine Development, the ”user-friendliness” of a language should not be the deciding factor. Its efficiency is.