Miguzepinu

Hat Teleporting

May 28th, 2018
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.78 KB | None | 0 0
  1. Normal walking speed is 512.
  2. When Luigi is underground, walking speed is halved (256).
  3. If you high jump on Luigi while he is underground, Mario can now walk at 512 units per frame, while Luigi is still at 256.
  4. The game uses a follow path to determine where the bro in back will walk every frame. Put simply, this is a list of the 256 most recent x-y positions of the bro in front. For some reason, there is a 64-unit spacing between these positions, so when walking normally, 8 entries are changed in the list per frame (since 8*64=512). To my best knowledge, here's what happens on a frame of normal movement:
  5. - Bro in front moves in the direction held 512 units (we'll ignore diagonal movement)
  6. - The distance he covered is divided into 64-unit segments, and the 8 endpoints of these segments are written to the follow path.
  7. - The position of the bro in back is moved forward 8 indices in the follow path (I'm not sure how the game handles the rare situation in which the bro in back starts at a position not in the follow path)
  8. Now, when Luigi is in front moving at 256 units per frame, he only writes 4 positions to the follow list every frame. If Mario is moving at 512 units per frame, he will still advance 8 positions in the follow path. So Mario will eventually catch up to Luigi, and they will be at the same position as well as at the same index in the follow path. On the next frame of movement, Luigi will overwrite the next 4 follow path values while Mario still looks 8 values ahead. Since the follow path isn't reset or initialized when you enter a loading zone, the position Mario goes to can vary a lot. Often he won't go to the exact x-y position - I think walls and changing floor heights can cause the position to be different, and sometimes only his x or y position changes for some reason.
Add Comment
Please, Sign In to add comment