Posts for scantics

Experienced Forum User
Joined: 5/15/2014
Posts: 4
Location: San Diego, United States
I have some code here that I've been trying to make work, but I'm not sure what's going wrong. I watched an x-y pair that I'm almost certain is picked up by readbyte() in the for loop, just to make sure something has canvas coordinates. Yet drawRectangle isn't giving me anything with the inputs I give it. I'd love to hear any suggestions, since coming from Python, I see Lua as some kind of special needs child that I have to work with. gui.drawRectangle(100,100,5,5), if put inside highlightSprites(), gives a very apparent white square.
Language: lua

--not used function map(f, arr) for index,value in pairs(arr) do result[index] = f(index,value) end return result end meX = 0 meY = 0 --canShoot = false function boxSprite(name,position) gui.drawRectangle(position[0],position[1],5,5) end --dudewat no colons this is spooky where's muh python function highlightSprites() --probably not bytes, will determine the correct read when I get home and have the game in front of me meX = memory.readbyte(0x000B88) meY = memory.readbyte(0x000B8C) --seriously this language is like made of marshmallows --this assignment is index-explicit for a reason --because {meX,meY}[0] == nil --like wow positionTable = {} positionTable[0] = {} positionTable[0][0] = meX positionTable[0][1] = meY top = 0x000BD8+25*0x50 --not sure how big the object table is but on frame 3737 for i = 0x000BD8, top, 0x50 do positionTable[i] = {[0] = 0,[1] = 0} positionTable[i][0] = memory.readbyte(i) positionTable[i][1] = memory.readbyte(i+2) end --map(boxSprite,positionTable) i = 0 while(i ~= nil) do gui.drawRectangle(positionTable[i][0],positionTable[i][1],5,5) i = next(positionTable,i) end end --emu.registerbefore(highlightSprites) while true do emu.frameadvance() highlightSprites() end
[img url=i.imgur.com/8vCpFuH.gif][/img]
Experienced Forum User
Joined: 5/15/2014
Posts: 4
Location: San Diego, United States
Oh wow this is excellent. That means we have a consistent object table. I was afraid the heap would be played fast and loose with enemy spawning, but of course with that hardware you have to be meticulous to fit all your stuff! Miscellaneous notes: 0x0001F0 - 0x0003DE are stagnant with an alternating pattern before enemies spawn, which suggests they involve enemies as well. Could be a buffer for the graphics renderer, I dunno. 0x000BA4 looks like an animation counter or something. I'll try to formalize the object table tomorrow.
[img url=i.imgur.com/8vCpFuH.gif][/img]
Experienced Forum User
Joined: 5/15/2014
Posts: 4
Location: San Diego, United States
Thanks! Anyway, I just found out that the fruity pebble heads only drop a candy when you kill all of them. Good to know. Also, I think I've narrowed horizontal position to 3 addresses: 0001E0 0001E4 0001E8 It's also possible that position on-screen is stored in two 16-bit ints, but probably within those words? Will investigate later.
[img url=i.imgur.com/8vCpFuH.gif][/img]
Experienced Forum User
Joined: 5/15/2014
Posts: 4
Location: San Diego, United States
I started working on a playaround run, and I'm just past the first must-kill boss. I need to optimize that fight and the menu, but I wanted to get feedback on the entertainment approach. I'm not so interested in optimizing it until it's complete, because it'd be a good exercise in editing with TAStudio. Link to video Anyway, since this sort of thing has been done (and started with Gradius), I want to try something different with Parodius as well: writing an AI script that achieves the goals of my manual attempt without any human guidance. The only problem is finding the RAM addresses that the script needs to understand state. I could really use help on this, because it's not nearly as simple as one might expect. This is all I have so far:
Input Bitfield: 000026
System clock: 00003A
Stage Clock: 000078
I can't even find my character's position on screen. Any tips or links to a discussion on SNES analysis would be greatly appreciated.
[img url=i.imgur.com/8vCpFuH.gif][/img]