MapRenderer: Difference between revisions
Appearance
mNo edit summary |
No edit summary |
||
| (34 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
[[Image: | {{notice|Latest experimental build (with 0.900+ features) can be downloaded here: '''[http://fCraft.net/download/fCraft_MapUtils_0900_r2344.zip fCraft_MapUtils_0900_r2344.zip]''' | ||
MapRenderer is a utility, bundled with fCraft 0.630+, that can render images from map files. | This is a portable build, and can be used without fCraft.dll and fCraftGUI.dll}} | ||
[[Image:MapRenderer-Usage.png|thumb|500px|right|MapRenderer usage]] | |||
MapRenderer is a utility, bundled with fCraft {{Changelog|0.630}}+, that can render images from map files. MapRenderer.exe requires <code>fCraft.dll</code> and <code>fCraftGUI.dll</code> to function. | |||
Since fCraft {{Changelog|0.640}}, MapRenderer is multi-threaded. See [[MapRenderer#-t.3D.2C_--threads.3DVALUE|<code>--threads</code> parameter documentation]] for details. | |||
==Usage== | ==Usage== | ||
:<code>MapRenderer [options] " | :'''<code>MapRenderer [options] "MapFile1" "MapFile2" "MapFile3..."</code>''' | ||
:'''<code>MapRenderer [options] "Directory"</code>''' | |||
==Examples== | ==Examples== | ||
===Rendering a single map=== | ===Rendering a single map=== | ||
:<code>MapRenderer "SomeMap.fcm"</code> | :'''<code>MapRenderer "SomeMap.fcm"</code>''' | ||
:Draws contents of SomeMap.fcm with all default parameters, | :Draws contents of SomeMap.fcm with all default parameters, producing "SomeMap.png" | ||
===Rendering multiple maps=== | |||
:'''<code>MapRenderer "Map1.fcm" "Map2.fcm" "someDir/MapX.fcm"</code>''' | |||
:Draws contents of all given maps with default parameters, producing "Map1.png", "Map2.png", and "someDir/MapX.png" | |||
===Batch rendering=== | ===Batch rendering=== | ||
:<code>MapRenderer -r "maps/"</code> | :'''<code>MapRenderer -r "maps/"</code>''' | ||
:Finds all map files in "C:/maps", including files in subdirectories, and renders them with default settings. Images are saved into each map's respective directory. Image filenames are based on mapfile names, with file extension change to ".png" | :Finds all map files in "C:/maps", including files in subdirectories, and renders them with default settings. Images are saved into each map's respective directory. Image filenames are based on mapfile names, with file extension change to ".png" | ||
===Moving out rendered images=== | ===Moving out rendered images=== | ||
:<code>MapRenderer -r -o "images/" "maps/"</code> | :'''<code>MapRenderer -r -o="images/" "maps/"</code>''' | ||
:Same as above, but all images are placed into "images/" directory. | :Same as above, but all images are placed into "images/" directory. | ||
===Filtering=== | ===Filtering=== | ||
:<code>MapRenderer -f=builder* "maps/"</code> | :'''<code>MapRenderer -f=builder* "maps/"</code>''' | ||
:Looks for mapfile names that start with "builder", draws them with default settings. | :Looks for mapfile names that start with "builder", draws them with default settings. | ||
===Rendering options=== | ===Rendering options=== | ||
:<code>MapRenderer --noshadows -q=90 e=JPEG "SomeMap.fcm"</code> | :'''<code>MapRenderer --noshadows -q=90 e=JPEG "SomeMap.fcm"</code>''' | ||
:Draws contents of SomeMap.fcm, without shadows, and saves results to SomeMap.jpg at 90% quality. | :Draws contents of SomeMap.fcm, without shadows, and saves results to SomeMap.jpg at 90% quality. | ||
==Options== | ==Options== | ||
{{notice|Options have alternative short (one-letter) and a long (whole word) forms. You can use either form: '''<code>-a{{=}}90</code>''' is same as '''<code>--angle{{=}}90</code>'''}} | {{notice|Options have alternative short (one-letter) and a long (whole word) forms. You can use either form: '''<code>-a{{=}}90</code>''' is same as '''<code>--angle{{=}}90</code>''' | ||
One-letter flags can be combined: '''<code>-gswl</code>''' is same as '''<code>-g -s -w -l</code>'''}} | |||
===<code>-a=, --angle=DEGREES</code>=== | |||
:Optional: Angle (orientation) from which the map is drawn. May be -90, 0, 90, 180, or 270. Default is 0. | |||
===<code>-e=, --export=FORMAT</code>=== | |||
:Optional: Image format to use for exporting. Supported formats: PNG (default), BMP, GIF, JPEG, TIFF. | |||
===<code>- | ===<code>-f=, --filter=PATTERN</code>=== | ||
: | :Optional: Pattern to filter input filenames, e.g. <code>*.dat</code> or <code>builder*</code>. Applicable only when a directory name is given as input. [http://msdn.microsoft.com/en-us/library/hs600312%28v=vs.100%29.aspx Regular expressions] can be used in the filter if <code>-x</code> / <code>--regex</code> flag is given. | ||
===<code>- | ===<code>-g, --nogradient</code>=== | ||
:Optional: | :Optional: Disables altitude-based gradient/shading on terrain. | ||
===<code>-i, --importer=FORMAT</code>=== | ===<code>-i=, --importer=FORMAT</code>=== | ||
:Optional: Converter used for importing/loading maps. Available formats: | :Optional: Converter used for importing/loading maps. Available formats: | ||
:*'''Auto''' - default; tries to determine file type automatically | :*'''Auto''' - default; tries to determine file type automatically | ||
:*'''Classic''' (.dat or .mine) - Minecraft Classic and SurvivalTest maps | :*'''Classic''' (.dat or .mine) - Minecraft Classic and SurvivalTest maps | ||
:*'''ClassicWorld''' (.cw) - used by ClassiCube and fCraft 0.900+ (<i>new in 0.900</i>) | |||
:*'''D3''' (.map) | :*'''D3''' (.map) | ||
:*'''D3Folder''' (folder) - used by newer versions of D3 server (<i>new in 0.900</i>) | |||
:*'''FCMv2''' (.fcm) - used by fCraft prior to version 0.500 | :*'''FCMv2''' (.fcm) - used by fCraft prior to version 0.500 | ||
:*'''FCMv3''' (.fcm) - used in fCraft 0.500-0. | :*'''FCMv3''' (.fcm) - used in fCraft 0.500-0.64x | ||
:*'''Indev''' (.mclevel) - from Minecraft Indev maps | :*'''Indev''' (.mclevel) - from Minecraft Indev maps | ||
:*'''JTE''' (.gz) | :*'''JTE''' (.gz) | ||
| Line 50: | Line 67: | ||
:*'''Opticraft''' (.save) | :*'''Opticraft''' (.save) | ||
===<code>- | ===<code>-l, --seethroughlava</code>=== | ||
: | :Optional: Makes all lava partially see-through, instead of opaque. | ||
===<code>-m, --mode=MODE</code>=== | ===<code>-m=, --mode=MODE</code>=== | ||
:Rendering mode. May be "normal" (default), "cut" (cuts out a quarter of the map, revealing inside), "peeled" (strips the outer-most layer of blocks), "chunk" (renders only a specified region of the map). | :Optional: Rendering mode. May be "normal" (default), "cut" (cuts out a quarter of the map, revealing inside), "peeled" (strips the outer-most layer of blocks), "chunk" (renders only a specified region of the map). | ||
===<code>- | ===<code>-o=, --output=PATH</code>=== | ||
:Optional: Path to save images to. If not specified, images will be saved to the maps' directory. | :Optional: Path to save images to. If not specified, images will be saved to the maps' directory. | ||
===<code>- | ===<code>-q=, --quality=PERCENTAGE</code>=== | ||
:Optional: Sets JPEG compression quality. Between 0 and 100. Default is 80. Applicable only when exporting images to .jpg or .jpeg. | |||
:Sets JPEG compression quality. Between 0 and 100. Default is 80. Applicable only when exporting images to .jpg or .jpeg. | |||
===<code>-r, --recursive</code>=== | ===<code>-r, --recursive</code>=== | ||
| Line 75: | Line 83: | ||
===<code>--region=x1,y1,z1,x2,y2,z2</code>=== | ===<code>--region=x1,y1,z1,x2,y2,z2</code>=== | ||
:Region of the map to render. Should be given in following format: "region=x1,y1,z1,x2,y2,z2". By fCraft's conventions, x/y are horizontal coordinates (width/length), and z is the vertical coordinate (height). Applicable only when rendering mode is set to "chunk". | :Optional: Region of the map to render. Should be given in following format: "region=x1,y1,z1,x2,y2,z2". By fCraft's conventions, x/y are horizontal coordinates (width/length), and z is the vertical coordinate (height). Applicable only when rendering mode is set to "chunk". | ||
===<code>-s, --noshadows</code>=== | |||
:Optional: Disables rendering of shadows. | |||
===<code>-t=, --threads=NUMBER</code>=== | |||
:Optional: Number of threads to use, to render multiple files in parallel. Default is same as your CPU count (e.g. 2 threads on a dual-core CPU, 4 threads on quad-core, etc). | |||
===<code>--tryhard</code>=== | |||
:Optional: Try ALL the map converters on files that MapRenderer has trouble loading. When enabled, ALL map converters are tried, including ones that do not typically handle files with the given file extension. BY default (without this flag), MapRenderer will only try converters that typically accept files with the given file extension. | |||
===<code>-u, --uncropped</code>=== | |||
:Optional: Does not crop the finished map image, leaving some empty space around the edges. | |||
===<code>-w, --seethroughwater</code>=== | ===<code>-w, --seethroughwater</code>=== | ||
:Makes all water see-through, instead of mostly opaque. | :Optional: Makes all water see-through, instead of mostly opaque. | ||
===<code>- | ===<code>-x, --regex</code>=== | ||
: | :Optional: Enable [http://msdn.microsoft.com/en-us/library/hs600312%28v=vs.100%29.aspx regular expressions] in [[MapRenderer#-f.3D.2C_--filter.3DPATTERN|<code>--filter</code> parameter]]. | ||
===<code>- | ===<code>-y, --overwrite=MODE</code>=== | ||
: | :Optional: When to overwrite existing image files: | ||
:*'''Ask''' - default; asks the user for every image. | |||
:*'''Always''' - Always overwrite old files. | |||
:*'''IfNewer''' - Overwrite if image file is older than the map file. | |||
:*'''Never''' - Skip any already-existing image files. | |||
===<code>-?, -h, --help</code>=== | ===<code>-?, -h, --help</code>=== | ||
:Prints usage information and a list of options. | :Prints usage information and a list of options. | ||
==MapRenderer.exe exit codes== | |||
:MapRenderer uses a subset of [[MapConverter]]'s exit codes: | |||
{|class="wikitable" | |||
!Code | |||
!Meaning | |||
!Notes | |||
|- | |||
|0 | |||
|Success | |||
| | |||
|- | |||
|1 | |||
|ArgumentError | |||
|Required command-line arguments were missing, or an error occurred while trying to parse options. | |||
|- | |||
|2 | |||
|UnrecognizedImporter | |||
|Given importer name was not recognized. | |||
|- | |||
|4 | |||
|InputPathNotFound | |||
|Given file/directory name does not exist. | |||
|- | |||
|5 | |||
|PathError | |||
|Error occurred while trying to check input directory, or error occurred while trying to check/create output directory. | |||
|- | |||
|6 | |||
|UnsupportedLoadFormat | |||
|Given map format name ("importer") was recognized, but loading from it is not supported. | |||
|- | |||
|7 | |||
|UnsupportedSaveFormat | |||
|Given image format name ("export") was recognized, but saving to it is not supported. | |||
|} | |||
==History== | |||
MapRenderer is powered by a library named '''IsoCat''' (now part of fCraft), loosely influenced by [http://www.minecraftforum.net/topic/3218-isocraft/ IsoCraft]. | |||
[[File:IsoCatLogo.png|500px]] | |||
{{LastUpdated|1650}} | |||
[[Category:Tools]] | |||
Latest revision as of 03:08, 28 September 2014
| Latest experimental build (with 0.900+ features) can be downloaded here: fCraft_MapUtils_0900_r2344.zip
This is a portable build, and can be used without fCraft.dll and fCraftGUI.dll |

MapRenderer is a utility, bundled with fCraft 0.630+, that can render images from map files. MapRenderer.exe requires fCraft.dll and fCraftGUI.dll to function.
Since fCraft 0.640, MapRenderer is multi-threaded. See --threads parameter documentation for details.
Usage
MapRenderer [options] "MapFile1" "MapFile2" "MapFile3..."MapRenderer [options] "Directory"
Examples
Rendering a single map
MapRenderer "SomeMap.fcm"- Draws contents of SomeMap.fcm with all default parameters, producing "SomeMap.png"
Rendering multiple maps
MapRenderer "Map1.fcm" "Map2.fcm" "someDir/MapX.fcm"- Draws contents of all given maps with default parameters, producing "Map1.png", "Map2.png", and "someDir/MapX.png"
Batch rendering
MapRenderer -r "maps/"- Finds all map files in "C:/maps", including files in subdirectories, and renders them with default settings. Images are saved into each map's respective directory. Image filenames are based on mapfile names, with file extension change to ".png"
Moving out rendered images
MapRenderer -r -o="images/" "maps/"- Same as above, but all images are placed into "images/" directory.
Filtering
MapRenderer -f=builder* "maps/"- Looks for mapfile names that start with "builder", draws them with default settings.
Rendering options
MapRenderer --noshadows -q=90 e=JPEG "SomeMap.fcm"- Draws contents of SomeMap.fcm, without shadows, and saves results to SomeMap.jpg at 90% quality.
Options
Options have alternative short (one-letter) and a long (whole word) forms. You can use either form: -a=90 is same as --angle=90
One-letter flags can be combined: |
-a=, --angle=DEGREES
- Optional: Angle (orientation) from which the map is drawn. May be -90, 0, 90, 180, or 270. Default is 0.
-e=, --export=FORMAT
- Optional: Image format to use for exporting. Supported formats: PNG (default), BMP, GIF, JPEG, TIFF.
-f=, --filter=PATTERN
- Optional: Pattern to filter input filenames, e.g.
*.datorbuilder*. Applicable only when a directory name is given as input. Regular expressions can be used in the filter if-x/--regexflag is given.
-g, --nogradient
- Optional: Disables altitude-based gradient/shading on terrain.
-i=, --importer=FORMAT
- Optional: Converter used for importing/loading maps. Available formats:
- Auto - default; tries to determine file type automatically
- Classic (.dat or .mine) - Minecraft Classic and SurvivalTest maps
- ClassicWorld (.cw) - used by ClassiCube and fCraft 0.900+ (new in 0.900)
- D3 (.map)
- D3Folder (folder) - used by newer versions of D3 server (new in 0.900)
- FCMv2 (.fcm) - used by fCraft prior to version 0.500
- FCMv3 (.fcm) - used in fCraft 0.500-0.64x
- Indev (.mclevel) - from Minecraft Indev maps
- JTE (.gz)
- MCSharp (.lvl) - MCSharp, FemtoCraft, MCZall, MCLawl, MCForge, etc
- MinerCPP (.dat) - MinerCPP and LuaCraft
- Myne (directory-based) - Myne, MyneCraft, Hyvebuild, and iCraft
- Opticraft (.save)
-l, --seethroughlava
- Optional: Makes all lava partially see-through, instead of opaque.
-m=, --mode=MODE
- Optional: Rendering mode. May be "normal" (default), "cut" (cuts out a quarter of the map, revealing inside), "peeled" (strips the outer-most layer of blocks), "chunk" (renders only a specified region of the map).
-o=, --output=PATH
- Optional: Path to save images to. If not specified, images will be saved to the maps' directory.
-q=, --quality=PERCENTAGE
- Optional: Sets JPEG compression quality. Between 0 and 100. Default is 80. Applicable only when exporting images to .jpg or .jpeg.
-r, --recursive
- Optional: Look through all subdirectories for map files. Applicable only when a directory name is given as input.
--region=x1,y1,z1,x2,y2,z2
- Optional: Region of the map to render. Should be given in following format: "region=x1,y1,z1,x2,y2,z2". By fCraft's conventions, x/y are horizontal coordinates (width/length), and z is the vertical coordinate (height). Applicable only when rendering mode is set to "chunk".
-s, --noshadows
- Optional: Disables rendering of shadows.
-t=, --threads=NUMBER
- Optional: Number of threads to use, to render multiple files in parallel. Default is same as your CPU count (e.g. 2 threads on a dual-core CPU, 4 threads on quad-core, etc).
--tryhard
- Optional: Try ALL the map converters on files that MapRenderer has trouble loading. When enabled, ALL map converters are tried, including ones that do not typically handle files with the given file extension. BY default (without this flag), MapRenderer will only try converters that typically accept files with the given file extension.
-u, --uncropped
- Optional: Does not crop the finished map image, leaving some empty space around the edges.
-w, --seethroughwater
- Optional: Makes all water see-through, instead of mostly opaque.
-x, --regex
- Optional: Enable regular expressions in
--filterparameter.
-y, --overwrite=MODE
- Optional: When to overwrite existing image files:
- Ask - default; asks the user for every image.
- Always - Always overwrite old files.
- IfNewer - Overwrite if image file is older than the map file.
- Never - Skip any already-existing image files.
-?, -h, --help
- Prints usage information and a list of options.
MapRenderer.exe exit codes
- MapRenderer uses a subset of MapConverter's exit codes:
| Code | Meaning | Notes |
|---|---|---|
| 0 | Success | |
| 1 | ArgumentError | Required command-line arguments were missing, or an error occurred while trying to parse options. |
| 2 | UnrecognizedImporter | Given importer name was not recognized. |
| 4 | InputPathNotFound | Given file/directory name does not exist. |
| 5 | PathError | Error occurred while trying to check input directory, or error occurred while trying to check/create output directory. |
| 6 | UnsupportedLoadFormat | Given map format name ("importer") was recognized, but loading from it is not supported. |
| 7 | UnsupportedSaveFormat | Given image format name ("export") was recognized, but saving to it is not supported. |
History
MapRenderer is powered by a library named IsoCat (now part of fCraft), loosely influenced by IsoCraft.