Project

General

Profile

Actions

Emulator Issues #502

closed

Implementing TAS (Tool-Assisted-Speedrun) features.

Added by yasharnasirian over 15 years ago.

Status:
Fixed
Priority:
Low
Assignee:
% Done:

0%

Operating system:
N/A
Issue type:
Feature request
Milestone:
Regression:
No
Relates to usability:
No
Relates to performance:
No
Easy:
No
Relates to maintainability:
No
Regression start:
Fixed in:

Description

On behalf of the entire tasvideos (tasvideos.org), we would be honored if
team Dolphin could someday in the future address these desired features:

  • Re-recording

Naturally, it must be possible to create tool-assisted movies on the
emulator. This includes the absolute minimum of adjusting the emulation
speed and sync-robust savestates.
Sync-robustness means that if the same savestate is loaded 10 times, the
emulation must progress exactly the same way each time. There must not be
random factors other than what is included in the savestate.
In particular, the clock of the host computer, and the files present in
the host computer (besides the ROM), must not affect the emulation.
Changes in emulation speed and loading/writing savestates must not be
written into the movie, or it must be possible to ignore them when playing
back the movie [3]. When a savestate is loaded, the movie must
automatically rewind to the time of the state being loaded.

  • Movie authenticity

The movie file must indicate whether it begins from power-on or a
savestate.

The indications must be tamper-proof; for example, if it indicates that it
begins from a power-on, it must not load the savestate after resetting.

The movie file must indicate the length of the movie in a way that can be
derived into seconds without access to the game/emulator.

The movie should store the player's input, not the emulation results (CPU
state changes or video frames). If the emulator is robust, only the input
and the game are required to reproduce the playing session.
The CPU state changes and/or video frames are easy to tamper with,
destroying the credibility of the movie.

The movie file should store the length of the movie (in timeunits, usually
frames) in its header for convenience. However, because the indicated
length is easily changed with an hex editor, it should still be possible
to programmatically verify that the indicated length actually matches with
the amount of input data (i.e. access to the emulator and the ROM must not
be required). Or, the emulator should reject movie files where the
indicated length doesn't match the actual length of the movie.

To avoid spam, please, visit this page:
http://tasvideos.org/EmulatorResources/Features.html? as it explains in
brief what features we desire.
This page http://tasvideos.org/EmulatorResources/Requirements.html should
give you more background for any possible questions you might have.

Actions #1

Updated by nakeee over 15 years ago

  • Status changed from New to Accepted
  • Issue type set to Feature request
  • Priority set to Low
  • Relates to usability set to Yes
  • Operating system N/A added
Actions #2

Updated by antdgar about 15 years ago

this would be excellent

Actions #3

Updated by DaTeL237 about 15 years ago

this would be great for the TAS community and I expect it to be fairly useful as a
debugging tool for the development of the emulator

Actions #4

Updated by XTra.KrazzY about 15 years ago

You should totally build a TAS input plugin for Dolphin

Actions #5

Updated by XTra.KrazzY about 15 years ago

I would also like to see a movie recorder that (just like crysis), renders the movie
to be at full speed (30/60fps).

Actions #6

Updated by nakeee about 15 years ago

How would you do that??

Actions #7

Updated by memberTwo.mb2 about 15 years ago

You guys are just crazy :D
Never heard about TAS before. Very strange feature imo.

If it's suppose to be frame driven, the "easy" lowlevel way to do this would be to
handle your SI stuff from VI callback. And the "easy" "highlevel" way would be to
handle emulated inputs from frame buffers swap. In both cases it would pollute either
Core or videoPlugin. Plz, at least, don't touch the core for this. :)

Actions #8

Updated by nakeee about 15 years ago

Frame forward is a useful option, without any connection to TAS.
And it can be done with going to pause after frame rendering.
I think input is already handled per frame no?
IMPORTANT NOTE: we talk about SC only.

P.S
There is always another way

Actions #9

Updated by kylethomson about 15 years ago

If frame advance is implemented, then implementing the input recording is relatively
simple. You dump the controller(s) input to a binary file (movie file). There's a bit
to get the re-recording aspect working, but that is simply storing the entire movie
in a savestate. The final step is having an option of overwriting controller data
with data from the movie file. These aren't trivial, but compared to frame advance
and stabilizing savestates, it is much, much easier.

Actions #10

Updated by XTra.KrazzY about 15 years ago

nakeee: Go Mutexes!

Actions #11

Updated by nakeee about 15 years ago

Xtra, won't help. DC is not deterministic enough

Actions #12

Updated by Anonymous about 15 years ago

if you look in padsimple there is some (old and unhappy) code that was put there for
rerecording. I think it was copied from Dolwin (maybe the other way around)?

