#8693 closed patch
Action recorder
Reported by: | SF/h00ligan | Owned by: | sev- |
---|---|---|---|
Priority: | normal | Component: | --Other-- |
Version: | Keywords: | ||
Cc: | Game: |
Description
This patch implements record and playback of scummvm game progress.
Remarks: - every backend must delete eventManager instance (as I already implemented for SDL) - all random sources must be registered with eventManager by unique name
Ticket imported from: #1738058. Ticket imported from: patches/798.
Attachments (2)
Change History (13)
by , 17 years ago
Attachment: | TEST5.patch added |
---|
comment:1 by , 17 years ago
Usage:
set record_mode=record
in scummvm.ini
Play game
set record_mode=playback
and run scummvm with same target again. It will playback recorded sequence.
It will create 3 files in savepath:
record.bin record.time
and record.tmp, which is a temporary file, but can not be removed due to lack of functionality in our File class
comment:2 by , 17 years ago
This works just fine on wince (scumm games tested) with a small patch (follows - I didn't attach it because it's trivial) and the savepath variable defined. Possible enhancements include: per-game/user naming for saved files, start-pause-stop playback, gui for it. good work!
---cut----
Index: wince-sdl.cpp
--- wince-sdl.cpp (revision 27470) +++ wince-sdl.cpp (working copy) @@ -278,11 +278,13 @@ // one timer in scummvm (for the time being) _timer = _int_timer = new DefaultTimerManager(); _timerID = NULL; // OSystem_SDL will call removetimer with this, it's ok - SDL_SetTimer(10, &timer_handler_wrapper);
// Chain init OSystem_SDL::initBackend();
+ // Start timer after all init has been done + SDL_SetTimer(10, &timer_handler_wrapper); + // Query SDL for screen size and init screen dependent stuff OSystem_WINCE3::initScreenInfos(); _isSmartphone = CEDevice::isSmartphone();
comment:4 by , 17 years ago
Owner: | changed from | to
---|
comment:5 by , 17 years ago
Just tried this patch and it seems to work nicely for the most part.
Here's my feedback:
- Something went wrong the first time I recorded me playing BASS: during playback it seemed to skip one (or more) mouse-clicks I made about 1 minute into playing, causing the playback to behave strangely as Foster didn't enter the door like I did when it was recording, and now it was subsequently performing clicks and mouse-movements that should be performed in the next room.
I was able to consistently reproduce this using the same replay file.
Afterwards I tried a few times to reproduce this with a new recording, but wasn't able to (and unfortunately the original replay file that exhibited the problem was since overwritten).
- During playback I tried to move the ScummVM window by clicking its decoration/title and dragging it, but found that while attempting this that it seemed to receive all kinds of mouse-move events (presumably from the playback), thus causing the window to warp around my desktop(s) like crazy.
I'm using the XFCE4 window manager on X.org if that matters.
comment:7 by , 17 years ago
Note that readRecord / writeRecord write structs in one go. This is not portable, and also not future safe.
comment:9 by , 17 years ago
Owner: | changed from | to
---|---|
Status: | new → closed |
comment:10 by , 17 years ago
I modified patch as following:
- Made it compile with current SVN - Extended it to new engines - Added command line options - Fixed crash when record files do not exist
Still some work is needed in this direction: - Try to avoid warpMouse() calls at playback, so the system will be useable - Perhaps we need to indicate recording mode. May be draw triangle/circle in some corner. Use OSD overlay for that - Still it is possible that time will drift away even with current implementation. Do something about it
comment:11 by , 6 years ago
Component: | → --Other-- |
---|
Recorder patch