WadMaker - a command-line wad-making tool Created 2 months ago2021-05-16 22:05:58 UTC by Captain P Captain P

Created 2 months ago2021-05-16 22:05:58 UTC by Captain P Captain P

Posted 2 months ago2021-05-16 22:05:58 UTC Post #345618
WadMaker is finally finished!
It can be downloaded here. For more information, see the readme.

This command-line tool can turn a directory full of images into a Half-Life wad file - just drag the directory onto the tool. It can also extract textures from wad and bsp files, or remove embedded textures from bsp files.

WadMaker directly supports png, jpg, gif, bmp and tga files, and can be configured to call external conversion tools for other formats. It will automatically create a suitable 256-color palette for each image. It will also apply a limited form of dithering, which can be disabled if necessary. For transparent textures, the alpha channel of the input image is compared against a configurable threshold, but it is also possible to treat a specific input color as transparent. For water textures, the fog color and intensity are derived from the image itself, but they can also be specified explicitly. All these texture-specific settings can be overridden with a plain-text wadmaker.config file in the images directory.

Why did I make this tool? First, I was investigating the various Half-Life file formats anyway. Second, I wanted a faster workflow than Wally (for me, running a batch file is faster than opening a GUI tool, dragging files around, saving a wad file, and closing the GUI tool). And finally, investigating various approaches to color quantization and dithering, and reading up on color spaces and color perception turned out to be very interesting.
Changes in v1.1:
New features:
  • Added support for Photoshop files (.psd, .psb) that have been saved with 'maximize compatibility' enabled.
  • Added support for Krita (.kra) and OpenRaster (.ora) files.
  • Added support for creating and extracting decal wad files (decals.wad).
  • Updated the wadmaker.config system to apply all matching rules (with more specific rules overriding less specific ones).
  • Console output is now logged to a file (only in create-wad mode). This can be disabled with a command-line option.
Bugfixes:
  • Fixed that removing an image with an uppercase name would cause updating a wad file to fail.
  • Fixed that water color was accidentally black by default.
Posted 2 months ago2021-05-16 22:42:00 UTC Post #345619
You're making such cool stuff, Cap'n!! Awesome
Archie ArchieGoodbye Moonmen
Posted 2 months ago2021-05-18 05:23:22 UTC Post #345630
That's great! I actually long longed for such a tool, good job Captain!
Posted 2 months ago2021-05-18 19:58:37 UTC Post #345631
Posted 2 months ago2021-05-19 00:13:40 UTC Post #345633
Thanks! Don't hesitate to ask if you have questions or feedback. :)
Posted 2 months ago2021-05-19 11:52:31 UTC Post #345635
sound like a boon for big projects
Posted 2 months ago2021-05-19 13:09:24 UTC Post #345638
Nice, sounds very useful.
Posted 2 months ago2021-05-30 23:41:52 UTC Post #345668
WadMaker 1.1 is now available!
It can be downloaded here. For more information, see the readme.

New features:
  • Added support for Photoshop files (.psd, .psb) that have been saved with 'maximize compatibility' enabled.
  • Added support for Krita (.kra) and OpenRaster (.ora) files.
  • Added support for creating and extracting decal wad files (decals.wad).
  • Updated the wadmaker.config system to apply all matching rules (with more specific rules overriding less specific ones).
  • Console output is now logged to a file (only in create-wad mode). This can be disabled with a command-line option.
Bugfixes:
  • Fixed that removing an image with an uppercase name would cause updating a wad file to fail.
  • Fixed that water color was accidentally black by default.

WadMaker will automatically switch to decal mode when the ouput wad file name is 'decals.wad', and it expects input images to have an alpha channel - which it will use to create the decal texture. The average color of the input image is used as decal color. If you're not sure what format is expected, then first try extracting a decals.wad file, and take a look at the extracted images. It's also possible to enable grayscale input with a wadmaker.config setting - in that case you should also specify the decal color in the settings file.

As for Photoshop files, not all compression methods are supported because I could only find test files with raw and RLE compressed composite images. So please let me know if certain files don't work. I can add support as soon as I get some files to test with.
Posted 2 weeks ago2021-07-20 19:55:44 UTC Post #345792
That might be a whole lot to ask for, but did you consider adding support for converting Gimp’s XCF files too, as well as to automatically resize converted images to valid Goldsource dimensions (less than 256 and divisible by 16). Realistically though, this would just make things a bit more convenient.
Posted 2 weeks ago2021-07-21 09:03:27 UTC Post #345793
I did investigate Gimp's file format a while ago, but the main problem is that it doesn't contain a flattened image. I'd have to implement layer compositing, but that's a fair bit of extra work. The same problem applies to Aseprite and Paint.NET files.

But WadMaker can be configured to use external (command-line) conversion tools, and there seem to be several tools that can convert .xcf files (Gimp's batch mode, xcf2png, ImageMagick, Irfanview). So if you can get one of these tools to work, then it's just a matter of creating a wadmaker.config file in your source image folder and adding a line like the following (where {input} is the full input .xcf path, and {output} is a .png file in a temporary folder):
*.xcf    converter: '"C:\Tools\XcfConverter.exe"' arguments: '-in="{input}" -out="{output}"'
The above is just an example. Once I'm done with SpriteMaker I'll update the documentation with .xcf and .aseprite file conversion examples.

As for automatic resizing, if you're talking about allowing images of arbitrary size then I don't think that's a good idea due to quality loss. But if you're working with high-res source images (say, 2x as large) then I guess a scaling factor setting could be useful. I'll think about it. For now, you could perhaps use the above converter approach to resize your images.
You must be logged in to post a response.