Anyways, SerialInterface->UpdateDevices() gets called once per frame (supposedly on
vblank?). This is when the devices do GetData (ie when the current gccontroller class
checks the pad plugin for the SPadStatus), and updates interrupts.

The call is from SystemTimers.cpp, but it would be just as easy to put the
rerecording in SI_DeviceGCController.cpp:GetData() if you didnt want it in SystemTimers.

Actions #13

Updated by nakeee about 15 years ago

Yep, that is exactly what I'm planning to do,
I'm just waiting for "someone" to finish the SI changes :p
Once it's done we'll add setRecording(filename) and save the state to disk if
filename != null (or maybe compile time option).

Actions #14

Updated by memberTwo.mb2 about 15 years ago

Yeah, I agree with nakee. Don't use DC.
Caution: SerialInterface->UpdateDevices() isn't quite synchronized with frames even
in SC. More or less 60 SICallBack per "sec" whereas we can have 60,30,50,25 FPS.

Actions #15

Updated by XTra.KrazzY about 15 years ago

Serial Interface it is!

In any case and on another note, what about capturing video from the output and
saving it as a constant 30FPS video file? We could use this frame-by-frame
(henceforth, fbf :P ) mode to take each frame and stream it out to some video format,
which we have to determine.

Actions #16

Updated by nakeee about 15 years ago

mb2 argg.. any idea how we can sync it? can we make it once per frame somehow?
XK We can't even make screen shot work....

Actions #17

Updated by Anonymous about 15 years ago

Is there a video format which would support metadata like recorded input and stuff
per frame? (mkv would probably do this easily...but might be a bit of work on our
side, idk)

Actions #18

Updated by kylethomson about 15 years ago

The binary movie file generated should not be linked at all to the resulting avi. You
should be able to later play back the binary file of controller inputs, and dump the
resulting game output to AVI.

Including the two is not the intention. Sorry if I made it seem this way.

Actions #19

Updated by ham90mack about 15 years ago

Keep this statement from the first post in mind:

"The movie [input file, not video] should store the player's input, not the emulation
results (CPU state changes or video frames). If the emulator is robust, only the
input and the game are required to reproduce the playing session."

Another aspect of input recording that needs to be kept in mind is that one must be
able to go back to somewhere in the middle of the movie file (whether it's just a few
frames from the end or near the beginning) and play from there, overwriting the input
that came after that position in the movie. You must also be able to append to the
end of an input file since a TAS is never completed in one go. These features would
require the input file to stand on its own so video is not needlessly rendered just
to be deleted or appended to later.

Actions #20

Updated by XTra.KrazzY about 15 years ago

Sure. Complete separation of input and video file (each one's generated by another
plugin).

I've always thought that the TAS requirements are way too high. Rewinding?
"Scrolling" an emulation to the middle/near end? Speeding it up over 100%? We are not
emulating a NES here, show some respect :P

nakeee: We should work on screenshots ASAP :)

Actions #21

Updated by ham90mack about 15 years ago

Please notice that many of those features are suggested. Obviously, rewinding and
super speed are not feasible for this emulator, at least not for many years. I'm not
sure what you mean by scrolling, but it sounds like what you mean is saving a save
state at some point while watching a movie and being able to load it with the movie
later. That feature shouldn't be too difficult, as long as read-only (play back the
movie) and record (write over everything after that save state is loaded) modes are
handled properly.

In reality, you should first follow the requirements page. It gives the bare bones
requirements for the emulator. The features page gives a list of the requirements
plus more features that are helpful, but not required. Notice that many are marked
as low priority. There is also a chart at the bottom of that page showing the
features that all of the emulators that the site accepts or may accept have.

Basically, following the requirements page gives you what you must have to get the
emulator accepted. The features page shows all of the bonus features that either
help a lot or open new possibilities for glitches (such as soft reset).

At some point, the person who worked on the latest NES emulator will either write a
wiki page or discuss about the more technical details of making an emulator
rerecordable.

By the way, you may want to look at the PCSX Rerecording emulator that was just
accepted at the site (somebody modified the source code to make it rerecording
capable). It doesn't have most of the features stated on the page, but it had all of
the essential requirements and it's fairly stable for many games (nowhere near most
of them, but that should improve later). However, it has been deemed to be working
well enough to accept movies created by them at the site. Check out the discussion
thread for it: http://tasvideos.org/forum/viewtopic.php?t=7271 To jump directly to
where the consideration for accepting this emulator began, see this: http://tasvideos.org/forum/viewtopic.php?p=188949#188949

Actions #22

Updated by XTra.KrazzY about 15 years ago

When I wrote scrolling I meant seeking in the Speedrun
"one must be able to go back to somewhere in the middle of the movie file"

