Posts for Masterjun


Masterjun
He/Him
Experienced Forum User, Published Author, Site Developer, Skilled player (1971)
Joined: 10/12/2010
Posts: 1179
Location: Germany
Since when are slow running emulators a fault in the emulator or movie instead of just your computer being slow (see DeSmuME, Dolphin etc.)? And so what do people do if the emulation is too slow on their computers? They dump the movie to see what it would look like without the limitation in the processing power of your computer!
Warning: Might glitch to credits I will finish this ACE soon as possible (or will I?)
Masterjun
He/Him
Experienced Forum User, Published Author, Site Developer, Skilled player (1971)
Joined: 10/12/2010
Posts: 1179
Location: Germany
There are several ways to accomplish what you want to do. First thing is doing exactly what you wanted to do, only with lsnes, because there you can just
Language: lua

local srcn = gui.screenshot_bitmap() local pixelcolor = srcn:pget(152,168) -- x:152, y:168
Secondy you can stay with BizHawk, using the client.screenshot() function to save a .png and then immediately load it using some Lua library or your own functions decoding the image, reading the pixels etc. Finally you can also simply get values from RAM that tell you the position of Mario, enemies and obstacles. But this might not fit into your computer vision methods since they don't give you pixel data. So this would result in a different kind of AI.
Warning: Might glitch to credits I will finish this ACE soon as possible (or will I?)
Masterjun
He/Him
Experienced Forum User, Published Author, Site Developer, Skilled player (1971)
Joined: 10/12/2010
Posts: 1179
Location: Germany
What you want is not an input recording, but a macro. You can find a description here in the Emulator Features under Combos or macros. So you can either use the Macro Tool, the complicated manual way Alyosha suggested above, or a different complicated way using Lua scripting.
Warning: Might glitch to credits I will finish this ACE soon as possible (or will I?)
Masterjun
He/Him
Experienced Forum User, Published Author, Site Developer, Skilled player (1971)
Joined: 10/12/2010
Posts: 1179
Location: Germany
When create a new canvas you need to save the LuaCanvas it's returning, like so:
Language: lua

local myCoolCanvas = gui.createcanvas(640,480)
As to things you can do with that, looking at the code for the LuaCanvas, you can use SetTitle(), Clear(), Refresh(), DrawRectangle(), and DrawText(). So like:
Language: lua

