1 2
7 8
Player (70)
Joined: 8/24/2004
Posts: 2562
Location: Sweden
Not that specific one. The one I had since before is this:
-- Player
local pbase = 0xFF1CD4
local px = pbase + 0x19
local py = pbase + 0x1D

local camx = 0xFF1BC5
local camy = 0xFF1BC9

--Player projectiles

local projbase = 0xFF1D34

--Enemies
local ebase = 0xFF21B4
--ex = ebase + 0x19 (stupid endianess)
--ey = ebase + 0x3D (stupid endianess)
--enemy hp = +0x0D
-- X radius = +0x13

--Enemy structure size 0x60


local function endian(address)
	local result = memory.readbyte(address) + (memory.readbyte(address-1) * 256)
	return result
end

local function Toki()
	local cx = endian(camx)
	local cy = endian(camy)
	local x = endian(px) - cx
	local y = endian(py) - cy
	local xoff = memory.readbytesigned(pbase + 0x11)
	local yoff = memory.readbytesigned(pbase + 0x15)
	local xrad = memory.readbyte(pbase +0x13)
	local yrad = memory.readbyte(pbase +0x17)
	local flip
	flip = memory.readbyte(pbase +1)
	if flip == 1 then
		xoff = xoff * -1
	end
	gui.box(x+xoff-xrad,y+yoff-yrad,x+xoff+xrad,y+yoff+yrad,"#0000FF30","#0000FFFF")
end

local function enemies()
	local cx = endian(camx)
	local cy = endian(camy)
	local x
	local y
	local xoff
	local xrad
	local yoff
	local yrad
	local oend = 44
	local base = ebase	
	local flip
	local hp
	for i = 0,oend,1 do
		if i > 0 then
			base = ebase + (i * 0x60)
		end
		flip = memory.readbyte(base +1)
		if memory.readbyte(base) > 0 then
			hp = memory.readbyte(base + 0xD)
			x = endian(base + 0x19) - cx
			xrad = memory.readbyte(base + 0x13)
			xoff = memory.readbytesigned(base + 0x11)
			yrad = memory.readbyte(base + 0x17)
			yoff = memory.readbytesigned(base + 0x15)
			
			if flip == 1 then
				xoff = xoff * -1
			end
			y = endian(base + 0x1D) - cy
			if hp > 0 then
				gui.text(x,y-10, "HP: " .. hp)
			end
			gui.box(x+xoff-xrad,y+yoff-yrad,x+xoff+xrad,y+yoff+yrad,"#FF000035","#FF0000FF")
		end
	end
end

local function projectiles()
	local cx = endian(camx)
	local cy = endian(camy)
	local x
	local y
	local xoff
	local xrad
	local yoff
	local yrad
	local oend = 11
	local base = projbase
	local flip
	
	for i = 0,oend,1 do
		if i > 0 then
			base = projbase + (i * 0x60)
		end
		flip = memory.readbyte(base +1)
		
		if memory.readbyte(base) > 0 then
			x = endian(base + 0x19) - cx
			y = endian(base + 0x1D) - cy
			xoff = memory.readbytesigned(base + 0x11)
			yoff = memory.readbytesigned(base + 0x15)
			xrad = memory.readbyte(base + 0x13)
			yrad = memory.readbyte(base + 0x17)
			
			if flip == 1 then
				xoff = xoff * -1
			end
			gui.box(x+xoff-xrad,y+yoff-yrad,x+xoff+xrad,y+yoff+yrad,"#FFFFFF40","#FFFFFFFF")
		end
	end

end

while true do
	Toki()
	enemies()
	projectiles()
	emu.frameadvance()
