New Super Mario Bros. physics analysis (Part 1)

This is an analysis of the physics mechanics for New Super Mario Bros. Wii (NSMBW). I imagine the physics for the rest of the New Super Mario Bros series (i.e. the original DS game, the 3DS game and the Wii U game) are virtually identical.

Screenshots included in this article are the copyright of Nintendo and are used under fair use.

Game World

Like the very earliest Mario games, NSMBW is tile based. Look at this screenshot:

screen_1440154175.0

We see that the blocks by Mario’s head are clearly simple squares, but the ground seems to have smooth curves. Now we overlay a grid the same size as the blocks:mariogrid

Now we see that each part of the slope is just a tile. Here we have three different slopes: flat, 1:2 and 1:1. It’s also interesting to spot the repetitions of the tiles of the terrain.mariogrid

That said, not everything in Mario is built of square tiles. The moving platforms and rotating circular bits (e.g. World 1-1) are handled differently. I may cover this in a later part.

Movement

The Mario games are famous for having a “slippery” feeling, as opposed to many other platformers. The acceleration is slow, but the top speed is quite high, making them feel fast paced.

Without the run button pressed, it takes about a second to get to top speed. With the run button pressed, accelerating is higher and so is top speed, mimicking real drag forces. Friction is also low, taking about a second to stop from walking, and even longer from running.

On ‘ice’ tiles, all these are exaggerated, with acceleration lower, and friction lower too.

I’d always be tempted to code this movement explicitly rather than trying to do force balance, so that top speed and acceleration curve can be fine tuned to what feels best.

On upwards slopes, the horizontal acceleration and top speed are decreased, and on downwards slopes they are unchanged, again as if the forces were resolved correctly, and the force were always in the horizontal direction – rather than up the slope. Note however that Mario never runs off a downwards slope. We’ll come onto this in the next part.

Gravity

This is a fairly realistic uniform acceleration and drag (so alternatively, acceleration decreases with speed downwards).

Jumping

Jumping is quite interesting. Mario can jump up to 4 blocks high, but he can only reach this is one holds the jump button until he’s reached the top, otherwise he falls back down. Just tapping the button makes him continue jumping for a while after the button is released – he can never jump less than one block. Holding the button until it makes no difference then means he falls away instantly. So it is neither of these two possible implementations:

  • The jump speed is uniform up to a certain point in time, when it switches to using gravity
  • A uniform acceleration is applied when the jump button is pressed, and gravity is present throughout

Instead there seems to be a desired velocity, more or less a parabola, which has less deceleration than it would under normal gravity. Then releasing the button just switches to the usual gravity.

 

In the next part I will cover collisions in depth.

Leave a comment

Leave a Reply

Your email address will not be published. Required fields are marked *