... now with 35% more arrogance!

Tuesday, July 26, 2011

Random ASCII Maps

Is there any interest in a tutorial on how to use a random map tool for a computer game (tool not written by me) to create random ASCII maps which can then be adapted to one-page dungeon format?

The ASCII maps look like this:
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
ASSSSSSSSSSSSSSSSSSSSSSSSSSSSSSA
AS...PPP......................SA
ASPPPPPP......................SA
ASPPPPPP......................SA
ASPPPPPP......................SA
ASPPPPPP......................SA
ASPPPPPP......................SA
ASPPPPPP......................SA
AS...PPP......................SA
AS...PPP......................SA
AS.................11111......SA
AS.................11111......SA
AS.................11111......SA
AS..G.......g......11111......SA
AS..........gg....L11111......SA
AS...........gg...LLL.........SA
AS........WW.gg...............SA
AS........WWW.g...............SA
AS........WWW.g...............SA
AS........WWW.................SA
AS........WLLLL....L..........SA
A22222.g.WWL..................SA
A22222.WWWWW..................SA
A22222WWWWWWW.................SA
A22222WWWWWWW.................SA
A22222G.WWWWW.................SA
AS..WW..WWWWWW................SA
AS.WWWW.WWWW..................SA
AS..WWWWWW....................SA
ASSSSSSSSSSSSSSSSSSSSSSSSSSSSSSA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA

9 comments:

  1. Not quite, although there's always been a hint of Nethack in my approach to D&D (hence, the posts about eating corpses of monsters.)

    ReplyDelete
  2. I wouldn't mind seeing a good Roguelike-esque map creator, provided it has an attractive enough output.

    ReplyDelete
  3. I'd be interested in knowing how the code for something like this works.

    ReplyDelete
  4. I don't have the source code for the program I used to create that map; in fact, I remember reading that the creator of one of the DK2 fan utilities (possibly this utility) lost the source code himself. You might want to check around for the source code to Nethack; I had it at one point, so it must be available. A bright programmer might be able to repurpose the map generation code from that to generate ASCII maps.

    ReplyDelete
  5. There has to be a program to do this, but I think they are often built into game engines.

    What you are looking for is a program that takes an ASCII map and then renders it as tiles. Dungeon Crawl Stone Soup, for example, as a developer wiki where this is discussed. Maps are programmed in ASCII, but then rendered with bitmapped tiles.

    I did run across a Perl script which uses the NaturalDoc language interpreter to render ASCII art in SVG format:
    http://www.pointy.plus.com/naturaldocs_svg/

    However, I can't get the program to run on my Mac--I might have installed it incorrectly.

    I link from the above website took me to this:
    http://docutils.sourceforge.net/sandbox/aafigure/

    which might be of further use, as it is a Python script to render ASCII art in image format.

    I don't speak programmer, so maybe one of these links might do what you want.

    Please keep us informed, as this would be a cool tool to have!

    ReplyDelete
  6. There has to be a program to do this, but I think they are often built into game engines.

What you are looking for is a program that takes an ASCII map and then renders it as tiles.

    Dungeon Crawl Stone Soup, for example, as a developer wiki where this is discussed. Maps are programmed in ASCII, but then rendered with bitmapped tiles.

    I did run across a Perl script which uses the NaturalDoc language interpreter to render ASCII art in SVG format:
http://www.pointy.plus.com/naturaldocs_svg/



    However, I can't get the program to run on my Mac--

    I might have installed it incorrectly.

 A link from the above website took me to this:

    http://docutils.sourceforge.net/sandbox/aafigure/



    which might be of further use, as it is a Python script to render ASCII art in image format.



    I don't speak programmer, so maybe one of these links might do what you want.



    Please keep us informed, as this would be a cool tool to have!

    ReplyDelete
  7. @Matthew:Blogger marked your posts as spam, because of the dual linkage, I suppose.

    Actually, I'm not looking for an ASCII-to-tile mapper. Technically, it could be done with perl: map the letters and characters used in the ASCII map to file names of tiles, then assemble them somehow, possibly ImageMagick, but since I only use that infrequently, I'd probably just use the PerlHP module to make a CGI script that builds a table, one image per cell.

    What I'm talking about is hand mapping, but using a randomly-generated ASCII map (or, for that matter, a non-ASCII map) as inspiration.

    ReplyDelete
  8. If just for inspiration, look no more. Here is a nice fractal worl generator with adjustable settings.

    http://donjon.bin.sh/world/

    ReplyDelete