Posts for TOHN

TOHN
He/Him
Experienced Forum User
Joined: 1/11/2017
Posts: 7
brunovalads wrote:
TOHN wrote:
looking for a way to save a state for every frame of the gameplay
It depends on which emulator you're using, but I guess it would be simple for BizHawk and Lsnes (for example):
Language: lua

while true do --[[ YOUR CODE OR FUNCTION CALLS HERE --]] local savestate_name = string.format("bla bla bla %d", emu.framecount()) -- "bla bla bla" is anything you want, like your AI's name savestate.save(savestate_name) -- IF BIZHAWK exec("save-movie " .. savestate_name .. ".lsmv") -- IF LSNES emu.frameadvance() end
Tho, I'm not sure if BizHawk's savestate.save(string path) needs the full path for the file or it can save in .\[console]\State Edit: savestate.save(string path) saves in the same folder of your script, so you can make:
Language: lua

local savestate_name = string.format("AI_savestates\\bla bla bla %d", emu.framecount())
Thank you very much, brunovalads. It works like a charm. Yes, I am using BizHawk.
TOHN
He/Him
Experienced Forum User
Joined: 1/11/2017
Posts: 7
Hi, Now I am working on my AI project and looking for a way to save a state for every frame of the gameplay in order to resume to any state I want without running from the start of the movie. Any pointer to an existing project or a lua script will be greatly appreciated.
Post subject: Save state for every frame.
TOHN
He/Him
Experienced Forum User
Joined: 1/11/2017
Posts: 7
Hi, Now I am working on my AI project and looking for a way to save a state for every frame of the gameplay in order to resume to any state I want without running from the start of the movie. Any pointer to an existing project or a lua script will be greatly appreciated.
TOHN
He/Him
Experienced Forum User
Joined: 1/11/2017
Posts: 7
Thank you very much @Koh1fds and @Amaraticando. Now I can create perfectly synced screenshots and Input Log. +image sequence writer +display frame counter +@Koh1fd's latest post Thanks again.
TOHN
He/Him
Experienced Forum User
Joined: 1/11/2017
Posts: 7
Amaraticando wrote:
From your post it's not clear what you want. Do you want a sequence of screenshots with input display? Or a video with input display? In any case, this should do the job: 1) Go to the View menu and select what should appear on screen and where. 2) Go to File > AVI/WAV and select Capture OSD to make those drawings (and Lua drawings too) appear in the dumped video. 3) In the same place, go to Config and Record AVI/WAV. You can choose the video format and even the image sequence writer. 4) Go to Record AVI/WAV to start the job and to Stop AVI/WAV when you're done.
Hi. thank you for answering. I want screenshots which syncs to the records in "Input Log.txt" file of the .bk2. Edit: I don't want screenshot with overlayed text because I would like to use the pure screenshots to train my bot.
Post subject: Re: How to record synced control inputs + screenshots
TOHN
He/Him
Experienced Forum User
Joined: 1/11/2017
Posts: 7
Koh1fds wrote:
TOHN wrote:
I tried to record the .bk2 file along with AVI but it seems the frames from the AVI file don't sync with the records in the bk2 file.
Pause the emulator -> start movie replay (autopause on last frame) -> start avi recording -> unpause emulator -> movie will autostop on last frame -> stop avi recording This way it will be 100% sync edit: you can also record avi with frame counter, input display and other stuff
Thank you very much. I still have some questions? 1. By start movie replay, you mean start record movie (.bk2 file)? 2. After the unpause emulator is when I play the game? 3. How to indicate the last frame? let's say I want to stop recording at this point so I just go to menu and select save AVI? Thanks again
Post subject: How to record synced control inputs + screenshots
TOHN
He/Him
Experienced Forum User
Joined: 1/11/2017
Posts: 7
Hi, I would like to know that if it is possible to record the control input e.g. Input Log.txt in the .bk2 file which each record has a screenshot that syncs to it. If it is possible, how could I do that? I tried to record the .bk2 file along with AVI but it seems the frames from the AVI file don't sync with the records in the bk2 file. PS. I am very new to the Bizhawk and emulator world, I don't know if this is a very straightforward question, but I have tried to search for the solution. Thank you very much.