Friday, July 19, 2024

Testing the Numbers for Platformer Player Controls

Taxonomy of Virtual Spaces Part II

As detailed in my last post, I used Excel to create formulas to translate Super Mario Bros. physics values (measured in pixels and frames) into metric values (meters and seconds) so that I can use them with my character controller in Unity. It didn't take long to realize that something was wrong.

These make for VERY slow acceleration!

For the acceleration values, I multiplied the calculated distance values by 60 when I meant to multiply them by 60^2 (3600). No wonder my character seemed to get up to speed slowly: I was off by a factor of 60! Once I made that change, the character felt much snappier.

When comparing directly to SMB, my run speed seems slightly fast. In SMB, it takes Mario about 3 seconds to cross one screen width (16 blocks) from a standstill when walking and about 2 seconds when running. My character is covering that distance (16 meters) in a little less time (about 2.6 and 1.6 seconds, respectively), but it is close enough that I can move on and concern myself with other aspects of the controller.

No comments:

Post a Comment

Sluggo the Virtual Puppet: Part 4

Continued from  Part 3 . Winter 2025 Review: Sluggo the Virtual Puppet Sluggo says "hello" This is a continuing journal of my proj...