Every uncompressed save-state weighs ~50-60MBs, while compressing it using the fast
LZO library takes a couple of seconds and still weighs about 17MB. The save-states
are large and accumulating them all will probably weigh a whole lot.

I saw this video as a reference on how to create TAS videos in a proper 3D console
(N64): http://www.youtube.com/watch?v=fdDA6dnhUiQ
And first of all I have to say that I'm impressed -- The advanced UI which delicately
controls the input. Secondly, it's possible for dolphin to have the same
functionality, as the FBF rendering speed can be quite satisfying (as long as the
final result is played at 30FPS, that is).

What do you have to say about the save states?

P.S. About coherency of emulation, GC and Wii use some functions such as RTC and
timing, so it's obvious that coherency is not possible for some cases, even FBF
input. And of course Dolphin must be in SC mode in order for this all to be feasible.

Actions #23

Updated by ham90mack about 15 years ago

Going back to somewhere in the middle of the movie file is achieved using manual save
states. So whenever a movie maker hits a milestone, they generally would want to
make a save state at that point so they could jump backwards if they found a new
glitch somewhere. They also would want to keep a save state at the end whenever they
stop so they can resume their progress. This way it won't take a long time to get to
where they want to be, unless they missed making a save state. Generally this is
achieved by loading the movie and then loading a save state that was made while
creating the movie. I believe that such a save state needs to save a copy of the
movie embedded inside, but don't quote me on that, someone who developed one of these
rerecording emulators can say for sure. Oh, and loading a save state while paused
should keep the emulator paused too.

This brings up a new point. The movie playback needs to have a toggleable read-only
and recording mode as described here: http://tasvideos.org/EmulatorResources/Features.html?#9 This way you can choose to
play back a movie (with or without loading save states) and then decide to record
over everything after a desired frame.

Oh, by the way, what are these modes that you guys keep talking about? If it takes
too long to explain, you can just point me to a page that explains it.

Actions #24

Updated by magumagu9 about 15 years ago

  • Priority changed from Low to Normal

ham90mack: There's a checkbox in the configuration for "Enable Dual Core", or something along those
lines. The mode with that box checked is usually referred to as "DC mode", with the other mode being
"SC mode".

In DC mode, the emulator implements behavior which acts something like frame-skipping: if the
graphics isn't keeping up with the CPU, the frequency of the graphics interrupts goes down, essentially
slowing down the graphics without slowing down the CPU. This works for normal gameplay emulation
because the GameCube graphics are asynchronous, and games have some tolerance for lag. This won't
work for a TAS because slowing down the graphics can affect the behavior of games.

SC mode, as far as I know, doesn't suffer from this issue.

XTra.KrazzY: For a TAS, the clock should be start at a fixed point stored in the movie file, and change
such that ~480M clock cycles (is that the speed of the GameCube CPU?) equals one second on the clock.
It's not that hard to do, but it involves messing with Core a bit.

Actions #25

Updated by magumagu9 about 15 years ago

  • Priority set to Low
Actions #26

Updated by nakeee about 15 years ago

This thread is becoming too busy, and I see enough other people are working on it.
Please whoever wish to implement it assign it to yourself

Actions #27

Updated by marcus about 15 years ago

Well, the rerecording is there (but is slightly buggy, see issue 585), and it has
perfect sync-robustness. The frame advance should be pretty easy (Just a hotkey to
press the play button, wait one frame, and press the pause button). Then this will
be practically done.

Actions #28

Updated by marcus about 15 years ago

never mind...the sync-robustness is the problem with rerecording...

Actions #29

Updated by marcus about 15 years ago

Of course the sync-robustness was bad...I did it on DC mode, so of course it was
messed up...I tried it in SC, and it worked fine :). Sorry...

Actions #30

Updated by antdgar about 15 years ago

The sync-robustness still isn't very successful. I tested using developer mode in
SSBM (you can go frame by frame) and many of my movies desynced at the very beginning.
Frame by frame will most likely show up any errors in input synchronization...

Some did work though. Good job so far

Actions #31

Updated by marcus about 15 years ago

??? I thought it worked...it seemed fine on SMS in SC mode...

Actions #32

Updated by antdgar about 15 years ago

Perhaps because you are playing in real-time, a frame or two of bad synchronization
may go unnoticed.
It does work, but for the majority of the time it has synchronization issues.
Perhaps you should try using saves and loads while recording? The issue could stem
from a bug in rewinding the input file or something..

Actions #33

Updated by marcus about 15 years ago

hmmm...yeah, I wasn't really doing anything complex. Oh well. Scientific sync-
robustness will take a while to get done, then.

Actions #34

Updated by marcus about 15 years ago

Frame advance is done, even though you need to build it specially...
See r2273 log message.

Actions #35

Updated by antdgar about 15 years ago

