-2
\$\begingroup\$

I'd like to find some "magic numbers" for the classic helicopter game. For example the numbers that determine how fast the helicopter accelerates up and down. Also perhaps the "randomness" of the obstacles (uniformly distributed? Gaussian?). Where can I find these numbers?

p.s. I don't care about the particular platform... Flash on the desktop browser is just as good as some implementation on a mobile device.

\$\endgroup\$
4
  • 7
    \$\begingroup\$ This question is either too localized ("Where can I find the magic constants for the helicopter game?") or too general ("Where can I find magic constants for all games ever?"). \$\endgroup\$
    – user744
    Commented Sep 28, 2010 at 14:57
  • 2
    \$\begingroup\$ This is rather a nonsensical question, as Joe points out. Magic numbers make no sense outside of the simulation algorithm you plug them into. Either you have the whole algorithm, including the constant 'tweak' factors that form part of it, or you have nothing. There are questions to be asked along this line (e.g. "is gaussian distribution a good way of placing randomly generated obstacles", "how do I tune gameplay mechanics"), but this question is not usefully answerable in its current form. Vote to close. \$\endgroup\$
    – MrCranky
    Commented Oct 1, 2010 at 15:28
  • 15
    \$\begingroup\$ The answer is 42. \$\endgroup\$ Commented Jun 16, 2011 at 8:27
  • \$\begingroup\$ possible duplicate of Analysis of Mario game Physics \$\endgroup\$ Commented Oct 10, 2014 at 21:27

5 Answers 5

8
\$\begingroup\$

Decompile the game to figure them out, but don't use any of their code, I would say the fall rate of an object cannot be copyrighted.

\$\endgroup\$
1
  • \$\begingroup\$ Well, if they could they would patent even π, just in case. Actually, I'm not really sure someone didn't do that. \$\endgroup\$
    – o0'.
    Commented Jun 15, 2011 at 12:36
4
\$\begingroup\$

You have to think like a scientist. How would you determine physical constants in the real world if you didn't know them? Observation!

Here's a good example from Super Mario Brothers: http://hypertextbook.com/facts/2007/mariogravity.shtml

If you record video of some controlled experiments, you should be able to plot the curves of a game object's motion in a spreadsheet program, and then you can fit curves to it.

\$\endgroup\$
2
  • \$\begingroup\$ For what it's worth, I'll mention that in one published platform game I worked on, the gravity on the player was not a constant at all; I had it change over time by about a factor of ten, just in order to get the weighty feel and heavy impact on landing that we wanted. \$\endgroup\$ Commented Dec 3, 2012 at 6:03
  • \$\begingroup\$ I did something similar to get a nice variable-height jump feel in Shank 2. When you let off the jump button, I turned up the gravity a bunch. I'm pretty sure that that's the secret to why Mario's jumps always feel so good, too. \$\endgroup\$
    – Kevin
    Commented Dec 3, 2012 at 6:41
2
\$\begingroup\$

If you are implementing the game itself, put controls inside the game to tweak it while you play the game. Simple pushbuttons with "+" and "-" will do the job. Start playing and tweak the values as you go until it feels right. Also, remember to print the current value on screen. Whey you found the value, paste it into the code and remove the buttons.

The same for choosing the algorithm, make it possible to switch between them during gameplay and experiment until you figure out which option is the one you prefer.

\$\endgroup\$
1
\$\begingroup\$

Just try out values and tweak them until it "feels" right.

\$\endgroup\$
0
\$\begingroup\$

This is a bad question because this is done by experiment. The game developer was likely tweaking gravity/acceleration and horizontal scroll speed right until he finished the game. You tweak it to suit the difficulty you want the game to be at.

\$\endgroup\$

Not the answer you're looking for? Browse other questions tagged .