Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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.

share|improve this question
7  
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?"). –  user744 Sep 28 '10 at 14:57
2  
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. –  MrCranky Oct 1 '10 at 15:28
14  
The answer is 42. –  Jonathan Connell Jun 16 '11 at 8:27

5 Answers 5

up vote 8 down vote accepted

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.

share|improve this answer
    
Well, if they could they would patent even π, just in case. Actually, I'm not really sure someone didn't do that. –  Lohoris Jun 15 '11 at 12:36

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.

share|improve this answer
    
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. –  Trevor Powell Dec 3 '12 at 6:03
    
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. –  Kevin Dec 3 '12 at 6:41

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.

share|improve this answer

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

share|improve this answer

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.