Attached is a little demo showing some of what's possible with Quest's new mapping feature. By setting the exit grid length to 0 and varying the "grid_bordersides" attribute (north = 8, east = 4, south = 2, west = 1, added together), you can create a more-or-less traditonal looking map.
This demo code is integrated with a freely available Javascript library called "rot.js", which is used to make "Rogue-like" games (thanks to Scott Greig for pointing me to this). It's available here:
http://ondras.github.com/rot.js/hp/ This code is just used to generate a random map.
The basic idea behind the map generator is that it takes a character-based map description and generates Quest connected rooms from it.
An example is this:
<mymap type="stringlist">
<value>11111111111</value>
<value>10001000111</value>
<value>10011000101</value>
<value>10111000101</value>
<value>10110000101</value>
<value>10110000101</value>
<value>10111110101</value>
<value>10000000001</value>
<value>11110111111</value>
<value>10010100001</value>
<value>10010100001</value>
<value>10000000001</value>
<value>10010100001</value>
<value>11110111111</value>
</mymap>
where "1" is a wall and "0" is empty space.
The files provided in the zip are:
GenerateMap.aslx - The core map generation code. Feel free to use this. Take it, embrace it, modify it, love it (as you see fit).
rot_test.aslx - The test program. This is what you load in Quest to run the demo.
rot.js - The freely available JS library. I did make one minor change to have the DIgger cells reported in row-major order instead of column-major order. Besides that, it's untouched.
rotglue.js - A small JS glue layer between Quest and rot.js.
There is one coding ugliness, which is the dependency (for this demo) on a "launch room" that the generated map gets attached to. I found that if the player has already entered a room and a new exit gets added, the map code does not see it, and things get really confused. So I had to add another room one step away which could remain clean for the map to be attached to. This is an area of the map code I need to figure out stil.
Now if we could have icons on the room cells... (Well you can have labels.)
A natural extension to this is to have the map strings include other symbols as well, which could be used (for example) to look up in a dictionary to provide things like room names, etc. Right now the rooms are bare bones. But... it is just a demo.