Request for improvements of automatic tape playback

Found a bug in R'n'D? Report it here!

Moderators: Flumminator, Zomis

Post Reply
filbo
Posts: 647
Joined: Fri Jun 20, 2014 10:06 am

Request for improvements of automatic tape playback

Post by filbo »

> To test the attached fixed tape, copy it to a "tape" sub-folder of that level set and type:
>
> shell> ./rocksndiamonds -e "autoplay emc_emerald_mine_original_1 071"

The subdirectory name is "tapes", not "tape", at least on Linux.

I verified that this works:

$ GAME_DATA=/usr/share/games/rocksndiamonds
$ LEVELSET_DIR="Emerald Mine Club"
$ LEVELSET=emc_amiga_mine_22

$ sudo ln -s ~/.rocksndiamonds/tapes/$LEVELSET $GAME_DATA/levels/"$LEVELSET_DIR"/$LEVELSET/tapes
$ rocksndiamonds -e "autoplay $LEVELSET 1"

(but is not generic since I had to manually supply the $LEVELSET_DIR part of the path)

Can you make "-e autoplay $LEVELSET" either automatically pick up the contents of ~/.rocksndiamonds/tapes/$LEVELSET, or add a similar command like "-e testmytapes" or a flag like "-e autoplay -user"? I don't want to have to perform surgery on my system-wide games data hierarchy in order to test per-user saved tapes...

Also would be nice:

- a way to visually play back a level or whole levelset from the command line (I think this exists? but not documented in --help output)
- when visually playing back, a flag to specify the playback speed
- when visually playing back, a flag to specify the playfield zoom factor (currently just the Setup -> Graphics -> Small Game Graphics toggle, but hopefully some day a full ++/-- zoom set like now available in the editor... :)
filbo
Posts: 647
Joined: Fri Jun 20, 2014 10:06 am

Re: 3.3.0.1: Other players' sudden appearance in recorded ta

Post by filbo »

Posting a "bump" for the above requests, since I ran into it while searching whether I had ever posted another bug which I'm about to post...
User avatar
Holger
Site Admin
Posts: 4073
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Re: 3.3.0.1: Other players' sudden appearance in recorded ta

Post by Holger »

> Also would be nice:
>
> - a way to visually play back a level or whole levelset from the command line (I think this exists? but not documented
> in --help output)
> - when visually playing back, a flag to specify the playback speed

No, this did not exist before (just the invisibly played back test tape run).

But I've extended it now as follows:

Code: Select all

$ ./rocksndiamonds --help
...
  "autotest LEVELDIR [NR ...]"     test level tapes for LEVELDIR
  "autoplay LEVELDIR [NR ...]"     play level tapes for LEVELDIR
  "autoffwd LEVELDIR [NR ...]"     ffwd level tapes for LEVELDIR
...
What previously was "autoplay" is now "autotest", while "autoplay" now visibly plays back a tape or whole set of tapes. "autoffwd" does what "autoplay" does, but with maximum speed (no delay between frames). (This differs a bit from the wording in the game, where "fast forward" is double-speed playback, while playback without delay is "warp forward" (which exists in a visible and an invisible variant, depending on when you press which button).)

Maybe I will also add an "autodemo" mode, which also contains door animations, screen fading and everything else which you would see when manually playing back a tape, just for demonstration purposes or when making a gameplay video.

The "zoom" thing would also be nice indeed...
filbo
Posts: 647
Joined: Fri Jun 20, 2014 10:06 am

Re: 3.3.0.1: Other players' sudden appearance in recorded ta

Post by filbo »

The new options work -- thanks!

While playing with them (along with the `sudo ln -s ~/.rocksndiamonds/tapes/$LEVELSET $GAME_DATA/levels/"$LEVELSET_DIR"/$LEVELSET/tapes` workaround), my ~/.rocksndiamonds/levelsetup/$LEVELSET/levelsetup.conf got blown away. Not sure exactly what I did to cause it.

Renaming "autoplay" -> "autotest" may break someone's regression testing.

The output

Code: Select all

Level 000: playing tape ... solved.
Level 001: playing tape ... solved.
Level 002: playing tape ... solved.
etc. could be improved to include what sort of playback and how long it took:

Code: Select all

Level 000: testing tape ... solved in 5.604s.
Level 001: playing tape ... solved in 89.048s.
Level 002: ffwding tape ... solved in 12.345s.
User avatar
Holger
Site Admin
Posts: 4073
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Re: Request for improvements of automatic tape playback

Post by Holger »

(This topic was split from this thread to be handled as a separate feature request, as it was initiated by, but had nothing to do with that bug report.)
User avatar
Holger
Site Admin
Posts: 4073
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Re: Request for improvements of automatic tape playback

Post by Holger »

Can you make "-e autoplay $LEVELSET" either automatically pick up the contents of ~/.rocksndiamonds/tapes/$LEVELSET, or add a similar command like "-e testmytapes" or a flag like "-e autoplay -user"? I don't want to have to perform surgery on my system-wide games data hierarchy in order to test per-user saved tapes...
Totally valid request. I've added a new option "--mytapes" for this purpose, so you can decide which set of tapes to use.

For example:

Code: Select all

