1) When you find something weird, try everything you can with it. Everything. You might be surprised.
2) Re-check everything.
3) Find out why everything happens.
The glitch I use to save ~900 frames is very obvious and refers to #1. You already know what I am talking about, now think of where you can apply that to save some time.
The savings in frames in my run refer to #2.
I'm not optimized yet because I myself haven't applied #3 to my TAS. Before getting too far I will do this.
Here's a script to show you some important data. I need to add more. This game is simple enough that it doesn't need anything more fancy than this, but there is some important data (at minimum Y boundary areas) that should be displayed.
char_x = 0
while true do
lev_x = memory.read_u16_le(0xFFB6) -- not correct
screen_x = memory.read_u16_le(0xF006) - 0x80 -- this is first actor, not sanik
screen_y = memory.read_u16_le(0xF000) - 0x80 -- this is first actor, not sonique
jumptimer = memory.readbyte(0x7150)
-- if memory.readbyte(0x6D95) == 255 and memory.readbyte(0x7151) == 255 then
if jumptimer == 255 then
djump_ok = 'Y'
gui.drawBox(screen_x, screen_y + 31, screen_x + 20, screen_y + 32, white, white)
else
djump_ok = 'N'
end
gui.text(120, 0, "DJumpOK? " .. djump_ok) -- NOTE: not always reliable, especially near the floor
gui.text(120, 12, "Screen-X " .. screen_x)
gui.text(256, 0, "JmpTimer " .. jumptimer)
gui.text(256, 12, "Screen-Y " .. screen_y)
gui.text(392, 0, "Lev-X " .. lev_x)
gui.text(392, 12, "Spd/px " .. memory.readbyte(0x00E4))
gui.text(424, 40, (memory.readbyte(0x97) * 256) + memory.readbyte(0x96))
if (lev_x ~= 0xffff) and (lev_x - char_x) <= 3 then
real_speed = lev_x - char_x
char_x = lev_x
elseif screen_x - char_x <= 3 then
real_speed = screen_x - char_x
char_x = screen_x
else
real_speed = 0
char_x = lev_x
end
-- show actual speed
gui.drawText(screen_x + 7, screen_y - 15, real_speed, 0xB0000000)
gui.drawText(screen_x + 6, screen_y - 16, real_speed)
emu.frameadvance()
end
Edit: 4-1 is 873 frames faster. Not including the skip it is 7 frames faster. Approaching 2K frames saved out of about 3.6K frames. Can maybe be improved, but I don't think I have any hitch points in the recording, will have to check carefully. Is anyone else other than Kurabupengin interested in a WIP of this shitty game?