Sonic and Sega Retro Message Board: Help understanding a Mario physics guide... - Sonic and Sega Retro Message Board

Jump to content

Hey there, Guest!  (Log In · Register) Help
Page 1 of 1
    Locked
    Locked Forum

Help understanding a Mario physics guide...

#1 User is offline Travelsonic 

Posted 15 June 2015 - 03:03 PM

  • Posts: 706
  • Joined: 01-March 05
So I wanted to try my hand at making a simple Mario clone. Being a stickler for accuracy physics-wise, I looked for information, until I saw a guide on the MFGG.
Link to guide (a giant PNG)

Right now, however, I am being somewhat thrown off by the way the data is presented. For example, skidding deceleration ... subtracts 0 blocks, 0 pixels, 1 subpixel, 10 subsub-pixels, and 0 subsubsubpixels from the appropriate values?

Ugh, my head fucking hurts trying to understand this...
This post has been edited by Travelsonic: 15 June 2015 - 03:36 PM

#2 User is offline Covarr 

Posted 15 June 2015 - 04:34 PM

  • Sentient Cash Register
  • Posts: 4105
  • Joined: 05-February 07
  • Gender:Male
  • Location:The desert of nowhere, USA
  • Wiki edits:1
I can't help be of much help, but I can warn you to keep in mind that rebounding off bricks is different between NES and SNES versions of SMB1 due to a bug in Super Mario All-Stars. I didn't notice any mention of this in the guide you linked.

#3 User is offline DigitalDuck 

Posted 15 June 2015 - 05:04 PM

  • Arriving four years late.
  • Posts: 4611
  • Joined: 23-June 08
  • Gender:Male
  • Location:Lincs, UK
  • Project:TurBoa, S1RL

View PostTravelsonic, on 15 June 2015 - 03:03 PM, said:

Right now, however, I am being somewhat thrown off by the way the data is presented. For example, skidding deceleration ... subtracts 0 blocks, 0 pixels, 1 subpixel, 10 subsub-pixels, and 0 subsubsubpixels from the appropriate values?


Where did you even get those numbers? Next to "Skid Deceleration (normal)" I see "0020", which is 2 subpixels (or 0x20 = 32 subsubpixels (or Sonic-style subpixels)).

For a start, it's in hex; as such, each is 16 times smaller than the previous element. So there are 16 pixels to a block, 16 subpixels to a pixel, 16 subsubpixels to a subpixel; this means 256 subsubpixels to a pixel.

In other words, 1 subpixel = 1/16 pixel = 0.0625 pixels; 1 subsubpixel = 1/256 pixel = 0.00390625 pixels. "0020" is therefore 2 subpixels = 0.125 pixels. "0280" is 2 pixels and 8 subpixels, or 0x28 = 40 subpixels. Either way, it's 2.5 pixels.

Here, let me translate the bulk of it into pure pixels:

GROUND PHYSICS

Flat Ground Physics

                                px/f
Max velocity (walking)        - 1.5
Max velocity (running)        - 2.5
Max velocity (sprinting)      - 3.5
End-of-level walk speed       - 1.25
Airship cutscene walk speed   - 2

                                px/f^2
Walk/run/sprint acceleration  - 0.0546875
Stop Deceleration (normal)    - 0.0546875
Stop Deceleration (ice)       - 0.01171875
Skid Deceleration (normal)    - 0.125
Skid Deceleration (ice)       - 0.046875

Sloped Ground Physics

                                px/f
Uphill maximum walk speed     - 0.8125
Uphill maximum run speed      - 1.375
Sliding max speed             - 3.9375

                                px/f^2
Added downhill speed (26 deg) - 0.125
Added downhill speed (45 deg) - 0.1875
Sliding accel/decel (26 deg)  - 0.0625
Sliding accel/decel (45 deg)  - 0.125

MIDAIR PHYSICS

If Small, Big, Fiery or Hammer Mario:
- Releasing B and/or Left/Right has no effect on your speed.
- Holding the direction of motion accelerates you at a rate of 0.0546875 px/f^2 (up to 1.5, 2.5, or 3.5 px/f)
- Holding the direction opposite motion decelerates you at a rate of 0.125 px/f^2

If Raccoon or Tanooki Mario and NOT in flight mode,
- Releasing Left/Right decelerates you at a rate of about 0.0625 px/f^2 until you reach a speed of 1.4375 px/f
- Holding the direction of motion accelerates you at a rate of 0.0546875 px/f^2 (up to 1.5 or 2.5 px/f)
- Holding the direction opposite motion decelerates you at a rate of 0.1875 px/f^2

If Raccoon or Tanooki Mario and in flight mode,
- Even when holding B and the direction of flight, you will decelerate at a rate of 0.015625 px/f^2 until you reach a speed of 1.4375 px/f
- Releasing Left/Right decelerates you at a rate of 0.0625 px/f^2 until you reach a speed of 1.4375 px/f
- Holding the direction of motion accelerates you at a rate of 0.0546875 px/f^2 (up to 1.4375 px/f)
- Holding the direction opposite motion decelerates you at a rate of 0.1875 px/f^2

