OP2 Map Imager is a Windows Console application that can render any Outpost 2 map in popular image formats and variable size. Programmed by me and Hooman in C++.
Directions
- Download and unzip.
- Recommend placing OP2MapImager and associated files in the root install directory of Outpost 2 to ease working with relative paths, but it should work from any directory.
- Open the command prompt, navigate to the folder containing OP2MapImager.exe, and type “OP2MapImager -h” to get the usage message.
- Use the Mission Scanner (http://wiki.outpost2.net/doku.php?id=outpost_2:helper_programs:mission_scanner) to find the filename of your favorite maps.
- Renders will default to a relative directory from the executable of \MapRenders and have a scale factor of 4.
Current Release: 2.1.0
Download Current Release https://github.com/OutpostUniverse/OP2MapImager/releases/
Possible Future Improvements:
- Ability to parse native OP2 BMP tile sets.
- Find an image manipulation library that has a license closer to the MIT license.
If you have any comments, bugs concerns, suggestions, whatever else, please post or message me or Hooman.
(https://forum.outpost2.net/index.php?action=dlattach;topic=5980.0;attach=842;image)
Readme
OP2MapImager - Outpost 2 Map and Saved Game Imager
Developed by Hooman and Brett208 (Vagabond)
Check the OP2MapImager landing page for the newest version at https://wiki.outpost2.net/doku.php?id=outpost_2:helper_programs:op2mapimager.
+++ USAGE NOTES +++
* Capable of saving multiple map files and entire directories.
* The OP2MapImager executable and FreeImage.dll must be in the same directory as the tileset BMPs.
* Scale Factor (-s) determines the final render size and represents the final pixel length of a single tile
* Max Value: 32, renders at full size, or 32 pixels per tile.
* Min Value: 1, renders at 1 pixel per tile
+++ EXAMPLE COMMANDS +++
* OP2MapImager mapFilename.[map|OP2]
* OP2MapImager -s 16 -o -q Ashes.map eden01.map sgame0.op2
* OP2MapImager --Scale 8 --ImageFormat BMP [Directory of choice]
+++ OPTIONAL ARGUMENTS +++
-H / --Help: Displays Help File
-Q / --Quiet: [Default false] Add switch to run application without issuing console messages.
-O / --Overwrite: [Default false] Add switch to allow application to overwrite existing files.
-D / --DestinationDirectory: [Default MapRenders]. Add switch and name of new destination path.
-I / --ImageFormat: [Default PNG]. Allows PNG|JPG|BMP. Sets the image format of the final render.
-S / --Scale: [Default 4] Sets Scale Factor of image.
-A / --AccessArchives [Default true]. Add switch to disable searching VOL archives for map and well files.
For more information about Outpost 2 visit the Outpost Universe (http://outpost2.net/).
Image Manipulation accomplished through FreeImage (http://freeimage.sourceforge.net/).
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+++ INSTALL DIRECTIONS +++
Ensure OP2MapImager.exe and FreeImage.dll are in the same directory. They can be placed in the root OP2 install directory for ease of install and use. Advanced users may want to establish an environment variable to allow application's use in any directory.
Open a command prompt. Navigate to the directory with OP2MapImager.exe and type 'OP2MapImager -h' to see Usage Message.
+++ OUTPOST 2 TILESETS (WELL00XX.BMP) +++
The original tileset images (Wells) shipped with Outpost 2 use a special format that prevents them from being opened by typical pixel image manipulation software (like Gimp or Paint). If you attempt to render a map using the original Outpost 2 tileset images, OP2MapImager will throw an error. The current released version of Outpost 2 contains normally formatted tilesets and will not cause issues with OP2MapImager.
The tilesets (wells) must exist in the same directory as the map(s) chosen to render. The map and the tilesets may remain archived in their volume files for rendering as OP2MapImager is able to access volume files. OP2MapImager will first search for files loosely in the directory and then in the volume files alphabetically if the file does not exist loosely. Archive search may be disabled using the AccessArchives flag.
+++ SOURCE CODE LOCATION AND COMPILIATION +++
Source code may be found at: https://github.com/OutpostUniverse/OP2MapImager. See the file DeveloperReadMe.txt in the source code for specific instructions.
+++ Change Log +++
Ver 2.1.0
* Remove Windows specific dependencies from code base (may now be compiled for use on Linux).
* Allow compiling on both x86 (win32) and x64.
* Allow accessing tilesets (wells) without removing them from archive files.
* Bug Fix: Multiple directory search problems preventing OP2MapImager from finding tilesets or maps.
* Bug Fix: Program crash when unable to find map file.
Ver 2.0.1 (07Nov2017)
* Fixed security concern when outputting error messages from FreeImage.
* Fixed bug not allowing rendering of loose maps in current working directory.
* Reordered change log to be newest version first.
* Added PDB file zipping to post build event script.
Ver 2.0.0 (12Oct2017)
* Fixed crash if supplying an empty variable ("") for a command via the command prompt.
* Changed method to provide current directory to use either '.' or './' instead of '/' or '\'.
* Made the function XFile::replaceFilename platform agnostic.
* Fixed typos in ReadMe.txt.
* Removed namespace using statements from header files.
* Removed Microsoft specific exception classes.
* Removed Microsoft specific for each loops and replaced with C++ standard range loops.
* Fixed crashing bug when attempting to render a map outside of the application's current working directory.
Ver 1.0.1 (23Jul2017)
* Prevented creation of multiple renders of the same map if the map exists in multiple places in the same directory (IE both loosely in directory and in an archive).
* When imaging all maps & saved games in a directory, prevented selection of wellpallet.map and SGAME10.OP2 since they are not valid maps.
* Fixed typos in ReadMe.
* Added Changelog.
Ver 1.0.0 (22Jul2017)
* Initial Release
Hmm, I've got some good news and some bad news.
First the good news. I updated my repository, and easily built the code with a single make command. The code then ran flawlessly on a ../relative/path/to/outpost2Folder/ and produced a directory full of images below my current working directory. Great success.
The bad news, is that I realized my submodule was out of date (OP2Utility), and when I updated it and rebuilt, it failed to run as expected. The exact same command as above produced the error message:
No map file or save file found in the supplied directory.
Run without arguments to see usage message.
I tracked down with git reflog what my previous OP2Utility submodule was set to:
f125c4b62c682ecd2728a0d6deee10dbe34cb29d (2019-04-01) Merge pull request #289 from OutpostUniverse/cleanupMakefilePhonyRules
It works properly with the backdated submodule, but not with the current version.
It seems we broke something between then and now. A few of the changes are:
Prevent resource manager from returning directories
Fix creating new file in new directory
Allow empty volumes
Improve Palette Header construction
Zero-cost signed/unsigned negative check
Makefile cleanup
I just ran a git bisect on the OP2Utility submodule. It identified the first bad commit as:
c4e4666fa2f94ddb3d0c01e40d8212356b9e1f8a (2019-04-17) Prevent Resource Manager From Returning Directories
Git bisect command:
git bisect start master f125c4b62c682ecd2728a0d6deee10dbe34cb29d
git bisect run sh -c "cd ..; make; ./OP2MapImager ../opu-git-svn/GameDownload/Outpost2/trunk/"
In the above, master is a known bad commit, while f125c... is a known good commit. As the bisect is being run from the submodule (OP2Utility), I must switch to the parent repository (OP2MapImager) before running the build (make), and trying to run the output. It bisected over the 47 commits in that range, and after an estimated 6 steps of building and running code, it narrowed the first bad commit down to c4e46.... It determined this based on the exit code from running OP2MapImager, which returns 0 on success and non-zero on failure.