end
From what I can tell by looking at the code there are some changes.
-- Player
    local pbase = 0xFF1CD4
    local px = pbase + 0x19
    local py = pbase + 0x1D
     
    local camx = 0xFF1BC5
    local camy = 0xFF1BC9
     
    --Player projectiles
     
    local projbase = 0xFF1D34
     
    --Enemies
    local ebase = 0xFF21B4
     
    --Bosses
    local bbase = 0xFF35F4
     
     
     
     
    local function endian(address)
            local result = memory.readbyte(address) + (memory.readbyte(address-1) * 256)
            return result
    end
     
    local function Toki()
            local cx = endian(camx)
            local cy = endian(camy)
            local x = endian(px) - cx
            local y = endian(py) - cy
            local xoff = memory.readbytesigned(pbase + 0x11)
            local yoff = memory.readbytesigned(pbase + 0x15)
            local xrad = memory.readbyte(pbase +0x13)
            local yrad = memory.readbyte(pbase +0x17)
            local flip = memory.readbyte(pbase +1)
            if flip == 1 then
                    xoff = xoff * -1
            end
            gui.box(x+xoff-xrad,y+yoff-yrad,x+xoff+xrad,y+yoff+yrad,"#0000FF30","#0000FFFF")
    end
     
    local function enemies()
            local cx = endian(camx)
            local cy = endian(camy)
            local x
            local y
            local xoff
            local xrad
            local yoff
            local yrad
            local oend = 44
            local base = ebase     
            local flip
            local hp
            for i = 0,oend,1 do
                    if i > 0 then
                            base = ebase + (i * 0x60)
                    end
                    flip = memory.readbyte(base +1)
                    if memory.readbyte(base) > 0 then
                            hp = memory.readbyte(base + 0xD)
                            x = endian(base + 0x19) - cx
                            xrad = memory.readbyte(base + 0x13)
                            xoff = memory.readbytesigned(base + 0x11)
                            yrad = memory.readbyte(base + 0x17)
                            yoff = memory.readbytesigned(base + 0x15)
                           
                            if flip == 1 then
                                    xoff = xoff * -1
                            end
                            y = endian(base + 0x1D) - cy
                            if hp > 0 then
                                    gui.text(x,y-10, "HP: " .. hp)
                            end
                            gui.box(x+xoff-xrad,y+yoff-yrad,x+xoff+xrad,y+yoff+yrad,"#FF000035","#FF0000FF")
                    end
            end
    end
     
    local function boss()
            local cx = endian(camx)
            local cy = endian(camy)
            local x = endian(bbase + 0x19) - cx
            local y = endian(bbase + 0x1D) - cy
            local xrad = memory.readbyte(bbase + 0x11)
            local yrad = memory.readbyte(bbase + 0x15)
            local flip = memory.readbyte(bbase +1)
            gui.text(x-10,y-10,"HP: " .. memory.readbyte(bbase + 0x0D))
            gui.box(x-xrad,y-yrad,x+xrad,y+yrad,"#FF000035","#FF0000FF")
    end
     
    local function projectiles()
            local cx = endian(camx)
            local cy = endian(camy)
            local x
            local y
            local xoff
            local xrad
            local yoff
            local yrad
            local oend = 11
            local base = projbase
            local flip
           
            for i = 0,oend,1 do
                    if i > 0 then
                            base = projbase + (i * 0x60)
                    end
                    flip = memory.readbyte(base +1)
                   
                    if memory.readbyte(base) > 0 then
                            x = endian(base + 0x19) - cx
                            y = endian(base + 0x1D) - cy
                            xoff = memory.readbytesigned(base + 0x11)
                            yoff = memory.readbytesigned(base + 0x15)
                            xrad = memory.readbyte(base + 0x13)
                            yrad = memory.readbyte(base + 0x17)
                           
                            if flip == 1 then
                                    xoff = xoff * -1
                            end
                            gui.box(x+xoff-xrad,y+yoff-yrad,x+xoff+xrad,y+yoff+yrad,"#FFFFFF40","#FFFFFFFF")
                    end
            end
     
    end
     
     
     
    while true do
            Toki()
            enemies()
            projectiles()
            boss()
            emu.frameadvance()
    end
Can you give a quick description to what has been changed? Thank you for sharing!
Site Admin, Skilled player (1237)
Joined: 4/17/2010
Posts: 11274
Location: RU
Warning: When making decisions, I try to collect as much data as possible before actually deciding. I try to abstract away and see the principles behind real world events and people's opinions. I try to generalize them and turn into something clear and reusable. I hate depending on unpredictable and having to make lottery guesses. Any problem can be solved by systems thinking and acting.
Player (70)
Joined: 8/24/2004
Posts: 2562
Location: Sweden
Nice. Reading through that board now. I always wondered if a 7-3 skip was possible. Looks like Shrimp found a way there. Tested it my self and it works great. Now we just need to find out if it saves time or if there is an alternative route that can save more time. In Diman's last attempt he played level 7-3 in 2512 frames (calculated from hitting the exit in 7-2), so the shortcut must take us sub that. Also we need to test if it's actually faster for a TAS to go out of the way to get the flamethrower in order to beat Bashtar (the boss in 7-4). I think the flamethrower deals one damage per frame. In theory it should be faster to go on a detour to pick up the flamethrower. Crunching the numbers it took me 999 frames to beat Bashtar without the flamethrower. So we have about 915 frames to fetch the flamethrower and reach the first hit of the boss in order to get on par. Edit: Also Sonikkustar's 9-1 skip is very nice: http://www.youtube.com/watch?v=JvFFqMCoAgA&feature=youtu.be Edit 2: Some more stuff about shortcuts: Level 8-1 http://www.twitch.tv/shrimp__/c/1922225 Level 8-3 http://www.twitch.tv/shrimp__/c/1922230
1 2
7 8