microsoft / jericho

A learning environment for man-made Interactive Fiction games.
GNU General Public License v2.0
253 stars 42 forks source link

WIP: Improving walkthroughs and victory conditions #26

Closed MarcCote closed 4 years ago

MarcCote commented 4 years ago

This PR is a work in progress.

This PR aims at improving the existing walkthroughs and adding new ones. This PR also makes sure the victory condition for the games works as expected.

Progress

Contributing

To contribute, make a PR to MarcCote/jericho/tree/walkthroughs. See the documentation to know which games are supported by Jericho.

In this PR, there are two handy scripts: tools/find_walkthrough.py and tools/test_games.py.

find_walkthrough.py

Usage: python find_walkthrough.py gamefile.z5 --walkthrough walkthrough.txt

This script plays gamefile.z5 by applying the commands found in walkthrough.txt (one command per line). After each command, the resulting obs string is displayed and a prompt is presented to the user to provide the next command. If available, the proposed command form the walkthrough is shown between[] and will be used as default if the user types an empty command.

For convenience, one can easily skip to the n-th command of the walkthrough by using the --skip-to argument (e.g. python find_walkthrough.py gamefile.z5 --walkthrough walkthrough.txt --skip-to N).

Special commands

test_games.py

Usage: python test_games filename [filename ...]

This script goes over all provided game files and for each, it checks if the corresponding walkthrough in jericho/game_info.py is complete and valid.