JUMP PHYSICS

                                px/f
Jump, X Velocity < 1 px/f (-Y)  3.4375
Jump, X Velocity > 1 px/f (-Y)  3.5625
Jump, X Velocity > 2 px/f (-Y)  3.6875
Jump, X Velocity > 3 px/f (-Y)  3.9375
Enemy Stomp Speed (-Y)          4
Weak Enemy Stomp (-Y)           3
Maximum Downward Speed (+Y)     4.3125
Raccoon Flying (-Y)             1.5
Raccoon Slowed Descent (+Y)     1

                                px/f^2
Jump Gravity
  (A held, Y Vel < -2 px/f)     0.0625
  (Y Vel > -2 px/f)             0.3125

SWIMMING PHYSICS

                                px/f
Underwater max walk speed       1
Maximum underwater Y-speed (+Y) 2
Max swimming speed              3
Jump out of water init vel (-Y) 3.1875

                                px/f^2
Y Acceleration (moving up)      0.0625
Y Acceleration (moving down)    0.03125
Y Acceleration (at surface, +Y) 0.046875
X Acceleration (get to speed)   0.0234375
X Acceleration (no direction)   0.0078125
X Acceleration (turning around) 0.03125


That's not everything, but it's most of it. You should be able to work out how I got the values I did from the ones in the image.

#4 User is offline Travelsonic 

Posted 15 June 2015 - 05:35 PM

  • Posts: 706
  • Joined: 01-March 05

View PostDigitalDuck, on 15 June 2015 - 05:04 PM, said:

View PostTravelsonic, on 15 June 2015 - 03:03 PM, said:

Right now, however, I am being somewhat thrown off by the way the data is presented. For example, skidding deceleration ... subtracts 0 blocks, 0 pixels, 1 subpixel, 10 subsub-pixels, and 0 subsubsubpixels from the appropriate values?


Where did you even get those numbers?



From the fact that the information was not laid out in a manner that made it easy to understand to me. at least + massive sleep deprivation.

EDIT: I mean, if the numbers are floating point, what each data type represents, etc, should be better defined, clarified, considering hexadecimal can represent while integer, and floating point, and as your numbers show, you can not assume (plus, THAT was never specified, a big mistake IMO when explaining it even to people with an understanding of counting in numerous integer bases. I kinda went through a similar point of clarification when it came to a guide I saw on Konami's Dance Dance Revolution series' stepchart format, but in that case, bytes, bits, nibbbles, elementary units, were being mixed up.
This post has been edited by Travelsonic: 16 June 2015 - 09:52 AM

#5 User is offline Shadow Hog 

Posted 29 June 2015 - 02:24 PM

  • "I'm a superdog!"
  • Posts: 4341
  • Joined: 05-November 06
  • Gender:Male
  • Location:Earth
  • Wiki edits:10
I imagine they're fixed-point, not floating-point. Similar end goal (decimals!), wildly different means of achieving it.

#6 User is offline DigitalDuck 

Posted 29 June 2015 - 03:55 PM

  • Arriving four years late.
  • Posts: 4611
  • Joined: 23-June 08
  • Gender:Male
  • Location:Lincs, UK
  • Project:TurBoa, S1RL
They're fixed point. They're integer numbers of "subsubpixels", which is just their name for "1/256th of a pixel".

In other words, divide those hex numbers by 0x100 and you have the number in pixels.

#7 User is offline Travelsonic 

Posted 28 October 2015 - 08:57 AM

  • Posts: 706
  • Joined: 01-March 05
Thanks for that clarification. I wish the person who had made the guides originally clarified that, but hey, no big deal. :D

EDIT: I might actually suggest a revision where the author puts in that it is fixed point, and suggest doing what you said, DigitalDuck, for getting the number in pixels. I mean, subpixels *arguably* could be an indication that it is fixed-point, but it seems like something that might not be intuitive.
This post has been edited by Travelsonic: 28 October 2015 - 09:11 AM

#8 User is offline winterhell 

Posted 28 October 2015 - 09:51 AM

  • Posts: 1112
  • Joined: 16-October 10
  • Gender:Male
The author might be writing "floating point" for layman's sake. As far as the general public is concerned, the notion of a fixed point is less known ( even though integer is techically fixed point as well). Thats why he might be using such terms.

Its like calling the japanese Hiragana and Katakana alphabets. The proper term might be syllabary, and they have both vowels, a consonant and syllables, but people don't know that term and just saying its an alphabet gets the message through.

That being said, are you making the clone with floats or are you insisting on emulating the original?
With floats you'd be increasing the precision a tiny tiny bit, which might(a BIG might) throw off a TAS replay taken from the original game. But no human would be able to notice the difference.

Page 1 of 1
    Locked
    Locked Forum

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users