also, another problem is that when pressing Save, it seems to save the next frame. It
should save on the present frame.

Maybe someone can explain it better than me..

Actions #36

Updated by marcus about 15 years ago

The only major things we need now sre starting a movie from a savestate and sync-
robustness...

Actions #37

Updated by antdgar about 15 years ago

the latter being very important^^

Actions #38

Updated by marcus about 15 years ago

And very, verrrrry difficult to achive.

Actions #39

Updated by baby.lueshi about 15 years ago

People earlier on were talking about adding a movie exporter for saving 60fps videos,
and I've coded a patch that takes a step towards that: http://pastebin.com/f25af7564

(NOTE: Because TourtiseSVN couldn't add it to the patch file, you have to manually
create the folder Data/User/Dump/Frames)

Instead of saving an actual movie, it just dumps all the individual frames recorded
into its own folder. Obviously, this is nowhere near good enough for recording stuff
more than a couple minutes long, but it works, and it when put together in a movie,
it's full-speed. Somebody with more experience with say, FFMPEG or VfW could probably
make this export it directly into a movie folder with some real-time compression, but
that's beyond what I know. It's also currently all in the OpenGL video plugin, but
can easily be ported over to the DX9 one, or can be moved elsewhere to make way for
both video and sound capture.

I noticed something when coding this though: Some games (Luigi's Mansion, in my case)
use different framerates for different parts of the game. (Gameplay seems to be
30fps, while the small shots of Luigi trying to open locked doors are 60.)

Actions #40

Updated by marcus about 15 years ago

Interesting. Somebidy code a video encoder!

Actions #41

Updated by shinydoofy about 15 years ago

Great to see someone work on that! :)

From the looks of it (haven't actually tried it), you're dumping bitmap images. For
Linux, it would be best to dump the raw streams (video and audio) into a file. This
way mencoder could easily read and encode them on the fly. Raw, in this case, means
that there's no header, padding or anything, just a message on the log saying
something like "dumping video stream to Frames/videolog.raw, 800x600, RGB32" and the
bits written to that file so that people could take that information and pass it to
mencoder. I don't actually know how this would do on Windows or if it even supports
fifos, but imho it'd be the best for Linux folks.

About the fps changes: are the frames actually displayed longer (1/30th of a second
insted of 1/60th) or are they displayed twice? If it's the latter, it's no big deal,
mencoder can just drop them. If the actual rate changes, a message like "frames
0-5500: 60 fps\n5501-5700: 30 fps\n 5701-6000: 25fps) would be great. The mkv
container supports variable framerates just fine, the major players should do fine as
well.

Actions #42

Updated by baby.lueshi about 15 years ago

Double-checking the fps issue; the actual FPS changes. Although the mkv container
does support variable framerates like you said, this makes any sort of
post-processing on the video a huge pain to do.

Also, I'm trying to aim for this to pipe the raw frames directly into a video
encoder, so hopefully we never have to handle raw stream dumps, since outputting into
a lossless coded is just as good for most situations. I could try to come up with a
VfW implementation of this, but that will be Windows-only, and we will probably have
to use FFMPEG or something similar for Linux/Mac(?)

Actions #43

Updated by moozooh about 15 years ago

Is it possible to make a forced 60 (50 for PAL games) output that just duplicates
frames if necessary? I believe so, since Mupen (N64 emulator we are using to record
TASes currently) produces exactly that result regardless of the actual game fps
rate, and the tv sets refresh 60 times per second as well regardless of the content.

Duplicated frames by themselves won't be an issue; they can be dropped altogether by
using decimate filter in MEncoder upon the initial capture.

Any thoughts?

Actions #44

Updated by baby.lueshi about 15 years ago

I'm not sure exactly how the HLE plugin limits the FPS right now (only just started
looking at it), but duplicate frames is definitely the way to go for handling stuff
like that.

Actions #45

Updated by shinydoofy about 15 years ago

baby.lueshi: Actually, that's just what the fifo files are for. Dolphin would "pipe"
its frames into that file and mencoder/ffmpeg reads from it. It's like "./Dolphin |
mencoder [options]", just with a file instead of a direct pipe. The encoders could
then either directly encode it with x264, xvid or the like or save it lossless as
well, only compressed (huffyuv and ffv1 come to mind). This also works with audio
samples which can be handled at the very same time. A nice example of this can be
found at http://nopaste.org/p/amgy2a21h

Actions #46

Updated by baby.lueshi about 15 years ago

shinydoofy: I actually didn't know about that! In that case, a raw dump would be the
best choice for Linux. (And Mac? I have never touched one in my life and have no idea
how they do things. Can a Mac buddy help me out here?)

Windows will still need a special way to do things, but after looking at the API,
Videos for Windows is pretty simple from the looks of things.

