From dffcc04d93ea8aa1331f8bb3dbb97875f84e0926 Mon Sep 17 00:00:00 2001 From: InigoGutierrez Date: Sun, 17 May 2020 21:05:36 +0200 Subject: Organized mapGen.sh --- mapGen/README.md | 89 ++++++++++++++++++++++++++++++++++++ mapGen/bicolor/Cchamber.jpg | Bin 0 -> 1278 bytes mapGen/bicolor/Ddoor.jpg | Bin 0 -> 1282 bytes mapGen/bicolor/Ggrass.jpg | Bin 0 -> 1275 bytes mapGen/bicolor/Ppassage.jpg | Bin 0 -> 1286 bytes mapGen/bicolor/SsecretDoor.jpg | Bin 0 -> 1280 bytes mapGen/bicolor/Xwall-01.jpg | Bin 0 -> 1267 bytes mapGen/bicolor/Xwall-02.jpg | Bin 0 -> 1274 bytes mapGen/bicolor/Xwall-03.jpg | Bin 0 -> 1272 bytes mapGen/bicolor/Xwall-04.jpg | Bin 0 -> 1264 bytes mapGen/bicolor/Xwall-05.jpg | Bin 0 -> 1256 bytes mapGen/bicolor/Xwall-06.jpg | Bin 0 -> 1267 bytes mapGen/bicolor/ofloor-01.jpg | Bin 0 -> 1263 bytes mapGen/bicolor/ofloor-02.jpg | Bin 0 -> 1259 bytes mapGen/bicolor/ofloor-03.jpg | Bin 0 -> 1262 bytes mapGen/bicolor/ofloor-04.jpg | Bin 0 -> 1270 bytes mapGen/bicolor/ofloor-05.jpg | Bin 0 -> 1267 bytes mapGen/bicolor/ofloor-06.jpg | Bin 0 -> 1270 bytes mapGen/bicolor/xwall-01.jpg | Bin 0 -> 1267 bytes mapGen/bigmap.dg | 55 ---------------------- mapGen/chamber.xcf | Bin 777 -> 0 bytes mapGen/dg/Cfloor.png | Bin 0 -> 598 bytes mapGen/dg/Xbricks-01.png | Bin 0 -> 577 bytes mapGen/dg/Xbricks-02.png | Bin 0 -> 581 bytes mapGen/dg/Xbricks-03.png | Bin 0 -> 585 bytes mapGen/dg/ofloor-01a.png | Bin 0 -> 564 bytes mapGen/dg/ofloor-01b.png | Bin 0 -> 564 bytes mapGen/dg/ofloor-01c.png | Bin 0 -> 564 bytes mapGen/dg/ofloor-01d.png | Bin 0 -> 564 bytes mapGen/dg/ofloor-01e.png | Bin 0 -> 564 bytes mapGen/dg/ofloor-01f.png | Bin 0 -> 564 bytes mapGen/dg/ofloor-02.png | Bin 0 -> 567 bytes mapGen/dg/ofloor-03.png | Bin 0 -> 583 bytes mapGen/dg/ofloor-04.png | Bin 0 -> 594 bytes mapGen/dg/ofloor-05.png | Bin 0 -> 589 bytes mapGen/dg/ofloor-06.png | Bin 0 -> 577 bytes mapGen/door.xcf | Bin 804 -> 0 bytes mapGen/examples/cave.jpg | Bin 0 -> 15709 bytes mapGen/examples/caveBig.jpg | Bin 0 -> 53939 bytes mapGen/examples/map.dg | 5 ++ mapGen/examples/randomMap.dg | 26 +++++++++++ mapGen/examples/simple.jpg | Bin 0 -> 1145 bytes mapGen/examples/simpleBig.jpg | Bin 0 -> 3360 bytes mapGen/examples/tiledDungeon.jpg | Bin 0 -> 37348 bytes mapGen/examples/tiledDungeonBig.jpg | Bin 0 -> 123621 bytes mapGen/floor.xcf | Bin 723 -> 0 bytes mapGen/grass.xcf | Bin 801 -> 0 bytes mapGen/greenBlueRedOut.jpg | Bin 16272 -> 0 bytes mapGen/map.dg | 5 -- mapGen/mapGen.sh | 28 +++++++++++- mapGen/mapOut.jpg | Bin 263440 -> 0 bytes mapGen/out.jpg | Bin 15478 -> 0 bytes mapGen/passage.xcf | Bin 795 -> 0 bytes mapGen/randomMap.dg | 26 ----------- mapGen/secretDoor.xcf | Bin 801 -> 0 bytes mapGen/tiles/Cchamber.jpg | Bin 1278 -> 0 bytes mapGen/tiles/Ddoor.jpg | Bin 1282 -> 0 bytes mapGen/tiles/Ggrass.jpg | Bin 1275 -> 0 bytes mapGen/tiles/Ppassage.jpg | Bin 1286 -> 0 bytes mapGen/tiles/SsecretDoor.jpg | Bin 1280 -> 0 bytes mapGen/tiles/Xwall.jpg | Bin 1267 -> 0 bytes mapGen/tiles/ofloor.jpg | Bin 1263 -> 0 bytes mapGen/wall.xcf | Bin 768 -> 0 bytes 63 files changed, 146 insertions(+), 88 deletions(-) create mode 100644 mapGen/README.md create mode 100644 mapGen/bicolor/Cchamber.jpg create mode 100644 mapGen/bicolor/Ddoor.jpg create mode 100644 mapGen/bicolor/Ggrass.jpg create mode 100644 mapGen/bicolor/Ppassage.jpg create mode 100644 mapGen/bicolor/SsecretDoor.jpg create mode 100644 mapGen/bicolor/Xwall-01.jpg create mode 100644 mapGen/bicolor/Xwall-02.jpg create mode 100644 mapGen/bicolor/Xwall-03.jpg create mode 100644 mapGen/bicolor/Xwall-04.jpg create mode 100644 mapGen/bicolor/Xwall-05.jpg create mode 100644 mapGen/bicolor/Xwall-06.jpg create mode 100644 mapGen/bicolor/ofloor-01.jpg create mode 100644 mapGen/bicolor/ofloor-02.jpg create mode 100644 mapGen/bicolor/ofloor-03.jpg create mode 100644 mapGen/bicolor/ofloor-04.jpg create mode 100644 mapGen/bicolor/ofloor-05.jpg create mode 100644 mapGen/bicolor/ofloor-06.jpg create mode 100644 mapGen/bicolor/xwall-01.jpg delete mode 100644 mapGen/bigmap.dg delete mode 100644 mapGen/chamber.xcf create mode 100644 mapGen/dg/Cfloor.png create mode 100644 mapGen/dg/Xbricks-01.png create mode 100644 mapGen/dg/Xbricks-02.png create mode 100644 mapGen/dg/Xbricks-03.png create mode 100644 mapGen/dg/ofloor-01a.png create mode 100644 mapGen/dg/ofloor-01b.png create mode 100644 mapGen/dg/ofloor-01c.png create mode 100644 mapGen/dg/ofloor-01d.png create mode 100644 mapGen/dg/ofloor-01e.png create mode 100644 mapGen/dg/ofloor-01f.png create mode 100644 mapGen/dg/ofloor-02.png create mode 100644 mapGen/dg/ofloor-03.png create mode 100644 mapGen/dg/ofloor-04.png create mode 100644 mapGen/dg/ofloor-05.png create mode 100644 mapGen/dg/ofloor-06.png delete mode 100644 mapGen/door.xcf create mode 100644 mapGen/examples/cave.jpg create mode 100644 mapGen/examples/caveBig.jpg create mode 100644 mapGen/examples/map.dg create mode 100644 mapGen/examples/randomMap.dg create mode 100644 mapGen/examples/simple.jpg create mode 100644 mapGen/examples/simpleBig.jpg create mode 100644 mapGen/examples/tiledDungeon.jpg create mode 100644 mapGen/examples/tiledDungeonBig.jpg delete mode 100644 mapGen/floor.xcf delete mode 100644 mapGen/grass.xcf delete mode 100644 mapGen/greenBlueRedOut.jpg delete mode 100644 mapGen/map.dg delete mode 100644 mapGen/mapOut.jpg delete mode 100644 mapGen/out.jpg delete mode 100644 mapGen/passage.xcf delete mode 100644 mapGen/randomMap.dg delete mode 100644 mapGen/secretDoor.xcf delete mode 100644 mapGen/tiles/Cchamber.jpg delete mode 100644 mapGen/tiles/Ddoor.jpg delete mode 100644 mapGen/tiles/Ggrass.jpg delete mode 100644 mapGen/tiles/Ppassage.jpg delete mode 100644 mapGen/tiles/SsecretDoor.jpg delete mode 100644 mapGen/tiles/Xwall.jpg delete mode 100644 mapGen/tiles/ofloor.jpg delete mode 100644 mapGen/wall.xcf (limited to 'mapGen') 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. diff --git a/mapGen/bicolor/Cchamber.jpg b/mapGen/bicolor/Cchamber.jpg new file mode 100644 index 0000000..a325761 Binary files /dev/null and b/mapGen/bicolor/Cchamber.jpg differ diff --git a/mapGen/bicolor/Ddoor.jpg b/mapGen/bicolor/Ddoor.jpg new file mode 100644 index 0000000..167a16d Binary files /dev/null and b/mapGen/bicolor/Ddoor.jpg differ diff --git a/mapGen/bicolor/Ggrass.jpg b/mapGen/bicolor/Ggrass.jpg new file mode 100644 index 0000000..a3f79e6 Binary files /dev/null and b/mapGen/bicolor/Ggrass.jpg differ diff --git a/mapGen/bicolor/Ppassage.jpg b/mapGen/bicolor/Ppassage.jpg new file mode 100644 index 0000000..d21a0e9 Binary files /dev/null and b/mapGen/bicolor/Ppassage.jpg differ diff --git a/mapGen/bicolor/SsecretDoor.jpg b/mapGen/bicolor/SsecretDoor.jpg new file mode 100644 index 0000000..ee974fa Binary files /dev/null and b/mapGen/bicolor/SsecretDoor.jpg differ diff --git a/mapGen/bicolor/Xwall-01.jpg b/mapGen/bicolor/Xwall-01.jpg new file mode 100644 index 0000000..7d70085 Binary files /dev/null and b/mapGen/bicolor/Xwall-01.jpg differ diff --git a/mapGen/bicolor/Xwall-02.jpg b/mapGen/bicolor/Xwall-02.jpg new file mode 100644 index 0000000..e67903e Binary files /dev/null and b/mapGen/bicolor/Xwall-02.jpg differ diff --git a/mapGen/bicolor/Xwall-03.jpg b/mapGen/bicolor/Xwall-03.jpg new file mode 100644 index 0000000..2eefc61 Binary files /dev/null and b/mapGen/bicolor/Xwall-03.jpg differ diff --git a/mapGen/bicolor/Xwall-04.jpg b/mapGen/bicolor/Xwall-04.jpg new file mode 100644 index 0000000..816bba1 Binary files /dev/null and b/mapGen/bicolor/Xwall-04.jpg differ diff --git a/mapGen/bicolor/Xwall-05.jpg b/mapGen/bicolor/Xwall-05.jpg new file mode 100644 index 0000000..0c3f46f Binary files /dev/null and b/mapGen/bicolor/Xwall-05.jpg differ diff --git a/mapGen/bicolor/Xwall-06.jpg b/mapGen/bicolor/Xwall-06.jpg new file mode 100644 index 0000000..220b228 Binary files /dev/null and b/mapGen/bicolor/Xwall-06.jpg differ diff --git a/mapGen/bicolor/ofloor-01.jpg b/mapGen/bicolor/ofloor-01.jpg new file mode 100644 index 0000000..d79d794 Binary files /dev/null and b/mapGen/bicolor/ofloor-01.jpg differ diff --git a/mapGen/bicolor/ofloor-02.jpg b/mapGen/bicolor/ofloor-02.jpg new file mode 100644 index 0000000..18c8dc1 Binary files /dev/null and b/mapGen/bicolor/ofloor-02.jpg differ diff --git a/mapGen/bicolor/ofloor-03.jpg b/mapGen/bicolor/ofloor-03.jpg new file mode 100644 index 0000000..5fca9da Binary files /dev/null and b/mapGen/bicolor/ofloor-03.jpg differ diff --git a/mapGen/bicolor/ofloor-04.jpg b/mapGen/bicolor/ofloor-04.jpg new file mode 100644 index 0000000..2c5923b Binary files /dev/null and b/mapGen/bicolor/ofloor-04.jpg differ diff --git a/mapGen/bicolor/ofloor-05.jpg b/mapGen/bicolor/ofloor-05.jpg new file mode 100644 index 0000000..981a8be Binary files /dev/null and b/mapGen/bicolor/ofloor-05.jpg differ diff --git a/mapGen/bicolor/ofloor-06.jpg b/mapGen/bicolor/ofloor-06.jpg new file mode 100644 index 0000000..d463804 Binary files /dev/null and b/mapGen/bicolor/ofloor-06.jpg differ diff --git a/mapGen/bicolor/xwall-01.jpg b/mapGen/bicolor/xwall-01.jpg new file mode 100644 index 0000000..7d70085 Binary files /dev/null and b/mapGen/bicolor/xwall-01.jpg differ diff --git a/mapGen/bigmap.dg b/mapGen/bigmap.dg deleted file mode 100644 index 26f5289..0000000 --- a/mapGen/bigmap.dg +++ /dev/null @@ -1,55 +0,0 @@ -xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx- -xGGxxxGGxxxGGxxxGGxxxGGxxxGGxxxGGxxxGGxxxGGxxxGGxxxGGxxxGGxxxGGxxxGGxxxGGxx -xxGGGxxGGGxxGGGxxGGGxxGGGxxGGGxxGGGxxGGGxxGGGxxGGGxxGGGxxGGGxxGGGxxGGGxxGGG --xGGx-xGGx-xGGx-xGGx-xGGx-xGGx-xGGx-xGGx-xGGx-xGGx-xGGx-xGGx-xGGx-xGGx-xGGx --xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx -xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx- -xGGxxxGGxxxGGxxxGGxxxGGxxxGGxxxGGxxxGGxxxGG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xxGGGxxGGGxxGGGxxGGGxxGGGxxGGGxxGGGxxGGGxxGGGxxGGGxxGGGxxGGG --xGGx-xGGx-xGGx-xGGx-xGGx-xGGx-xGGx-xGGx-xGGx-xGGx-xGGx-xGGx-xGGx-xGGx-xGGx --xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx -xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx- -xGGxxxGGxxxGGxxxGGxxxGGxxxGGxxxGGxxxGGxxxGGxxxGGxxxGGxxxGGxxxGGxxxGGxxxGGxx -xxGGGxxGGGxxGGGxxGGGxxGGGxxGGGxxGGGxxGGGxxGGGxxGGGxxGGGxxGGGxxGGGxxGGGxxGGG --xGGx-xGGx-xGGx-xGGx-xGGx-xGGx-xGGx-xGGx-xGGx-xGGx-xGGx-xGGx-xGGx-xGGx-xGGx --xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx diff --git a/mapGen/chamber.xcf b/mapGen/chamber.xcf deleted file mode 100644 index 2198b9b..0000000 Binary files a/mapGen/chamber.xcf and /dev/null differ diff --git a/mapGen/dg/Cfloor.png b/mapGen/dg/Cfloor.png new file mode 100644 index 0000000..8e1d600 Binary files /dev/null and b/mapGen/dg/Cfloor.png differ diff --git a/mapGen/dg/Xbricks-01.png b/mapGen/dg/Xbricks-01.png new file mode 100644 index 0000000..32faade Binary files /dev/null and b/mapGen/dg/Xbricks-01.png differ diff --git a/mapGen/dg/Xbricks-02.png b/mapGen/dg/Xbricks-02.png new file mode 100644 index 0000000..6918a89 Binary files /dev/null and b/mapGen/dg/Xbricks-02.png differ diff --git a/mapGen/dg/Xbricks-03.png b/mapGen/dg/Xbricks-03.png new file mode 100644 index 0000000..ae258be Binary files /dev/null and b/mapGen/dg/Xbricks-03.png differ diff --git a/mapGen/dg/ofloor-01a.png b/mapGen/dg/ofloor-01a.png new file mode 100644 index 0000000..b6b44f4 Binary files /dev/null and b/mapGen/dg/ofloor-01a.png differ diff --git a/mapGen/dg/ofloor-01b.png b/mapGen/dg/ofloor-01b.png new file mode 100644 index 0000000..b6b44f4 Binary files /dev/null and b/mapGen/dg/ofloor-01b.png differ diff --git a/mapGen/dg/ofloor-01c.png b/mapGen/dg/ofloor-01c.png new file mode 100644 index 0000000..b6b44f4 Binary files /dev/null and b/mapGen/dg/ofloor-01c.png differ diff --git a/mapGen/dg/ofloor-01d.png b/mapGen/dg/ofloor-01d.png new file mode 100644 index 0000000..b6b44f4 Binary files /dev/null and b/mapGen/dg/ofloor-01d.png differ diff --git a/mapGen/dg/ofloor-01e.png b/mapGen/dg/ofloor-01e.png new file mode 100644 index 0000000..b6b44f4 Binary files /dev/null and b/mapGen/dg/ofloor-01e.png differ diff --git a/mapGen/dg/ofloor-01f.png b/mapGen/dg/ofloor-01f.png new file mode 100644 index 0000000..b6b44f4 Binary files /dev/null and b/mapGen/dg/ofloor-01f.png differ diff --git a/mapGen/dg/ofloor-02.png b/mapGen/dg/ofloor-02.png new file mode 100644 index 0000000..74f153a Binary files /dev/null and b/mapGen/dg/ofloor-02.png differ diff --git a/mapGen/dg/ofloor-03.png b/mapGen/dg/ofloor-03.png new file mode 100644 index 0000000..c513efb Binary files /dev/null and b/mapGen/dg/ofloor-03.png differ diff --git a/mapGen/dg/ofloor-04.png b/mapGen/dg/ofloor-04.png new file mode 100644 index 0000000..c1303b4 Binary files /dev/null and b/mapGen/dg/ofloor-04.png differ diff --git a/mapGen/dg/ofloor-05.png b/mapGen/dg/ofloor-05.png new file mode 100644 index 0000000..0af94be Binary files /dev/null and b/mapGen/dg/ofloor-05.png differ diff --git a/mapGen/dg/ofloor-06.png b/mapGen/dg/ofloor-06.png new file mode 100644 index 0000000..13b36d1 Binary files /dev/null and b/mapGen/dg/ofloor-06.png differ diff --git a/mapGen/door.xcf b/mapGen/door.xcf deleted file mode 100644 index fa1cc1a..0000000 Binary files a/mapGen/door.xcf and /dev/null differ diff --git a/mapGen/examples/cave.jpg b/mapGen/examples/cave.jpg new file mode 100644 index 0000000..727366e Binary files /dev/null and b/mapGen/examples/cave.jpg differ diff --git a/mapGen/examples/caveBig.jpg b/mapGen/examples/caveBig.jpg new file mode 100644 index 0000000..802c975 Binary files /dev/null and b/mapGen/examples/caveBig.jpg differ diff --git a/mapGen/examples/map.dg b/mapGen/examples/map.dg new file mode 100644 index 0000000..54e3ba8 --- /dev/null +++ b/mapGen/examples/map.dg @@ -0,0 +1,5 @@ +xxxxx +xGGxx +xxooG +xxGox +xxxxx diff --git a/mapGen/examples/randomMap.dg b/mapGen/examples/randomMap.dg new file mode 100644 index 0000000..2ead560 --- /dev/null +++ b/mapGen/examples/randomMap.dg @@ -0,0 +1,26 @@ +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 diff --git a/mapGen/examples/simple.jpg b/mapGen/examples/simple.jpg new file mode 100644 index 0000000..1f616ad Binary files /dev/null and b/mapGen/examples/simple.jpg differ diff --git a/mapGen/examples/simpleBig.jpg b/mapGen/examples/simpleBig.jpg new file mode 100644 index 0000000..2b58279 Binary files /dev/null and b/mapGen/examples/simpleBig.jpg differ diff --git a/mapGen/examples/tiledDungeon.jpg b/mapGen/examples/tiledDungeon.jpg new file mode 100644 index 0000000..141371a Binary files /dev/null and b/mapGen/examples/tiledDungeon.jpg differ diff --git a/mapGen/examples/tiledDungeonBig.jpg b/mapGen/examples/tiledDungeonBig.jpg new file mode 100644 index 0000000..b017888 Binary files /dev/null and b/mapGen/examples/tiledDungeonBig.jpg differ diff --git a/mapGen/floor.xcf b/mapGen/floor.xcf deleted file mode 100644 index a83e4c2..0000000 Binary files a/mapGen/floor.xcf and /dev/null differ diff --git a/mapGen/grass.xcf b/mapGen/grass.xcf deleted file mode 100644 index 3b11c90..0000000 Binary files a/mapGen/grass.xcf and /dev/null differ diff --git a/mapGen/greenBlueRedOut.jpg b/mapGen/greenBlueRedOut.jpg deleted file mode 100644 index 7448cc8..0000000 Binary files a/mapGen/greenBlueRedOut.jpg and /dev/null differ diff --git a/mapGen/map.dg b/mapGen/map.dg deleted file mode 100644 index 7da4706..0000000 --- a/mapGen/map.dg +++ /dev/null @@ -1,5 +0,0 @@ -xxxxx -xGGxx -xxaaG -xxGax -xxxxx diff --git a/mapGen/mapGen.sh b/mapGen/mapGen.sh index 1be77f7..bf4bac3 100755 --- a/mapGen/mapGen.sh +++ b/mapGen/mapGen.sh @@ -3,13 +3,37 @@ # mapGen.sh # # Generate a map with ImageMagick from an input text file +# +# Usage: mapGen.sh [-s SIZE] [-f TILE_FOLDER] SOURCE_FILE -inputFile="$1" +usageMsg="Usage: mapGen.sh [-s SIZE] [-f TILE_FOLDER] SOURCE_FILE" cellSize=8 tilesDir="./tiles" +while echo "$1" | grep '^-' >/dev/null; do + case "$1" in + "-s") + [ -z "$2" ] && echo "Missing argument for -s. $usageMsg" >&2 && exit 1 + cellSize="$2" + shift 2 + ;; + "-f") + [ -z "$2" ] && echo "Missing argument for -f. $usageMsg" >&2 && exit 1 + tilesDir="$2" + shift 2 + ;; + esac +done + +[ -z "$1" ] && echo "$usageMsg" >&2 && exit 1 + +inputFile="$1" + +[ ! -f "$inputFile" ] && echo "File not found: $inputFile" >&2 && exit 1 +[ ! -d "$tilesDir" ] && echo "Directory not found: $tilesDir" >&2 && exit 1 + height="$(wc -l <"$inputFile")" width="$(awk '{print length($0)}' "$inputFile" | sort -nr | sed 1q)" @@ -26,7 +50,7 @@ col=0 while read line; do echo "$line" | ( while read -n1 char; do - tileFile="$(find $tilesDir | sed 's|.*/||' | grep "^$char")" + tileFile="$(find $tilesDir | sed 's|.*/||' | grep "^$char" | shuf | sed 1q)" tileFile="${tilesDir}/${tileFile}" echo "$tileFile" | wc -l | grep 1 >/dev/null || continue convert out.jpg "$tileFile" -geometry +"$col"+"$row" -composite out.jpg || diff --git a/mapGen/mapOut.jpg b/mapGen/mapOut.jpg deleted file mode 100644 index 7067c52..0000000 Binary files a/mapGen/mapOut.jpg and /dev/null differ diff --git a/mapGen/out.jpg b/mapGen/out.jpg deleted file mode 100644 index d4a3964..0000000 Binary files a/mapGen/out.jpg and /dev/null differ diff --git a/mapGen/passage.xcf b/mapGen/passage.xcf deleted file mode 100644 index 926783a..0000000 Binary files a/mapGen/passage.xcf and /dev/null differ diff --git a/mapGen/randomMap.dg b/mapGen/randomMap.dg deleted file mode 100644 index 2ead560..0000000 --- a/mapGen/randomMap.dg +++ /dev/null @@ -1,26 +0,0 @@ -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 diff --git a/mapGen/secretDoor.xcf b/mapGen/secretDoor.xcf deleted file mode 100644 index 6963426..0000000 Binary files a/mapGen/secretDoor.xcf and /dev/null differ diff --git a/mapGen/tiles/Cchamber.jpg b/mapGen/tiles/Cchamber.jpg deleted file mode 100644 index a325761..0000000 Binary files a/mapGen/tiles/Cchamber.jpg and /dev/null differ diff --git a/mapGen/tiles/Ddoor.jpg b/mapGen/tiles/Ddoor.jpg deleted file mode 100644 index 167a16d..0000000 Binary files a/mapGen/tiles/Ddoor.jpg and /dev/null differ diff --git a/mapGen/tiles/Ggrass.jpg b/mapGen/tiles/Ggrass.jpg deleted file mode 100644 index a3f79e6..0000000 Binary files a/mapGen/tiles/Ggrass.jpg and /dev/null differ diff --git a/mapGen/tiles/Ppassage.jpg b/mapGen/tiles/Ppassage.jpg deleted file mode 100644 index d21a0e9..0000000 Binary files a/mapGen/tiles/Ppassage.jpg and /dev/null differ diff --git a/mapGen/tiles/SsecretDoor.jpg b/mapGen/tiles/SsecretDoor.jpg deleted file mode 100644 index ee974fa..0000000 Binary files a/mapGen/tiles/SsecretDoor.jpg and /dev/null differ diff --git a/mapGen/tiles/Xwall.jpg b/mapGen/tiles/Xwall.jpg deleted file mode 100644 index 7d70085..0000000 Binary files a/mapGen/tiles/Xwall.jpg and /dev/null differ diff --git a/mapGen/tiles/ofloor.jpg b/mapGen/tiles/ofloor.jpg deleted file mode 100644 index d79d794..0000000 Binary files a/mapGen/tiles/ofloor.jpg and /dev/null differ diff --git a/mapGen/wall.xcf b/mapGen/wall.xcf deleted file mode 100644 index e1cc359..0000000 Binary files a/mapGen/wall.xcf and /dev/null differ -- cgit v1.2.1