What makes the marble go ’round?

One of the hardest parts (for me at least) in making games is the math. I know that probably sounds odd to hear from a hobbyist games programmer, but it’s true! I haven’t had formal training in anything past Pre-Calculus, and even that was 15 years ago.

So how would someone like me be able to get a marble rolling across a 3D landscape? Bumping into walls, sliding off cliffs and down ramps, causing major slippage on an ice tile… it’s all there. What’s the trick? It’s simple: let someone else write the code!

The language Marble Maze is written in is called Darkbasic Professional (or DBPro for short), and it has the capability of calling DLL functions. These DLLs can be coded in such a way that they are easily attached to the DBPro language itself, and when that happens you usually hear them referred to as a “plugin”.

Well, many years ago someone who was very clever “wrapped” a free physics engine called Newton Game Dynamics with a DLL and made it a plugin for DBPro. This made the dream of a 3D Marble Platformer all the more possible to attain for someone like me.

By using someone else’s physics solution I can focus more on the rest of the game. If I had never come across it then the future viability of this project would have been bleak in 2D, and impossible in 3D. After 6 years I would have still been trying to get a ball to roll down a ramp and hit a corner wall properly.

Comments are closed.