Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Vanilla

Reply
 
Thread Tools Display Modes
Old August 16, 2009, 07:23   #11
Pete Mack
Prophet
 
Join Date: Apr 2007
Location: Seattle, WA
Posts: 5,773
Donated: $40
Pete Mack is on a distinguished road
Update:
I'm about 50% done with a movie function. Most of the effort is in re-learning the source code and it's interaction with the OS. The actual logging is dead easy. (The only tricky thing is making sure to treat user preferences--macros, options, and keymaps--correctly.)
Pete Mack is offline   Reply With Quote
Old August 16, 2009, 07:41   #12
PowerDiver
Prophet
 
Join Date: Mar 2008
Posts: 2,712
PowerDiver is on a distinguished road
Quote:
Originally Posted by Pete Mack View Post
Update:
I'm about 50% done with a movie function. Most of the effort is in re-learning the source code and it's interaction with the OS. The actual logging is dead easy. (The only tricky thing is making sure to treat user preferences--macros, options, and keymaps--correctly.)
Things to consider:

Do you want to store time delay between keystrokes as well?
On playback, do you want to be able to pause and check inventory etc?
Do you want to add some visible feedback for things like searching?

I tend to make a fair number of char dumps, often going off into another window to move them, thus perhaps avoiding a prompt about overwriting. How to deal with that?
PowerDiver is offline   Reply With Quote
Old August 16, 2009, 07:59   #13
Pete Mack
Prophet
 
Join Date: Apr 2007
Location: Seattle, WA
Posts: 5,773
Donated: $40
Pete Mack is on a distinguished road
Quote:
Originally Posted by PowerDiver View Post
Do you want to store time delay between keystrokes as well?
Already done
Quote:
On playback, do you want to be able to pause and check inventory etc?
That's a separate issue--I'm looking for basic functionality and correctness.

EDIT: The basic pause functionality is #1 on my TODO list.
Quote:
Do you want to add some visible feedback for things like searching?
Another separate issue.
Quote:
I tend to make a fair number of char dumps, often going off into another window to move them, thus perhaps avoiding a prompt about overwriting. How to deal with that?
Good point--I've already added some restrictions on recording -- like no messing with macros, keymaps, or options. Character dumps will be another.
If you want to do something out-of-game, you have to stop logging, then create a new session.

EDIT:
I'm still a bit ambivalent about this change.
I once added an Undo command as a joke in the OSX menus; it has since been removed. (It popped up an alert saying "Cheaters never win.") With redo logging, crude support for genuine undo becomes a trivial exercise (though it may take a lot of time.) I've already added another NOSCORE flag, but it will still be easy to abuse. It's already ridiculously easy to hack save files; the possibility of undo takes it to another level.

Last edited by Pete Mack; August 16, 2009 at 08:31.
Pete Mack is offline   Reply With Quote
Old August 16, 2009, 10:11   #14
Sirridan
Knight
 
Sirridan's Avatar
 
Join Date: May 2009
Posts: 560
Sirridan is on a distinguished road
So how does this work actually? Does it save your keystrokes, and all the random seeds, and then on playback just re-create the entire game from that data?
Sirridan is offline   Reply With Quote
Old August 16, 2009, 14:59   #15
Pete Mack
Prophet
 
Join Date: Apr 2007
Location: Seattle, WA
Posts: 5,773
Donated: $40
Pete Mack is on a distinguished road
It's simpler than that. A "movie" is a directory with 3 files:
1. A wizard-mode save file from the start of the log (aka: checkpoint)
2. User preference file for prefs that change keystrokes. (keymaps, options, etc)
3. The actual key log, with an injected keystroke(s) for window size, (etc).

To replay, you just open the save, apply the preferences, and start replaying the keystrokes.

The hardest part is getting the preference file right.
Pete Mack is offline   Reply With Quote
Old August 16, 2009, 17:15   #16
d_m
Angband Devteam member
 
d_m's Avatar
 
Join Date: Aug 2008
Location: Philadelphia, PA, USA
Age: 40
Posts: 1,516
d_m is on a distinguished road
So if you go up or down stairs, does it continue recording? Are you guaranteed to get the same level? Or are movies limited to recording action on one particular level?

This is really interesting. I'm excited to see some movies!
__________________
linux->xterm->screen->pmacs
d_m is offline   Reply With Quote
Old August 16, 2009, 17:42   #17
Pete Mack
Prophet
 
Join Date: Apr 2007
Location: Seattle, WA
Posts: 5,773
Donated: $40
Pete Mack is on a distinguished road
No--movies are more like the Borg.

Once macros* (which are mostly term-level stuff) are parsed, everything looks like a single keystroke or other UI event. It just keeps replaying the game until the log runs out.

(It's a bit more complicated, to allow for external inputs like screen refreshes, pauses, and quits, but not much--and as Eddie suggested, there's a possibility of a small set of legitimate commands like inventory that won't affect the game state--even the 'l'ook/e'x'amine command can't be allowed in most cases, because it changes targeting!)

I've got the basic logging written, now I'm hooking it into inkey().


* and I was wrong about writing macros to the special user prefs. They are processed before logging. keymaps are important, so I need to split them out of the macro_dump pref file writer.

EDIT
PS to Niles:
Sorry about hijacking your thread!

Last edited by Pete Mack; August 16, 2009 at 17:48.
Pete Mack is offline   Reply With Quote
Old August 16, 2009, 20:53   #18
Pete Mack
Prophet
 
Join Date: Apr 2007
Location: Seattle, WA
Posts: 5,773
Donated: $40
Pete Mack is on a distinguished road
For those who are curious, the fundamental changes are instumenting inkey_ex correctly, and adding the logger. There are other changes like disallowing saves and many user commands, but for hands-off use, these changes should suffice.

I'm still debugging, but this gets the basic idea.

EDIT:
BTW, isn't about time to join the 90s and replace "aux" with "impl"?
Also: the Borg's 'Mega-Hack' for injecting characters really is a Mega-Hack. There is a right way to do this. See diffs.txt
Attached Files
File Type: txt logger.c.txt (2.5 KB, 94 views)
File Type: txt diffs.txt (795 Bytes, 96 views)

Last edited by Pete Mack; August 16, 2009 at 21:07.
Pete Mack is offline   Reply With Quote
Old August 16, 2009, 22:17   #19
Nile
Scout
 
Join Date: Jul 2008
Posts: 31
Nile is on a distinguished road
Quote:
Originally Posted by Pete Mack View Post
PS to Niles:
Sorry about hijacking your thread!
Hey, no problem!
Nile is offline   Reply With Quote
Old August 17, 2009, 04:26   #20
Arphod
Apprentice
 
Join Date: Nov 2008
Location: Indiana, USA
Posts: 50
Arphod is on a distinguished road
Quote:
Originally Posted by Pete Mack View Post
That said, I wouldn't mind watching a really serious dive (< 250K turn win). I have a very poor feel for strategy at that level; watching a single game might make a huge difference.
Oh man, somebody please do this.
__________________
Little Willie was a chemist
Willie is no more.
What he thought was H2O
was H2SO4.
Arphod is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't play Angband now Vlarg Idle chatter 4 September 9, 2008 14:31
Music to play to Faust Idle chatter 38 July 27, 2008 09:04
Video Card OLSEN Idle chatter 3 October 23, 2007 01:15
Anyone out there still play Ey? Slonk Variants 5 September 7, 2007 05:53
{UN} play by play impressions & a couple questions. will_asher Variants 15 September 1, 2007 14:35


All times are GMT +1. The time now is 13:40.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.