Actions #47

Updated by marcus about 15 years ago

Note that if you just dropped every other frame of the 60fps bits (idk how you would
figure out where the 60fps bits are, though), you would half the size of the video
file without a (noticable) drop in video quality. Just a thought, but it would be
better than just having duplicates of 95% of the frames.

Actions #48

Updated by moozooh about 15 years ago

Believe me, duplicates are absolutely no problem. Redundancy is better than data
loss, anyway.

Actions #49

Updated by baby.lueshi about 15 years ago

I made a different version of the patch that dumps a raw file instead of a bunch of
individual images: http://pastebin.com/f203cb22a

Through the use of AviSynth and the RawSource plugin for it, you can get a video out
of it. I think this is more in line with what shinydoofy was talking about before.

Actions #50

Updated by marcus about 15 years ago

I'll test it. Good work!

Actions #51

Updated by marcus about 15 years ago

How to use avisynth?

Actions #52

Updated by shinydoofy about 15 years ago

If you're on Linux, just run "mencoder -ovc xvid -xvidencopts bitrate=1000 -mc 0
Frames/framedump.raw" from another terminal before starting the game and you'll
encode it. You won't need avisynth
If you're on Windows, just download and install it and check the home page for a
first script. You should do fine when googling for avisynth and the keyword you're
looking for. http://avisynth.org/mediawiki/Importing_media might help you out.

Actions #53

Updated by marcus about 15 years ago

ok. but now I can't find the .raw file (I added the Frames directory in User).

Actions #54

Updated by baby.lueshi about 15 years ago

The full path to the dump should be User/Dump/Frames/framedump.raw. It should have
popped up an error if it couldn't make the file, but I guess I messed that up.

For AviSynth, you have to download the RawSource plugin:
http://avisynth.org/warpenterprises/#rawsource

Put the DLL in it in the same folder as the dump and the AVS script, and the Script
should look like this:

LoadPlugin("rawsource.dll")
RawSource("framedump.raw", 640, 480, "RGB")
AssumeFPS(60)

Replace the width, height, and FPS with what you used to record.

Actions #55

Updated by marcus about 15 years ago

Found the problem...tortisesvn doesn't like the patch, so it looks like I'll be
stuck with changing the lines manually. This could take a while...

Actions #56

Updated by marcus about 15 years ago

No, that won't work. There's just too many changes. Maybe you could just zip the
files and email them (my email is above, just fill in the letters after you click
it).

Actions #57

Updated by baby.lueshi about 15 years ago

Small fix: http://pastebin.com/f40a99ce6

For those wanting to make videos out of the dumps, you can use MEncoder:

mencoder -rawvideo w=640:h=480:fps=60:format=RGB24 -ovc xvid -demuxer rawvideo
-xvidencopts bitrate=1000 -mc 0 User/Dump/Frames/framedump.raw -o test0.avi

Adjust width, height, and fps accordingly.

Actions #58

Updated by baby.lueshi about 15 years ago

Another big update: http://pastebin.com/f29815b74

When compiled on Windows, frame dumping now dumps it straight into a .avi file with
the codec of your choice. Next to bringing sound into the this, there's not a whole
lot much more to do here other than handling variable framerates.

marc: Are you trying to apply the patch to the Source folder, or the folder above it?
("dolphin-emu-read-only" for me.)

Actions #59

Updated by baby.lueshi about 15 years ago

Sorry, that last patch has an error in it. Use this one instead:
http://pastebin.com/f2694d343

Actions #60

Updated by marcus about 15 years ago

ok. I'll see how your .zip works, and make a patch for that, so you can see any
diffs in the patch syntax.

Actions #61

Updated by marcus about 15 years ago

here's a patch I made from your zipfile: http://paste2.org/p/168019
I'll see if anything's different.

Actions #62

Updated by baby.lueshi about 15 years ago

The patch you made looks nearly identical in syntax as the ones I've made.

When saving the patches I make, do you use the download link on the pastebin page? It
looks like it's converting tabs into spaces which might be the reason the patch isn't
working.

Actions #63

Updated by marcus about 15 years ago

Here's he problem:

-69,6 +69,7 @@

in your patch is:

@@ -69,6 +69,7 @@

in my patch.
Looks like your average internal syntax error if you ask me. Theoretically, all you
would have to do is @@ at the beginning of each similar line.

Compiled with the zipfiles, no .raw file. I'll try your newer patch, now I know how
to adapt it.

Actions #64

Updated by marcus about 15 years ago

Ok. Now it's getting mad at me about " " not matching " ", so I guess you'll
have to use something that leaves the tabs alone, I think http://www.paste2.org does.

Actions #65

Updated by baby.lueshi about 15 years ago

http://paste2.org/followup/168019

It looks like it wasn't mangled when posting.

Actions #66

Updated by marcus about 15 years ago

ok. I'll try it.

Actions #67

Updated by marcus about 15 years ago

Well it patches!

Was that the AVI version or the raw one?

Actions #68

Updated by baby.lueshi about 15 years ago

The AVI one. Just check the checkbox under Utilities in the Advanced tab and it
should output it to an AVI file.

Actions #69

Updated by marcus about 15 years ago

Oh, idk there was a checkbox...THAT SHOULD FIX IT!!!

XD

Actions #70

Updated by marcus about 15 years ago

Actions #71

Updated by baby.lueshi about 15 years ago

Two things:

1: I gave you an old patch. Whoops! http://paste2.org/followup/168034

2: The patch doesn't make the necessary folder. Create the folder Frames under
Data/User/Dump and it should make it the next time you build it. Otherwise, just make
the folder "Frames" under User/Dump

Hopefully we've all learned something out of this: we have SVN so things like this
don't happen.

Actions #72

Updated by baby.lueshi about 15 years ago

And by "build it", I mean "build DolphinWX"

Actions #73

Updated by marcus about 15 years ago

"Hopefully we've all learned something out of this: we have SVN so things like this
don't happen."

Now that quote will be famous.

1: OK, I'll try the new one.
2: That's the problem. My folder is at User/Frames...

And by "build it", I mean "build DolphinWX"
Not the core as well?

Actions #74

Updated by baby.lueshi about 15 years ago

No, the DolphinWX project file has a small script that copies the files from the Data
folder over to the output folder when it builds.

Actions #75

Updated by marcus about 15 years ago

Windows Media Player cannot play the file. The Player might not support the file
type or might not support the codec that was used to compress the file.

Got that both with uncompressed and Microsoft Video 1. What codec should I be using?

Actions #76

Updated by baby.lueshi about 15 years ago

I already had Lagarith installed on my computer, so I just used that.

If you can, try downloading VirtualDub and opening it in that. If it opens something,
then it was probably just the file not being closed correctly and I'll look into it.

Also, how large (filesize) is the file?

Actions #77

Updated by marcus about 15 years ago

over 500 meg for 15 sec of video. Won't open in VirtualDub.

Actions #78

Updated by baby.lueshi about 15 years ago

Try installing a different codec and using that (Xvid or Lagarith were the two I
tested with.) Also, try recording it at 640x480 if you're not already.

Actions #79

Updated by marcus about 15 years ago

installed lagarith as per readme, and still codec not supported.

Actions #80

Updated by baby.lueshi about 15 years ago

By not supported I assume you mean it doesn't show up in the codec selection dialog.

Did you install the 32 or 64 bit one? And are you using 32 or 64-bit Dolphin? That's
the big problem with codecs: You can only use 32-bit codecs in 32-bit programs and
vice-versa.

Actions #81

Updated by marcus about 15 years ago

it was in the dialog, just wmp didn't like it.

Actions #82

Updated by baby.lueshi about 15 years ago

That's very odd. This may be a stupid question, but you aren't trying to open the
file when the emulator is on, correct? Otherwise, it may still have control over the
file and the errors may be a side effect of that.

The only thing I can tell you is possibly record a super-short video and try
uploading the AVI it produces so I can look at it. The Microsoft Video 1 codec will
probably make the smallest video.

Actions #83

Updated by marcus about 15 years ago

ok. I'll do that. (and I shut the emulator before opening the file).

Actions #84

Updated by marcus about 15 years ago

I set the compression quality to 5 and recorded like 10 frames and emailed it to you.

Actions #85

Updated by baby.lueshi about 15 years ago

The file you sent me was mostly full of null bytes and no AVI header, which doesn't
make sense, because AVIFileOpen automatically creates an empty AVI container.

What version of Windows are you using?

Also, if somebody else could try the patch and post their results, that would help.

Actions #86

Updated by marcus about 15 years ago

WinXP SP2. And I figured the null bytes are because of those frames being mostly
black (but idk much about the inner workings of video files, so it might be
completely unrelated).

Actions #87

Updated by baby.lueshi about 15 years ago

Yeah, after attempting to repair the file with the AVI header from a recording I've
made, I was able to recover a broken picture of what is probably the Nintendo logo
and some copyright text: http://img9.imageshack.us/img9/7645/48885025.png

Could somebody else try building the patch and see if they get this bug too?

Actions #88

Updated by marcus about 15 years ago

Yeah. Can you send me the header so I can make a less-compressed video, fix it, and
see if it looks like it's supposed to? I figure that the problem is that the
compression was set so high that it completely distorted it.

My guess is that you need to fix the header...

Actions #89

Updated by baby.lueshi about 15 years ago

