Friday, April 25, 2008

No More Magic Numbers!

Game Developers know what I'm talking about. The rest of you cretins... it's probably not worth explaining it to. But I will, because I'm caring and awesome at the same time. Magic numbers are numbers discovered through trail and error that make flawed algorithms function more appropriately.

For example, if the car is traveling way to fast, the magic number generator in my head would suggest multiplying the velocity by 0.001, and if the car is still to fast, I would add a zero and then another... or if the torque conversion is to low, I might multiply the torque output by 10 or 150.

Anyway, the upshot is that the vehicle power train no longer has any magic numbers. The engine power band is properly modeled, the transmission converts torque accurately and wheel feedback works correctly.

No comments: