aboutsummaryrefslogtreecommitdiff
path: root/mapGen/README.md
diff options
context:
space:
mode:
authorInigoGutierrez <inigogf.95@gmail.com>2020-05-17 21:05:36 +0200
committerInigoGutierrez <inigogf.95@gmail.com>2020-05-17 21:05:36 +0200
commitdffcc04d93ea8aa1331f8bb3dbb97875f84e0926 (patch)
tree51a9fb7be677bdb75f8da65a1ea84183c7432e43 /mapGen/README.md
parent4e7cf6c285f1e932a04e16cf144917333b78e579 (diff)
downloadscripts-dffcc04d93ea8aa1331f8bb3dbb97875f84e0926.tar.gz
scripts-dffcc04d93ea8aa1331f8bb3dbb97875f84e0926.zip
Organized mapGen.sh
Diffstat (limited to 'mapGen/README.md')
-rw-r--r--mapGen/README.md89
1 files changed, 89 insertions, 0 deletions
diff --git a/mapGen/README.md b/mapGen/README.md
new file mode 100644
index 0000000..66e3363
--- /dev/null
+++ b/mapGen/README.md
@@ -0,0 +1,89 @@
+# mapGen.sh
+
+A shellscript to make grid maps from text files
+
+![Simple map example](examples/simpleBig.jpg)
+
+```
+xxxxx
+xGGxx
+xxooG
+xxGox
+xxxxx
+```
+
+## Dependencies
+
+- A POSIX-compliant shell (`bash`, `dash`, `sh`)
+- ImageMagick
+- Tools expected in a Unix environment: `grep`, `sed`, `awk`
+
+## Motivation
+
+The want for Vim to be a map maker.
+
+## Concept
+
+Given a text file in which each character represents a cell, have a script draw that map.
+
+`mapGen.sh` takes as input a text file with a block of text which ideally has a block of characters
+with no missing ones. It also takes a folder in which tile images are supposed to be. For each
+character in the file, it randomly takes one image in that folder which name starts with that
+characters and creates an image from the text file.
+
+## Examples
+
+![Cave dungeon example](examples/caveBig.jpg)
+
+![Tiled dungeon example](examples/tiledDungeonBig.jpg)
+
+Both images obtained from the same input:
+
+```
+XXXXXXXXXXXXXXXXXXXX
+XXXXXXooooooooXXXXXX
+XXXXXXoooooooooXXXXX
+XXXXXXooooooooooooXX
+XXXXCDooooooooooooDX
+XXXXXXooooooooooooXX
+XXXXXXooooooooooooXX
+XXXXXXoooooooooXXXXX
+XXXXXXooooooooXXXXXX
+XXXXXXXXXSXXXXXXXXXX
+XXXXXXXXooooXXXXXXXX
+XXXXXXXooooooXXXXXXX
+XXXXXXooooooooXXXXXX
+XooooXoooCooooXooooX
+XoCooXooooooooXooooX
+XooooXooooooooXooooX
+XooooXXooooooXXooooX
+XooooXXXooooXXXooooX
+XooooXXXXooXXXXooooX
+XXXoXXXXXooXXXXXooXX
+XXXoXXXXooooXXXXooXX
+XXXoooooooooooooooXX
+XXXXXXooooooooooooXX
+XXXXXXXXooooXXXXXXXX
+XXXXXXXXXooXXXXXXXXX
+XXXXXXXXXooXXXXXXXXX
+```
+
+## Usage
+
+```
+mapGen.sh [-s SIZE] [-f TILE_FOLDER] SOURCE_FILE
+```
+
+Where `SIZE` is the size of the tile images in pixels (default 8), `TILE_FOLDER` is the folder
+where the tile images are stored (default `./tiles`) and `SOURCE_FILE` is the text file with the
+layout of the map.
+
+## Possibilities
+
+The direct mapping of characters in text file to beginning of tile image name gives flexibility to
+either choose characters easy to read on the file or to use characters directly taken from the
+image names for easier memorization. Either way, the "configuration" of the relationship is
+trivial and freely customizable.
+
+For the examples I used tiles of 8x8 pixels, but other styles could be attained by using bigger
+ones.