myCoolCanvas.DrawText(10,50,"sup") -- default color is white so might be hard to see myCoolCanvas.DrawRectangle(64,32,16,16)
Warning: Might glitch to credits I will finish this ACE soon as possible (or will I?)
Masterjun
He/Him
Experienced Forum User, Published Author, Site Developer, Skilled player (1971)
Joined: 10/12/2010
Posts: 1179
Location: Germany
Yeah lol how do you not post the solution then.
Warning: Might glitch to credits I will finish this ACE soon as possible (or will I?)
Masterjun
He/Him
Experienced Forum User, Published Author, Site Developer, Skilled player (1971)
Joined: 10/12/2010
Posts: 1179
Location: Germany
I did a 40fps test and as of now YouTube does drop frames with 40fps. I also did a 55fps test and the quality options showed 1080p60 for a short while, then switched to showing 1080p50, however 55fps is preserved, as in, no frame drops with 55fps as seen in the Stats for nerds option. 48fps test works as intended with 1080p48 in the quality options. This makes sense because of 24fps movies (?) maybe I don't know I'm no specialist. More frame rate tests: 47 works, 46 works, 45 works, 44 works, 43 works, 42 works, 41 works. 1000fps is reduced to 60fps.
So as it seems, YouTube preserves all frame rates over and equal to 41 (until 60 (including), that is).
Warning: Might glitch to credits I will finish this ACE soon as possible (or will I?)
Masterjun
He/Him
Experienced Forum User, Published Author, Site Developer, Skilled player (1971)
Joined: 10/12/2010
Posts: 1179
Location: Germany
Maybe you want to disable QuickEdit Mode. Click the icon on the top left -> Properties -> Uncheck QuickEdit Mode
Warning: Might glitch to credits I will finish this ACE soon as possible (or will I?)
Masterjun
He/Him
Experienced Forum User, Published Author, Site Developer, Skilled player (1971)
Joined: 10/12/2010
Posts: 1179
Location: Germany
Yeah I'm also the first person on earth who discovered TASing. Anyways, I think I found a SM64 video on YouTube and then some SMW hack TASes (those really hard kaizo hacks, specifically Item Abuse). And after some time I started making some TASes on ZSNES and found this site when I made more research on Google.
Warning: Might glitch to credits I will finish this ACE soon as possible (or will I?)
Masterjun
He/Him
Experienced Forum User, Published Author, Site Developer, Skilled player (1971)
Joined: 10/12/2010
Posts: 1179
Location: Germany
Amaraticando wrote:
Are you sure? Related: http://tasvideos.org/forum/viewtopic.php?t=18128
Yup, updated that post just to make sure there is no confusion.
Warning: Might glitch to credits I will finish this ACE soon as possible (or will I?)
Masterjun
He/Him
Experienced Forum User, Published Author, Site Developer, Skilled player (1971)
Joined: 10/12/2010
Posts: 1179
Location: Germany
Nah don't worry, we're good.
Warning: Might glitch to credits I will finish this ACE soon as possible (or will I?)
Masterjun
He/Him
Experienced Forum User, Published Author, Site Developer, Skilled player (1971)
Joined: 10/12/2010
Posts: 1179
Location: Germany
This is a cool run!
Warning: Might glitch to credits I will finish this ACE soon as possible (or will I?)
Masterjun
He/Him
Experienced Forum User, Published Author, Site Developer, Skilled player (1971)
Joined: 10/12/2010
Posts: 1179
Location: Germany
Sounds like BizHawk, yes.
Warning: Might glitch to credits I will finish this ACE soon as possible (or will I?)
Masterjun
He/Him
Experienced Forum User, Published Author, Site Developer, Skilled player (1971)
Joined: 10/12/2010
Posts: 1179
Location: Germany
Luckily, DeSmuME has a movie.play() function which automatically resets the emulator and runs the movie. I made a quick script that you can adjust to fit your needs. Things you might want to edit:
  • the moviepath string at the top
  • the getTime() function (currently only supports seconds, minutes and hours)
  • the checkResult() function
  • the frames to wait in the while true do loop (currently 7000)
  • what to do when checkResult() returned true (currently prints the time)
Language: lua

local moviepath = "movie.dsm" local function getTime(newtime) local s = newtime%60 local m = math.floor(newtime/60)%60 local h = math.floor(newtime/3600)%24 return string.format("2009-JAN-01 %02d:%02d:%02d:000",h,m,s) end local function editFile(newtime) local file = io.open(moviepath,"r") local filestring = file:read("*a") file:close() filestring = filestring:gsub("(rtcStartNew )([^%c]+)","%1"..getTime(newtime)) file = io.open(moviepath,"w") file:write(filestring) file:close() end local function checkResult() if memory.readbyte("0x02000000")==0xFF then return true end return false end local newtime = 0 while true do editFile(newtime) movie.play(moviepath) for i=1,7000 do -- frames to wait emu.frameadvance() end if checkResult() then print("it worked with "..getTime(newtime)) end newtime=newtime+1 end
Warning: Might glitch to credits I will finish this ACE soon as possible (or will I?)
Masterjun
He/Him
Experienced Forum User, Published Author, Site Developer, Skilled player (1971)
Joined: 10/12/2010
Posts: 1179
Location: Germany
my face when it's a Mega Man-like game and I have Mothrayas in my team
Warning: Might glitch to credits I will finish this ACE soon as possible (or will I?)
Masterjun
He/Him
Experienced Forum User, Published Author, Site Developer, Skilled player (1971)
Joined: 10/12/2010
Posts: 1179
Location: Germany
Unfortunately the Lua in DeSmuME is not really well documented. This file in the code tells me that we have emu.register, emu.registerbefore, emu.registerafter, emu.registerstart, and emu.registerexit. I'd assume registerexit will execute when the Lua script exits, and registerstart when the game starts up. According to this other file the others go in this order after the start of a frame (like, when you press the frameadvance key):
    emu.registerbefore <actual emulation of the frame> emu.registerafter emu.register
And then (when paused) it idles repeatedly doing this:
    <wait 50 ms> emu.register
