Development Forum |
|
Creatures 1 PHP SPR compiler | |
|
bedalton
|
6/28/2020 | 1 |
I use a Mac with a windows virtual machine for playing Creatures. While working on a MacOS version of the Hatchery for Wine, I found I needed to create extra egg sprites. Unfortunately, I was not able to output BMP files from my main image app, and after saving to BMP with preview, BobCob simply refused to load the images. I had to resort to copying the images to the Windows virtual machine, then loading each image into MSPaint and re-saving them as BMP-24. This took a lot of time, because I really wasn't sure how things would look until they were loaded into BobCob. And the iteration process was brutal.
Today I needed to create sprites for this scrolling agent I am making, because I hate not being able to scroll around C1 Albia. When I was faced with having to go back to that workflow, I thought I would rather craft a better solution.
Yesterday I added SPR viewing support to my IntelliJ CAOS plugin. So I knew that the format was relatively simple. So I wrote a PHP script that would take my .png files, and turn them into an SPR. I chose PNG because it keeps colors true. PNG anti-aliasing creates problematic mostly transparent pixels, which look crazy when converted to SPR. So I take every slightly transparent pixel, and make it truly transparent in the game. This may not be what people want, but it is what I want.
I created a GIST on GitHub for it here
It will take either a directory after a -d flag, or a space-delimited list of images.
I am planing to add an SPR compiler to my CAOS plugin when I have time next week, as this turned out to be relatively easy. Not easy though is handling unsigned values in Java which IntelliJ uses.
Let me know if it you use it. |
Lacota
|
6/28/2020 | |
Thats interesting! Given C1's restricted 256 color palette, I'm sure it makes things look strange.
Do you need hosting for the page? I have space on eemfoo.org if so.
Please let me know |
|