Advertisement
Mountebank

gen 2 spinner mechanics

Feb 22nd, 2015
3,080
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.46 KB | None | 0 0
  1. Every spinner has an associated counter which ticks down by 1 every 2 frames. After decrementing the counter, if it is equal to 0, the game calculates both a new counter and a new direction for the spinner. The counter is chosen uniformly from the range 0-31 and the direction is chosen uniformly from all 4 possible directions. If the random direction is equal to the current direction, then the new direction is set to the paired direction as follows:
  2. old | new
  3. ------------------
  4. up | left
  5. left | up
  6. down | right
  7. right | down
  8.  
  9. This has some useful implications. First, if 0 is chosen as the random counter (1/32 chance), then because the counter is decremented before the zero check, it will underflow to 255 and the spinner will stay stuck in the same direction for about 8.5 seconds, making the spinner easy to dodge. If the spinner is stuck in a direction which makes it impossible to pass, it is faster to unload the spinner off the screen than to wait for the spinner to move again.
  10.  
  11. Second, if the spinner is not stuck, the optimal time to move is immediately after the spinner chooses a new direction and the new direction is not the paired direction of where you will cross. For example, if you do not want the spinner to face down, then the best time to move would be immediately after the spinner changes direction to either up or left. The reason for this is that if the spinner chooses a new direction from up or left, the probability of the new direction being down is only 1/4, whereas if the spinner is facing right, the probability of the new direction being down is 1/2.
  12.  
  13. Update: Exact probabilities of hitting spinners have been determined.
  14. Update 2: Pause buffer strats seem to let the spinner tick an extra time, leading to 10 frames per bike and 18 frames per walk rather than 8 and 16. Probability tables have been updated to take this into account.
  15.  
  16. Say you want to pass a spinner, and you pause buffer on your bike right next to the spinner. You see that the spinner is currently facing right, and he recently turned right, say 8 frames ago, and you want to know the probability that he will turn down and hit you while you are taking that final bike step. In this case, you would look at the (right, 8) entry in the bike table and see that the probability is 0.084, or 8.4%.
  17.  
  18. Walk probabilities: http://pastebin.com/tZpZHSvG
  19. Bike probabilities: http://pastebin.com/AKvkBxEe
  20. Stuck probabilities: http://pastebin.com/giqDE7T4
  21. Generator script: http://pastebin.com/DJ9iZpjT
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement