So I've started TASing this game because
I was fooled I immediately liked it since I learned of its existence. The first thing I noticed while TASing it is that it needs to use different movements depending of the circumstances, which results in making impossible to create an universal rule. Thus, it is necessary adjust the movements and optimize them accoring to the circumstances. In order to simpifly this job, I created a lua script that shows you the average speed in real time, relative to the speed values from script launch (I will soon implement it to the official script):
Language: lua
player_x_addr = 0x010A14
frames_amount = 0
player_x = 0
player_x_old = 0
speed_average = 0
if memory.usememorydomain("EWRAM") then
player_x = memory.read_u32_le(player_x_addr)
console.log("Starting script at frame: " .. emu.framecount() .. " with X: " .. player_x)
emu.frameadvance()
while true do
player_x_old = player_x
player_x = memory.read_u32_le(player_x_addr)
frames_amount = frames_amount + 1
speed_average = ( ( speed_average * ( frames_amount - 1 ) ) +player_x -player_x_old ) / frames_amount
console.log("Frame: " .. emu.framecount() .. " X: " .. player_x .. " Speed: " .. (player_x-player_x_old) .. " Average: " .. speed_average)
emu.frameadvance()
end
else
console.log("Error: failed to set EWRAM memory domain")
end
You need to launch this script 1 or 2 frames before the segment of frames you want to analyze, so that you can see the average speed and the speed changes.
The useful thing about this approch is that you can see how fast is a set of movements regardless its amount of frames and distance travelled: you instead judge its efficiency by looking at the final average speed amount, which is actually the ratio of distance traveled and elapsed time. This same theory can probably also applied to 3D games, by adding the the other axis and calculating the resulting space travelled by applying the Pythagorean theorem.
Here is a graph showing the four most common movements segments, optimized to the fullest:
Obviously, many circumstances require customization of these moventes sets or even creating a sets of movements ad hoc. This is not a bot after all.
I've completed the first level and I think it would nearly
impossible to improve it without discovering new tricks or bugs. Here is the bk2 file: *link deleted*
Edit: I've implemented my algorithm in your script:
http://pastebin.com/iZYw3Zrh I've set the "M" key for resetting the calculated average speed. Feel free to adjust anything.
Well, there is a thing I forgot to mention. I didn't read all the post of this topic, but maybe you don't know about the fact that if the you end a spin while landing, you won't lose speed and you will be able to walk again 1 frame faster. That's why I added a spin after my Slide+Jump combo.
Edit2: So I noticed that the WIP file by Lil_Gecko is faster than mine by about 30 frames, and I studied the SSS trick. I discovered it is actually a Slide bug
, which is triggered by pressing B on the 10th frame after the very first R press. In other words, you press B a frame earlier than the optimized moment I currently use for having a 628 average speed for the Slide+Spin combo. The good new is that you need to do this only once, at the very beginning of the level, and then you will be able to use the Slide bug after every Slide+Sping combo: thanks to this I already managed to outrun Lil_Gecko (edit: I was wrong, the bug is naturally already enabled). I'll post the movie file when I complete the first level.
And here is a new graph:
I removed the Slide+Spin+Jump combo because it's just useless. The regular Slide is useful only in very rare cases, and it's actually not a combo, thus has nothing to be optimized.