$ ./rocksndiamonds --mytapes -e "autotest classic_boulderdash"
This one was really missing so far.
User avatar
Holger
Site Admin
Posts: 4073
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Re: Request for improvements of automatic tape playback

Post by Holger »

Does it work as expected? If yes, I would mark this thread as "solved"...
filbo
Posts: 647
Joined: Fri Jun 20, 2014 10:06 am

Re: Request for improvements of automatic tape playback

Post by filbo »

It all works. I was going to suggest an "--autowarp" flag, but then I tried it and it worked :) -- and then I checked the "--help" output and there it was.

I see you didn't do "--autodemo" as you suggested you might.

Running any sort of --auto* annoyingly overwrites ~/.rocksndiamonds/levelsetup.conf [last_level_series], so that I must go questing. Some day, would like (1-easy) that not to happen, (2-annoying) a "recently played level series" list recorded in levelsetup.conf and accessible through game UI. :)

Thanks!

[Should I go raise bugs for those two?]
User avatar
Holger
Site Admin
Posts: 4073
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Re: Request for improvements of automatic tape playback

Post by Holger »

It all works.
Good to know. :)
I see you didn't do "--autodemo" as you suggested you might.
Yeah, right. I's a bit more tricky than I thought at first... :/
Running any sort of --auto* annoyingly overwrites ~/.rocksndiamonds/levelsetup.conf [last_level_series], so that I must go questing. Some day, would like (1-easy) that not to happen, (2-annoying) a "recently played level series" list recorded in levelsetup.conf and accessible through game UI. :)
You're right here. The first one should be fixed, and the second one would be really nice to have!
[Should I go raise bugs for those two?]
Yes, go ahead, please! :)
User avatar
Holger
Site Admin
Posts: 4073
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Re: Request for improvements of automatic tape playback

Post by Holger »

Running any sort of --auto* annoyingly overwrites ~/.rocksndiamonds/levelsetup.conf [last_level_series], so that I must go questing.
Just tested this, and cannot reproduce it (or maybe just misunderstood whan you mean): Using "auto<something>" never touches my "~/.rocksndiamonds/levelsetup.conf" file! So, for example, I can play "classic_supaplex", quit, "autoplay classic_sokoban" or whatever, start the game again and continue with my last Supaplex level.

Have I overseen something, or did you mean something different?
filbo
Posts: 647
Joined: Fri Jun 20, 2014 10:06 am

Re: Request for improvements of automatic tape playback

Post by filbo »

It overwrote for me. My levelsetup.conf has always been fairly fragile, gets overwritten all the time. So I may have provoked whatever bug causes that, rather than a direct effect of the --auto flags. I'll try to repro some time soon.
User avatar
Holger
Site Admin
Posts: 4073
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Re: Request for improvements of automatic tape playback

Post by Holger »

Hmm, I cannot remember that I ever had such a problem. But this probably does not mean much. I'm really curious what actions might have caused the trouble you've experienced.

The only case of "unpleasing" overwriting of that file I can think of is if the game ran into a "fatal error" state where it shows a final error message and exits after a keypress or mouse click, resetting the current level to the default (safe) tutorial level set (to prevent subsequent failures usually caused by a custom level set triggering whatever sort of misbehaviour, which usually does not occur with a "proven" standard level set, so it would be unwise to start and fail with that last level set again and again).
filbo
Posts: 647
Joined: Fri Jun 20, 2014 10:06 am

Re: Request for improvements of automatic tape playback

Post by filbo »

That's probably been the cause in many cases, but I'm certain not all.

If it could just remember a "where I was before I reset to safe default" levelset name -- even if there was no UI to retrieve it, beyond `cat ~/.rocksndiamonds/levelsetup.conf` -- that'd be a help. And if you're resetting to the default level from the default level, don't overwrite the saved one :)

Ah: repro:

1. ~/.rocksndiamonds/levelsetup.conf contains: last_level_series: emc_den_mine_06
2. $ (while :; do grep last ~/.rocksndiamonds/levelsetup.conf; sleep 2; done)&
3. $ rocksndiamonds --mytapes -e "autowarp classic_boulderdash"
4. `grep` loop continues to show emc_den_mine_06
5. While it is autowarp-ing, hit ESC, Enter
6. Now back at main menu (side bug: "door" still shows "do you really want to quit" question)
7. Main menu is at classic_boulderdash levelset
8. `grep` loop still good
9. Click on 'Quit' main menu item
10. `grep` loop shows classic_boulderdash (note I have not confirmed quit yet!)
11. Confirm quit
12. levelsetup.conf is (was at step 9) overwritten

... sorry, not entering formal bugs right now, need sleep :)
filbo
Posts: 647
Joined: Fri Jun 20, 2014 10:06 am

Re: Request for improvements of automatic tape playback

Post by filbo »

last_level_series getting overwritten to 'rnd_tutorial_niko_boehm' in various failure states continues to plague me!

Please make levelsetup.conf contain more than just a single 'most recently played' + 'most recently caused a problem'. At the very least, don't rewrite the 'caused a problem' comment with the name of the default levelset; if the problem happens while running the default levelset, retain the previous comment.

But, much better, add the 'recently played levelsets' UI I hinted at here.
Post Reply