Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Mario's air movement in the slidekick bounce segment is governed by the equations listed here: https://ukikipedia.net/wiki/Straining There has been some work on analytically optimizing this kind of movement: https://ukikipedia.net/wiki/Iwerlipse
- However, these analytical solutions are only correct under some assumptions, which don't hold in the Klepto star slidekick. Here, Mario needs to be careful to bounce in a location that lets him be high enough to collect the star on the crucial frame. It's very easy to end up slightly too low on this frame, and the analytical solutions don't account for this. Additionally, the bounce has a bad quarterframe (see https://ukikipedia.net/wiki/Movement_Steps if you don't know what that means), which isn't taken into account in the analytical solutions. Finally, the analytical solutions use Euler-Lagrange equations to solve a continuous formulation of the straining problem, but Mario's movement is discretized into frames.
- Therefore, it's sometimes desirable to use a computational brute forcer to do straining. What I used here is different from the TotWC brute forcer I did, which actually simulated the relevant (tiny) subset of the game code and can run at a much higher framerate than Mupen. The basic version of the brute forcer I used here runs within Mupen. It uses a hill-climbing algorithm and tries perturbations of a given input sequence, where the inputs are specified as intended yaws (it's assumed by my program that the joystick will be held at full magnitude). The perturbations choose a random small subset of the frames during the straining section and add a random number to each one, drawn uniformly from an interval centered about 0. I perturb more frames by a larger amount early on in the optimization phase (akin to a high learning rate) and reduce the size of the subset and the width of the intervals over time. I've just been doing this by hand, since these problems are rare enough that I don't want to take the time to write it too generally.
- However, the basic version of my program was only able to improve Iwer's inputs from 1.12 units away to about .75 units away. I decided that it was necessary to change the starting angle of the slidekick, so I manually TASed a different possibility leading up to the slidekick. Iwer's inputs weren't as suitable for this situation, so I needed some way of getting the program to generate more suitable inputs instead of just trying to optimize his inputs and ending up in a bad local minimum. I had some success at this with a combination of two approaches:
- - Adding a random small bias term to every frame for each perturbation (where the bias term is uniform across all frames, but changes for different perturbations). If Iwer's inputs were generally too far to the left or right for a new slidekick angle, this bias term would allow the program to move the inputs in the proper direction.
- - Using the analytical formula in the ending segment after the bounce, where the assumptions are much closer to holding.
- Between these two techniques, the program was able to take in Iwer's inputs and reach a basin that was suitable for the new angle. After it had settled into a new basin, I turned off the two techniques above to have it do the local optimization, and this sufficed to reach the star.
- Thanks for reading!
- -fifdspence
Advertisement
Add Comment
Please, Sign In to add comment