Last week I quite easily found an optimal path through the first part of Monkey IslandTM 2. Moving on the second episode, I ran into difficulties.
First off, the map is much expanded. I now have three islands available to me, so the search space has gotten much larger. The map, with my (somewhat arbitrary) travel costs now looks like this:
Furthermore, there are a ton more objectives:
My hopes of an easy solution were dashed when I looked at this last graph and found a chain that required six island changes to get through the graph. Hopefully we can stick fairly close to that.
I entered all of the objectives into my system as quickly as I could and hit some problems:
- It ran slow.
- It ran reaaaallly slow.
The first act ran in a matter of seconds, but the second one, with the increased complexity seemed to take forever. I got lazy in implementing the search. To choose a node to explore I was resorting the list of possibilities on every iteration. This caused the search to slow down the further it got into it, and once there were about 16,000 nodes under consideration it pretty much stopped cold.
Once I swapped out my crappy list for a proper priority queue, I got much better search speed, but still was far from a solution. After 15 minutes of running and almost 7 million nodes considered, I got an OutOfMemory exception, because I was storing a list of nodes I had already considered to avoid repetition. I got to implement one of the cooler data structures I know of (the Directed Acyclic Word Graph, and finally I received a solution.
This is guaranteed to be optimal if my map weights make any sense, and if I did not overly constrain the search by the way I entered in the objectives. To the best of my knowledge this is a fairly good path. I will let you know how it goes once I play through it completely.
Here it is:
- Get Parrot Chow
- Go to BoatPhatt
- Go to Wharf
- Get Arrested(Automatic)
- Pull Mattress
- Get Stick
- Get Bone
- Get Key
- Unlock Cell
- Get Gorilla Envelope
- Get Manilla Envelope
- Open Gorilla
- Open Manilla
- Go to Wharf
- Go to RouletteAlley
- Watch Roulette
- Go to Wharf
- Follow dude
- Open Peephole
- Get winning Number
- Go to Wharf
- Go to RouletteAlley
- Win Cash
- Go to Wharf
- Go to SecretAlley
- Get Number
- Go to Wharf
- Go to RouletteAlley
- Win Invitation
- Go to Wharf
- Go to Library
- Get Lens
- Remember Hex Book(r-recipes)
- Remember Shipwrecks(d-disasters)
- Check Out Books
- Go to Wharf
- Go to BoatPhatt
- Go to BoatBooty
- Go to Ville
- Get leaflet from Kate
- Go to CostumeShop
- Get Costume
- Go to Ville
- Go to Shop
- Buy Saw
- Buy Horn
- Buy Sign
- Talk to pawn owner about trades
- Use chow on hook
- Get Mirror
- Go to Ville
- Go to MarleyMansion
- Present Costume and Invitation
- Go to MarleyBack
- Push Trash Can
- Run around to kitchen
- Get Fish
- Run around to front
- Get Map Piece
- Go outside
- Sweet Talk Elaine
- Go to MarleyLounge
- Go to MarleyMansion
- Chase Map Piece
- Get Dog
- Go to MarleyLounge
- Go to MarleyUpstairs
- Get Oar
- Go to MarleyLounge
- Go to MarleyMansion
- Go to BigTree
- Attempt to climb tree
- Get broken oar
- Go to BoatBooty
- Go to BoatScabb
- Go to Bridge
- Go to carpenter
- Give oar to carpenter
- Go to Bar
- Use banana on metronome
- Get blue and yellow drinks
- Pick up monkey
- Go to Wally
- Give lens to wally
- Go to Cleaners
- Saw Pegleg
- Go to Carpenter
- Get Hammer
- Get Nails
- Go to BoatScabb
- Go to BoatPhatt
- Go to Wharf
- Put leaflet on wanted poster
- Get near-grog from envelope
- Free Kate
- Go to Wharf
- Go to Pier
- Challenge Fisherman
- Give fish and Win
- Go to Wharf
- Go to BoatPhatt
- Go to BoatBooty
- Go to Ville
- Go to Spit
- Switch Flags
- Win Spitting Contest
- Go to Ville
- Go to Shop
- Trade plaque
- Go to Ville
- Read coordinates for mad monkey
- Charter ship and get masthead
- Go to Stans
- Nail Stan in coffin
- Get Crypt key
- Go to Ville
- Go to Shop
- Trade masthead for map
- Go to Ville
- Go to Cliff
- Fish Up Map
- Go to Ville
- Go to BigTree
- Climb Tree
- Get Telescope
- Use Dog to find map
- Go to BoatBooty
- Go to BoatPhatt
- Go to Mansion
- Go to MansionLobby
- Trick Guard
- Go to GovernersRoom
- Swap Books
- Go to MansionLobby
- Go to Mansion
- Go to Waterfall
- Go to WaterfallTop
- Use monkey wrench on valve
- Go to Waterfall
- Go to Cottage
- Cheat at drinking contest
- Open Window
- Put mirror in frame
- Put telescope in statue
- Push correct brick
- Get Map Piece
- Go to Wharf
- Go to BoatPhatt
- Go to BoatScabb
- Go to Cemetery
- Use Key in Crypt
- Go to Crypt
- Read Pirate quotes
- Open Coffin
- Get Ashes
- Go to Cemetery
- Go to Swamp
- Go to VoodooShack
- Pick up ash2Life Jar
- Talk to voodooLady and give book
- Go to Swamp
- Go to Cemetery
- Go to Crypt
- Use ash2Life on ashes
- Go to Cemetery
- Go to Beach
- Go to WeenieHut
- Use key at weenie hut
- Turn Off Gas
- Go to Beach
- Go to Cemetery
- Go to Crypt
- Revive rapp and get mapp
- Go to Cemetery
- Go to Bridge
- Go to Wally
- Give 4 pieces to Wally
This path has 7 island changes in it, which is not too shabby. The "speed guide" I used to construct my objectives graph changed islands 8 times, so I may be on to something. I completed this part of the quest in only 46 minutes, bringing my total to this point up to just 58 minutes.