Example: python tools/test_games.py roms/* image

MarcCote commented 4 years ago

I just noticed the game sorcerer requires the manual mid-play (after ~50 moves) to know which buttons to press.

MarcCote commented 4 years ago

@mhauskn I think the score detection might be broken for some of the games (see screenshot in the first post).

mhauskn commented 4 years ago

Marc - this is awesome! You're right that the game-over detection is broken for many of the games.

Which games are giving issues with score detection? Zork2?

MarcCote commented 4 years ago

@mhauskn in the screenshot above (I'll update it every time I add new walkthrough), all games with a "Done but score X/Y". At the moment, that would be: anchor, balances, enchanter, infidel, sorcerer, and zork2.

mhauskn commented 4 years ago

So for a game like anchor - we are actually getting all 100 possible points, but get_score() is returning 99?

MarcCote commented 4 years ago

~yes, that's what I see.~ EDIT: actually, for anchor we do get 99/100, my bad. EDIT2: See #17

In that game you scored 99 out of a possible 100 points; you have banished the evil and saved your husband from a fate most hideous -- but you were unable to solve the entire mystery.

The score was made up as follows:

     2 points for finding the house keys
     2 points for showing the keys to Michael
     1 point for taking a bath
     2 points for getting the book from the librarian
     1 point for getting the key from the cellar
     1 point for getting the key from the attic
     2 points for finding the journal
     2 points for finding the diary
     1 point for finding the safe
     2 points for opening the safe
     2 points for opening the puzzle box
     2 points for guessing Michael's computer passcode
     5 points for receiving the amulet
     2 points for giving the bum whiskey
     5 points for giving the bum the amulet
     5 points for learning the name IALDABAOLOTH
     2 points for spying on Michael
     2 points for opening the secret door behind the wine racks
     2 points for hiding from the monster at the slaughterhouse
     1 point for breaking into the church
     2 points for escaping from the church
     2 points for opening Claudia Benson's desk drawer
     2 points for giving the teddy bear to Jeffrey's mother
     1 point for getting the long steel key
     1 point for shutting off the steam valve
     2 points for getting up to the mill laboratory
     2 points for escaping the strait jacket
     2 points for finding Edward Verlac's last testament
     2 points for escaping the asylum
     2 points for recovering the amulet
     2 points for slaying William Verlac
     5 points for sabotaging the ritual
     5 points for freeing Jeffrey
     5 points for showing the wedding ring to Michael
     5 points for putting the amulet on Michael
     5 points for banishing Croseus Verlac
    10 points for doing it in time to save your husband's life

    99 total (out of 100)

Thank you for playing Anchorhead!
mhauskn commented 4 years ago

I'd like to help gathering/generating walkthroughs. Are there games that I can start working on that you're not focusing on?

MarcCote commented 4 years ago

I finished the list of walkthroughs I had (mostly Infocom games). I was planning on starting at the top of the list. You can start at the bottom, or vice versa.

mhauskn commented 4 years ago

Great, I'll start with ztuu and work my way up.

mhauskn commented 4 years ago

I made it through ztuu/zenon/yomomma today. Back for more on Tuesday.

MarcCote commented 4 years ago

Just added a few more walkthroughs. I updated the screenshot above.

mhauskn commented 4 years ago

Finished walkthroughs for weapon/tryst205/trinity today.

mhauskn commented 4 years ago

Finished walkthroughs for theater and temple today. Still working on spirit.

MarcCote commented 4 years ago

@mhauskn I added a check list in my first post to keep track of what's completed. I think you have write permission to check items.

mhauskn commented 4 years ago

I've finished adding most of the games and have fixed the score detection in many games. How to proceed - can I send a PR from my local to your branch?

MarcCote commented 4 years ago

@mhauskn yes that would be the easiest thing to do. You manage to find a walkthrough for inhumane!

mhauskn commented 4 years ago

I found this youtube video https://www.youtube.com/watch?v=hhWIbwBRqLM.

On Tue, Feb 4, 2020 at 5:10 PM Marc-Alexandre Côté notifications@github.com wrote:

@mhauskn https://github.com/mhauskn yes that would be the easiest thing to do. You manage to find a walkthrough for inhumane!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/microsoft/jericho/pull/26?email_source=notifications&email_token=AAAE2OJ6YJUUD4IBZOR32WDRBIGZBA5CNFSM4KGU77JKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEKZZF5Y#issuecomment-582193911, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAE2OLZEQVEXN33FB56IA3RBIGZBANCNFSM4KGU77JA .

mhauskn commented 4 years ago

I created a branch jericho/walkthroughs branch which has my changes. When trying initiate a PR against your branch, it only seems to want to merge your branch into mine (weird). Not sure what soln is.

On Tue, Feb 4, 2020 at 5:17 PM Matthew Hausknecht < matthew.hausknecht@gmail.com> wrote:

I found this youtube video https://www.youtube.com/watch?v=hhWIbwBRqLM.

On Tue, Feb 4, 2020 at 5:10 PM Marc-Alexandre Côté < notifications@github.com> wrote:

@mhauskn https://github.com/mhauskn yes that would be the easiest thing to do. You manage to find a walkthrough for inhumane!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/microsoft/jericho/pull/26?email_source=notifications&email_token=AAAE2OJ6YJUUD4IBZOR32WDRBIGZBA5CNFSM4KGU77JKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEKZZF5Y#issuecomment-582193911, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAE2OLZEQVEXN33FB56IA3RBIGZBANCNFSM4KGU77JA .

MarcCote commented 4 years ago

@mhauskn I have merge your commit to this PR. I have updated the figure in my first post. Note how the score is broken for some of the game.

Use -v option to print the last game output of each failed game, i.e., python tools/test_games.py roms/* -v.

mhauskn commented 4 years ago

I've fixed the remaining score detection issues and finished the walkthrough for Spellbreaker. All of the remaining tests that are failing are due to the walkthroughs themselves reaching victory but not collecting all possible points. In my opinion, this is okay and it may be quite difficult to figure out how to get all the possible points in each game. The only open issue that remains is finding/creating a walkthrough for Omniquest.

I've pushed my edits into a branch called pull26 - can you merge them into your PR?

And yes - I removed lgop due to the adult-themed content.

MarcCote commented 4 years ago

@mhauskn merged into this PR. I've updated the figure and the check list. If that looks good to you, feel free to merge the PR into Jericho.

Also, I have annotated some of the walkthroughs, do you want them?

Good job! :D

mhauskn commented 4 years ago

What do you mean by annotated walkthroughs?

mhauskn commented 4 years ago

Marc - can you remove the annotated walkthroughs (in the walkthroughs directory) and bump the version number?

MarcCote commented 4 years ago

Here you go @mhauskn