After a little searching, I think I found the problem. The file was only closed and
finished when the frame dumping box was unchecked during recording, and the file was
closed incorrectly if the emulator was just stopped. During testing, I wasn't making
recordings this way so I overlooked it. This new patch should write the file
correctly if the emulator stops during recording: http://paste2.org/followup/170803

Crashes will probably still produce corrupt dumps.

I also looked at attempting to dump audio, and it looks like there already a small
framework for doing this. However, as of right now, it doesn't work.

Actions #90

Updated by marcus about 15 years ago

OK, thanks for fixing that. I'll test it again and see how it works.

Actions #91

Updated by marcus about 15 years ago

The video dumper has been commited in r2781. If you want to use it, make sure that
the Frames folder exists in User/Dump and that the "Dump Rendered Frames" checkbox
is checked in the video plugin settings.

Actions #92

Updated by nakeee about 15 years ago

Please try to use cross platform libs when doing these kind of things.
You are just making us have more work porting it later on...

Actions #93

Updated by marcus about 15 years ago

sorry...

Actions #94

Updated by XTra.KrazzY almost 15 years ago

  • Status changed from Accepted to Work started

See the wiki page on it

Actions #95

Updated by federelli almost 15 years ago

Finally! Awesome work XK, hope you get to fix all the issues that haunt me!

Actions #96

Updated by XTra.KrazzY almost 15 years ago

Federelli: That Z:WW camera issue haunts me, but I can't seem to fix it :(

At least I'll work on what I can

Actions #97

Updated by kevinx0404 almost 15 years ago

How would tas work if dolphin can't run most games at full speed yet? Would audio
still sync in slow motion?

Actions #98

Updated by MrMister1991 almost 15 years ago

Lol he's right the only game I can get running at full speed on my quad core 2.2 GHz
is Sonic Adventure 2 Battle :P

Actions #99

Updated by XTra.KrazzY almost 15 years ago

kevinx0404: The recorder mostly runs the game in slow motion as it is, and when
dumping to AVI there is no frameskipping (all frames are dumped) and re-aligned to
constant 30/60 FPS. Sound will be synced as well.

Actions #100

Updated by marcus almost 15 years ago

Once someone gets the sync-robustness working, you won't have to play te game and
record video at the same time. You will be able to record the button presses of a
run, and then play it back while recording video.

Actions #101

Updated by kevinx0404 almost 15 years ago

If you say audio and video will sync perfectly at slow motion, then why doesn't audio
sync in normal speed? When I play a game like Trauma center, It plays the music at
normal wii hardware speed, but I have to wait before the operation can begin. The
music is finished before when it should have ended. I only get 20fps in game, but the
music is at full speed.

Actions #102

Updated by XTra.KrazzY almost 15 years ago

That's called DTK music and it comes from tracks on the CD. Please notice that it's
only streaming music (i.e. background music) and its speed isn't related to emulation
speed.

Actions #103

Updated by kevinx0404 almost 15 years ago

So will dtk music sync with slowmo?

Actions #104

Updated by XTra.KrazzY almost 15 years ago

well I say it won't. It's just too much work for too little gain.

It could be implemented but I'd prefer it wouldn't be.

What's so important about slowmo music?

Actions #105

Updated by kevinx0404 almost 15 years ago

so that it would sync in tas videos?

Actions #106

Updated by XTra.KrazzY almost 15 years ago

If TAS videos play in full speed, the music will also play in full speed, and synced.

Actions #107

Updated by kevinx0404 almost 15 years ago

Ok. Thanks.

Actions #108

Updated by marcus almost 15 years ago

wait what? Howzat work?

Actions #109

Updated by XTra.KrazzY almost 15 years ago

It just will. ;)

Actions #110

Updated by marcus almost 15 years ago

I is for itjustwill, that's good enough for me.

Actions #111

Updated by kevinx0404 almost 15 years ago

I have two more questions. When you savestate, can you switch between real and
emulated wiimote? It would help to use the emulated wiimote for a game like trauma
center for operations without a defibilator, but you'd need to use the real wiimote
for another operation. Lastly, since the format is .dtm, how would you encode is as a
file with the avi container and the x264vfw encoder? Will that be released with
dolphin too?

Actions #112

Updated by kevinx0404 almost 15 years ago

btw, is there a speedup option for tas to skip the boring story parts in some games?

Actions #113

Updated by XTra.KrazzY almost 15 years ago

speedup? more than what we try? No.

Actions #114

Updated by sl1nk3.s almost 15 years ago

I think you may want to try the "tab" key :)

Actions #115

Updated by XTra.KrazzY almost 15 years ago

I have throttling disabled by default :P

Actions #116

Updated by XTra.KrazzY over 14 years ago

