Jump to content
  • Advertisement
Sign in to follow this  
BradDaBug

The Mario jump

This topic is 4836 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

This is kind of a theoretical question. I'm thinking of the Mario jump from the old NES and SNES days (and N64? Can't remember) where the amount of time you held the jump button determined how high Mario jumped. Tap it quick and he jumps a small amount. Hold it and he'll jump pretty high. Now let's complicate this and say that we're playing a multiplayer Mario game across the Internet. Our ping is about 100 ms. How would the Mario jump be implemented? I can't think of a good way to let the server know exactly how long the player held the jump button without actually explicitly telling the server how long it was held, and even this doesn't seem good. In other words, you couldn't send just a PlayerJump message since the server doesn't know how long the player held the jump button. A better solution would be to send a PlayerJump when the button is pressed and PlayerUnJump when the button is released. But with a ping of 100 ms the amount of time the server thinks the player held the button could be drastically different than what the player actually did. So maybe we just let the client time how long the player held the jump button, but that means the server doesn't get the message until the player has already performed the jump. So maybe we send a PlayerJump message when the jump button is pressed and then when the button is released we send a PlayerUnJump message with info about how long the button was held. Is there any good way you could implement the Mario jump across a networked game?

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
just send a message to the server, informing it that the player pushed the jump button and that it was a (low|medium|high) mario-jump.

Share this post


Link to post
Share on other sites
I would send two messages: one saying "player starts jumping" and one saying "player released jump button; total duration was X milliseconds".

You can sanity check the X value against the duration between the two messages, and clean it up before echoing to other players if you're concerned about cheating -- the amount of cheating you'd allow would be equal to the tolerance you use for network jitter, which isn't really something you can get around.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!