An idea for an image importer generating maps
In the objective of facilitating the process of mapmaking, I've came across the idea of a tool that could generate a map from a bitmap image.
The idea was inspired from this 2014 work from "umairazfar" : viewtopic.php?f=83&t=16890
He developed a tool that generates some assets from ASCII code. Unfortunately the Dropbox links to the software are dead. I have no idea how his code works or would work.
But still, let's take this idea further : instead of writing ASCII code, we could use drawing applications (Photoshop, Illustrator, and equivalents), to create small bitmap maps, where each pixel matches a cell in the map.
Of course, the generated map would be coarse and very basic, and manual work is needed from the mapmaker. Nevertheless, the basic structure of the map would be ready, and the needed work would be only polishing and decorating.
The real advantage of such a process is to be able to use all the tools of modern drawing software, without needing to implement them into the map editor. It would include :
- Drawing tools : Brushes (draw surfaces) / Fill / ...
- Measurement tools : Grid / Guides / Measure / ...
- Structural tools : Symmetry / Copy / Rotation / Scale / ...
The latter would be some the most useful functions, as mapmakers often come across the issue of needed symmetry, re-scaling the map, ...
Using any software of his choice, the mapmaker creates a bitmap image, of the size of the desired map.
Predefined colors (*need to define a palette, for various software) would match different assets of the map editor, such as :
Resources and mines / Water / River / Cliffs / Roads / Trees / Player spawns / Capturable / ... (non exhaustive list)
For each category, the importer will use the most simple sprite available (cf roads, river, ...). Then, the mapmaker will have to polish it all, and choose the sprites he desires.
BMP image :
Scaled for understanding :
Theoritical result :
(disregard the different capturables : it should be the same asset (Oil Derrick for instance) )
The importer uses color ranges for 13 possible colors, 9 of which are used by default for standard assets.
The color ranges allow to finely choose distinguishable colors. Therefore, I've built a palette of these colors, than can be used in graphics editors :
(EDIT : the standard palette might differ a bit across mods / tilesets. This palette works for the 3 non-interior RA palettes)
I have attached below the palette files (.aco for Photoshop / Gimp, .ase for Illustrator / .gpl for Inkscape). As SirCake stated, Paint's palette should work too. And here
- MapSketchImporter palette files (.aco for Photoshop / Gimp, .ase for Illustrator / .gpl for Inkscape).
- (2.26 KiB) Downloaded 79 times
1- Get the code from : https://github.com/CH4Code/OpenRA/tree/ ... chImporter ("Clone or Download", then "Download ZIP", then unzip it)
2- Before compiling, some code seems outdated and might give compiling errors. You need to take the "thirdparty" folder from the bleed version of OpenRA : https://github.com/OpenRA/OpenRA (same steps), and replace it in MapSketchImporter's unzipped folder
3- Then, you can compile as stated here : https://github.com/OpenRA/OpenRA/wiki/Compiling
Basically for Windows :
- Run "make.cmd" and choose the "all" option.
- Run "launch-game.cmd" after compilation.
4- The tool will be then found in the traditional Map Editor in-game.
Inkscape should be the best tool for creating a map, since all shapes can be edited and moved after placing. Its vector graphics, so that might mean its cumbersome at first, but it offers great potential for copy-pasta
Did't manage to punch out a SKD/standalone version this weekend, but I'm on it...