@kevinx0404: frameskipping.. just for you.

Actions #117

Updated by marcus over 14 years ago

  • Relates to usability changed from Yes to No
Actions #118

Updated by kevinx0404 over 14 years ago

haha. Thanks XTra.KrazzY.

Actions #119

Updated by zantezuken over 14 years ago

Well.. not sure it's a TAS-related thing but anyway... Screenshot feature doesn't
work in D3D. A remind.

Actions #120

Updated by masterkillua123 over 14 years ago

Don't work fine. When I play the movie (example ssbb), the tas don't select the
character (I selected Link) and if moving in all the places (becouse I move to Link
to the Right, left, etc). Somebody can fix this problem, please?

Actions #121

Updated by jonny.ringelschwanz over 14 years ago

I have a question.

I wanted to build the TAS version of Dolphin and I heard, that I just have to
uncomment the TAS thingie in setup.h, but it doesn't work.
I always get many mistakes, when trying to build.

Are there any other things to do, or does anyone have advices for me.

Actions #122

Updated by marcus over 14 years ago

Just file a bug that says that the rerecording build is broken in rXXXX...

Actions #123

Updated by JackWitherell over 13 years ago

Does ANYONE know how to make a TAS for ANY emulator for MAC?!? It seems like there aren't any because nobody cares!!! I CARE!!!

Actions #124

Updated by shinydoofy over 13 years ago

fceux or mupen64 might compile on mac. Be a man, don't cry because there's no magic "it's all so simple" dmg file and AVOID CAPSLOCK AT ALL TIMES!!!1

Actions #125

Updated by smelenchuk over 13 years ago

I was playing with r6352 just now and have a few comments on the current state of rerecording.

  • With at least one game I tried (Luigi's Mansion) I seemed to be able to record (and rerecord, i.e. make use of save states) and play back a DTM properly (subject to e.g. not using multiple cores, though I didn't actually check to see if it would work in that case - prior experience suggested it won't). That having been said, at least one game (Twilight Princess) consistently fails to provide recordings that sync.
  • Memory cards aren't cleared between runs; this can mean that playback isn't starting back from exactly the same state. (A workaround is to simply not have memory cards be present.)
  • I find it unintuitive to have the prompt for the DTM appear at the end of an emulation session - for most other rerecording emulators you have the filename prompt appear at the beginning and have said file be updated as recording is made (or perhaps on making save states or closing the emulator).
  • I also find it unintuitive as to how to resume recording from a certain point - having checked the source code I gather a read-only option will be added at some point which will presumably also mean that, if said option is disabled during playback, one will be able to initiate recording again simply by providing the emulator with input during playback.

I look forward to seeing the above concerns addressed.

Actions #126

Updated by multi-ultra over 13 years ago

  • Memory cards aren't cleared between runs; this can mean that playback isn't starting back from exactly the same state. (A workaround is to simply not have memory cards be present.)

How about saving a copy of the memory card you used for movie making?

I already made a review on Dolphin here:
http://forums.dolphin-emu.com/thread-12226.html

Actions #128

Updated by skidau about 13 years ago

  • Status changed from Work started to Fixed

Most of the major TAS features have been implemented with r7186.

For the emulator to be deterministic, use these settings:

  1. Single Core mode
  2. LLE (recompiler or interpreter)
  3. LLE on thread disabled
  4. No Audio Output
Actions #129

Updated by baby.lueshi about 13 years ago

One last setting: Idle Skipping should be off, since that can mess with RNG values, among other things.

Actions #130

Updated by djnickers about 13 years ago

With the settings listed by skidau and lueshi, I can in fact rerecord properly... but only for a few seconds before a desync (playback misses a beat and the character's position no longer matches the user's input). By slowing down the Dolphin (safe accurate texture cache, disable EFC, etc), I can manage to record for a little longer before the inevitable desync.

Also, I can't get Read-Only Mode to work at all. Check or unchecked seems to have no noticeable effect when loading a save state while playing back a movie.
This is all as of the latest revision, r7243.

Thank you for the fantastic progress that has been performed on this issue thus far, but I don't think it's quite ready to be closed yet.

Actions #131

Updated by skidau about 13 years ago

Desync's and save states will continue to be an on-going issue. We have those tracked in other issues. This issue was to track the addition of the minimum required TAS features and those have been added.

Also, I wanted to note that even if the recording/playback were made with No Audio Output, dumping audio should still emit sound.

Using No Audio Output helps with sync in certain situations, however, the majority of the time, recording/playback will still work with audio.

Actions #132

Updated by baby.lueshi about 13 years ago

Wiimote recording still have some syncing issues with it, which might be causing your problems. Are you recording a Wii game, and if so, does it still happen as often with Gamecube games?

Actions

Also available in: Atom PDF