(So you have a maximum of 20 calls per second when paused, which I confirmed is indeed the case.)
Warning: Might glitch to credits I will finish this ACE soon as possible (or will I?)
Post subject: ¯\_(ツ)_/¯
Masterjun
He/Him
Experienced Forum User, Published Author, Site Developer, Skilled player (1971)
Joined: 10/12/2010
Posts: 1179
Location: Germany
TehSeven wrote:
Still not seeing it.
¯\_(ツ)_/¯
Warning: Might glitch to credits I will finish this ACE soon as possible (or will I?)
Masterjun
He/Him
Experienced Forum User, Published Author, Site Developer, Skilled player (1971)
Joined: 10/12/2010
Posts: 1179
Location: Germany
Warning: Might glitch to credits I will finish this ACE soon as possible (or will I?)
Masterjun
He/Him
Experienced Forum User, Published Author, Site Developer, Skilled player (1971)
Joined: 10/12/2010
Posts: 1179
Location: Germany
Why do you have the Metal Force Dude as a face.
Warning: Might glitch to credits I will finish this ACE soon as possible (or will I?)
Masterjun
He/Him
Experienced Forum User, Published Author, Site Developer, Skilled player (1971)
Joined: 10/12/2010
Posts: 1179
Location: Germany
Quick solution for people that don't care why it works:
Language: lua

local function main() gui.text(10,10,"hi") end gui.register(main)
---------------- DeSmuME is interesting in that it constantly redraws the screen even when paused. I'm assuming your code looks like this:
Language: lua

while true do gui.text(10,10,"hi") emu.frameadvance() end
The point is that you are using the gui function once a frame, but the screen is redrawn multiple times per frame. The solution is to tell DeSmuME that you want to keep drawing when it draws the screen, with gui.register():
Language: lua

gui.register(function() gui.text(10,10,"hi") end)
Warning: Might glitch to credits I will finish this ACE soon as possible (or will I?)
Masterjun
He/Him
Experienced Forum User, Published Author, Site Developer, Skilled player (1971)
Joined: 10/12/2010
Posts: 1179
Location: Germany
I'm the one who suggested keeping my Pong and Snake run a secret, even from the TASVideos community. I personally still want to keep that element of surprise. In general the reaction and feedback from the crowd is really great, but I'm especially anticipating the reaction from people that actually know about TASing. They know what's possible, they know what's impressive. However, with the recent events, people from this site made less feedback on what they thought about the block, and more about how well it represented us as a site and TASing in general. These blocks are made for you, too, so please enjoy them as much as I do. I just can't think of completely spoiling the whole event for everyone here.
Warning: Might glitch to credits I will finish this ACE soon as possible (or will I?)
Masterjun
He/Him
Experienced Forum User, Published Author, Site Developer, Skilled player (1971)
Joined: 10/12/2010
Posts: 1179
Location: Germany
z1mb0bw4y wrote:
If the fact that portal was up for consideration was mentioned literally anywhere in this thread (that I checked multiple times leading up to the event), I would have gotten in contact with you and written/practiced something. Instead the run commentary was essentially "here you fly across the room because cameras and portals".
Whaaat? Keeping things a secret? Why would we even do that? To surprise people with the fact that we run a PC TAS on an SNES? Who needs that element of surprise anyways right? And not being able to explain glitch-heavy TASes in realtime, which usually require several pages of submission text to get all the details in? Like that's easy and reasonable to do right?
Warning: Might glitch to credits I will finish this ACE soon as possible (or will I?)
Masterjun
He/Him
Experienced Forum User, Published Author, Site Developer, Skilled player (1971)
Joined: 10/12/2010
Posts: 1179
Location: Germany
Warning: Might glitch to credits I will finish this ACE soon as possible (or will I?)
Masterjun
He/Him
Experienced Forum User, Published Author, Site Developer, Skilled player (1971)
Joined: 10/12/2010
Posts: 1179
Location: Germany
Ah yes, those accidental leaks.
Warning: Might glitch to credits I will finish this ACE soon as possible (or will I?)
Post subject: Clearly SMW was missing.
Masterjun
He/Him
Experienced Forum User, Published Author, Site Developer, Skilled player (1971)
Joined: 10/12/2010
Posts: 1179
Location: Germany
Guys this AGDQ TAS block was really bad because we didn't have SMW in it. I knew it all along! (No but seriously, good job presenting all this!)
Warning: Might glitch to credits I will finish this ACE soon as possible (or will I?)
Masterjun
He/Him
Experienced Forum User, Published Author, Site Developer, Skilled player (1971)
Joined: 10/12/2010
Posts: 1179
Location: Germany
LOL
Warning: Might glitch to credits I will finish this ACE soon as possible (or will I?)