Volcano Maze (beta)

Grotfang

Developer
Volcano Maze Solver

CptJesus and I spent a few hours together putting together a script to handle the Volcano Maze. Our work is attached below.

Warnings:

1) This script only works if you are at the beginning of the maze. I will say this again, louder:

This script only works if you are at the beginning of the maze.

Make sure you swim to shore (or haven't yet clicked anything) before running it. While we are working on getting it sorted to jump in at any point, that is a huge task and we wanted to release a first draft... first.
2) This script will stop one move before the goal (6,6). This is to allow you to heal, etc before going up against your nemesis. Remember this and don't be surprised when it finishes without... finishing.

In light of this, a couple of "features":

1) We heal at Doc Galaktik's (minimum hp increase) so as to adventure if you are on 0 HP
2) We work out which maze you are in according to the "signature" of the first row. This is why any position other than your starting position will screw things up.
3) We use direct URL calls to pump you through the maze according to the routes we know exist. It will not handle new mazes if they are added. Fortunately, if the maze doesn't have a known first-row "signature" we should stop the script, so no worries there.
4) We don't use abort() at any point, so this script can be used in combination with others.
 

Attachments

  • lava.ash
    15.9 KB · Views: 354
Last edited:

Bale

Minion
Sorry. It doesn't work.

Code:
> call scripts\lava.ash

Counted 169 squares.
Comparing row 1, square 0
Comparing row 1, square 1
Comparing row 1, square 2
Comparing row 1, square 3
Comparing row 1, square 4
Comparing row 1, square 5
Comparing row 1, square 6
Comparing row 1, square 7
Comparing row 1, square 8
Comparing row 1, square 9
Comparing row 1, square 10
Comparing row 1, square 11
Comparing row 1, square 12
Maze 5 is true
Maze 5 matches maze 5. If the numbers are the same, that's good!
You have 1 maze matching. Perfect.
6,12
7,12
8,12
9,11
10,11
11,10
11,9
11,8
12,7
12,6
11,5
11,4
11,3
10,2
9,1
8,1
7,0
6,0
5,1
4,1
3,0
2,0
1,1
1,2
0,3
0,4
1,5
2,4
3,3
4,3
5,3
6,2
7,2
8,3
9,4
9,5
9,6
10,7
9,7
8,6
8,7
7,8
6,8
5,8
4,7
Finished.

After that, I find that I'm still at the beginning of the puzzle. I won't be at the lava maze again until next week.
 

Grotfang

Developer
I'm assuming you refreshed the page, right? (As in, I'm hoping you did). It's getting the co-ordinates right, so I'll try and get a character through to the puzzle ASAP to find what's going wrong. The only maze I've been able to experiment with so far is maze 3, so I can't guarantee a quick fix

EDIT: Ok. Got to the maze and giving it a try. The problem seems not to be a problem with my co-ordinates, etc, but more a problem with how visit_url() deals with volcanomaze.php. It's happy visiting that URL, but it doesn't seem to do anything when I add ?move=x,y. I will try and have a fiddle later when I have more time, but unless I have confused myself considerably, I think this may be a mafia limitation more than a script limitation.
 
Last edited:

Veracity

Developer
Staff member
Looking at my session log, I see things like this:

volcanomaze.php?move=6,12&ajax=1

You might consider using visit_url( "xxx", false ), which tells it to do a GET, rather than a POST. I'll be at the maze pretty soon and will be able to look at the maze and check.
 

Veracity

Developer
Staff member
Yup, that was the problem. Here is an updated script. Note that it seems to leave you two steps away from the final platform, not one. I suspect that if you change the line that has

while( loopindex < count( map ) - 1 )

to not have that "- 1", it well step up next to the platform.
 

Attachments

  • lava.ash
    14.9 KB · Views: 176

Grotfang

Developer
Yup, that was the problem. Here is an updated script. Note that it seems to leave you two steps away from the final platform, not one.

Have I ever said how awesome you are? Cheers for this!

(I hope you don't mind, but I've stuck this in the first post. It's now credited correctly)

EDIT:

Just to confirm that this is now working. Just a quick list of layouts that it reports that I will fill in as we go. If you get a maze layout that is not confirmed (unconfirmed) then let me know. There is no good reason why it should fail, but I would like to confirm it works.

Maze 1: successful
Maze 2: successful
Maze 3: unconfirmed
Maze 4: successful
Maze 5: successful
Maze 6: successful
 
Last edited:

CptJesus

Member
Yay...this means I won't have to tediously complete the lava maze again next ascension. Three cheers for mafia scripting!
 
Just a small technical note. You start off the routes by visiting spot 6,12.

This is unnecessary, as that's the spot you're already at.

The reason I put those in the solve path is partially because of laziness, and partially because of the way the search algorithm works, it just needed the initial spot to know where to branch from.

Nice script though! Saves me the trouble of writing it. Though I might still bug myself enough to write one that executes the actual search rather than uses my solved routes. *shrug* Laziness prevails!
 

Veracity

Developer
Staff member
I will have a built-in solver tomorrow that will start from wherever you happen to be. No built-in maps, no requirement that you be at 6,12 to start.
 

Veracity

Developer
Staff member
I thought about that. I have a constant which is the number of maps, but notice that we keep taking steps and learning squares and tallying the total learned, and that it wouldn't be TOO hard to just keep doing that until all the maps have been seen and use that (variable) number, rather than the hardcoded 5.

Here is the output from my main, who had visited - but not moved within - the cavern. Note that it took 4 random moves, learned the other 4 maps, and calculated a path from where the random moves left her.

Tomorrow, I will make this command actually DO the moves to leave you next to the goal square, and will add a "solve" button to the map page in the Relay Browser which will call the algorithm and refresh the map when you are next to the goal.

Sample output:

> volcano solve

Map #1 has 32 platforms
33 total platforms seen.
Current position: 6,12 on map 1
Move to: 5,12 on map 1
Map #2 has 31 platforms
64 total platforms seen.
Move to: 4,12 on map 2
Map #3 has 32 platforms
96 total platforms seen.
Move to: 3,11 on map 3
Map #4 has 39 platforms
135 total platforms seen.
Move to: 2,11 on map 4
Map #5 has 34 platforms
169 total platforms seen.
We examined 452,212 paths and found a solution with 42 hops.
Hop to 1,10
Hop to 1,9
Hop to 1,8
Hop to 0,7
Hop to 0,6
Hop to 1,5
Hop to 1,4
Hop to 1,3
Hop to 2,2
Hop to 3,1
Hop to 4,1
Hop to 5,0
Hop to 6,0
Hop to 7,1
Hop to 8,1
Hop to 9,0
Hop to 10,0
Hop to 11,1
Hop to 11,2
Hop to 12,3
Hop to 12,4
Hop to 11,5
Hop to 10,4
Hop to 9,3
Hop to 8,3
Hop to 7,3
Hop to 6,2
Hop to 5,2
Hop to 4,3
Hop to 3,4
Hop to 3,5
Hop to 3,6
Hop to 2,7
Hop to 3,7
Hop to 4,6
Hop to 4,7
Hop to 5,8
Hop to 6,8
Hop to 7,8
Hop to 8,7
Hop to 7,6
Hop to 6,6
 

Grotfang

Developer
Very impressive. As much as it pains me that my work is made obsolete, this is incredible functionality - nice work! I look forward to using it :)
 

Bale

Minion
Well, you've pretty much just guaranteed that they'll never add new mazes since mafia would just solve those new mazes without even noticing the extra work. ;)
 
Top