Projects that have specifically been abandoned or considered "dead" get moved here, so people will quit bumping them. If your project has wound up here and it should not be, contact a moderator to have it moved back to the land of the living.
PArtGen (Particle Art Generator) is a tool written in C# that reads image data and outputs A_SpawnParticle calls in sequence to create a 2D "pixel art" image.
---DOWNLOADS--- PArtGen v1.1[Last update: 10/8/2018]
NOTE: Source code is in the zip under "src" folder.
Browse to PArtGen.exe directory via CMD and call the program with the necessary arguments.
Usage in cmd: PArtGen <source file> [scale] [horizontal] [heightmap file] [max displacement]
NOTE: All args in brackets i.e. [] are optional.
<source file> is of type 'string' and is the path + extension to the diffuse image.
[scale] is of type 'double' and defines how large the generated art would be. Particle size is scaled accordingly. Defaults to 1.0
[horizontal] is of type 'bool' and sets the image's orientation in-game. Defaults to false.
[heightmap file] is of type 'string' and is the path + extension of the heightmap image. Defaults to null.
[max displacement] is of type 'int' and is the maximum X/Z offset that can be applied by the heightmap. Defaults to 64, meaning the range is [-64, 64]
NOTE @ Heightmaps: They work like this - they take the brightness value of a pixel and return a number in the range of [-1.0, 1.0], then multiply [max displacement] by that value. Example: a pixel with a brightness of 127 (8-bit) will not be displaced, a pixel with a brightness of 255 will be displaced by [max displacement] * 1.0, and a pixel with a brightness of 0 will be displaced by [max displacement] * (-1.0). See Example folder in .zip for resources.
Spoiler: Important Notes - Read those before you ask me something!
PArtGen is a single item operation tool. You must specify the relative path to the images. Example: if your image is in the same folder as PArtGen.exe, then you must only use the filename + extension.
Recommended image size is 100x100px or up to 10000 particles.
The only supported format at the moment is PNG. Tool supports transparency, as in, transparent pixels would be excluded from code generation and not show up.
Indexed images are highly recommended due to the issues image transparency may cause.
Offsets are centered on the image as to allow nifty in-game manipulation such as rotating art. The tool generates LOTS of lines. I tried optimizing it using ZScript arrays, but the performace got about 50000% worse once the iterations kicked in.
Spoiler: License
See license.txt in zip.
Last edited by Accensus on Sun Aug 12, 2018 2:06 pm, edited 2 times in total.
What's new:
- Added support for heightmaps.
- Added support for horizontal art.
- Tool is no longer a batch tool. That feature has been sacrified to give the tool a bit more flexibility.
- Refactored the args parsing as to allow optional arguments.
Heightmaps in action:
This also exists in the Example folder inside the .zip.
Also updated OP with more info. See Usage and Important Notes spoilers.