[tool] Sprite Sheet Generator Current:0900 (64bit support!)

Freeform discussion about anything related to modding Transcendence.
User avatar
Wolfy
Fleet Admiral
Fleet Admiral
Posts: 5400
Joined: Tue Feb 05, 2008 1:10 am
Location: Somewhere in the Frontier on a Hycrotan station, working on new ships.

Legacy version: 0.8.5.0 (x86)
Current version: 0.9.0.0 (x64)

32bit download
https://dl.dropbox.com/u/3061400/Sprite ... 200850.zip
64bit download (you need a 64 bit version of windows to run it)
https://dl.dropboxusercontent.com/u/306 ... 200900.zip

Licensed under FreeBSD (a non-copyleft FOSS license); feel free to decompile it and get the source, since I probably won't get around to putting up the source until later today/tomorrow.

Just to note this is the one I programmed last night while very sleepy, not the other sprite sheet maker I found months ago. (again, its a .NET program, might run under mono, have not tested that)

I'm in a rush atm, so I'll just post the IRC logs with extraneous chatter cropped out:


CHANGELOG:

Version 0.9.0.0
-AMD64 (x86-64) version (Now you can make even bigger sprite sheets!)- in the future there will be more x86 builds too though, both branches will be maintained. I just need to get a better numbering system.

Version 0.8.5.0
-Alphabetic sort feature

Version 0.8.4.0 (Unreleased)
-Supports lower .Net framework (3.5 client profile) [Was 4.0 previously]

Version 0.8.3.0 (Unreleased)
-Preliminary threading support

Version 0.8.2.1 (Unreleased)
-Updated the (C) license date in the 'about' section. Didn't feel it was a huge enough deal to bother with posting a link, esp. since 0820 just went out a few minutes ago.

Version 0.8.2.0
-FINALLY fixed the issue where attempting to use facings that were taller than they were wide would abort the rendering sequence

Version 0.8.1.3
-fixed crash bug when clearing list of facings using the "remove" button and only 1 item is left

Version 0.8.1.2 (unreleased)
-added better error handling in image creation (Doesn't crashsplode. Will improve further by auto-aborting generation if it encounters a glitch)
-improvements to efficiency (cleaned out some unnecessary junk from my sleep-written code)

Version 0.8.1.1 (unreleased)
-minor change to UI

Version 0.8.1.0 (unreleased)
-fixed some crash bugs related to buttons & edge cases
-minor changes to UI

Desc: v 0.8.0.0

Code: Select all

[09:05:32]	Azar_Wolf	0.8.0.0
[09:05:35]	Azar_Wolf	(version)
[09:05:46]	Azar_Wolf	its not 100% fully featured yet
[09:06:29]	Azar_Wolf	the 1-bit bitmap option currently just does a monochrome 8-bit bmp
[09:06:52]	Azar_Wolf	the 8/24-bit toggle on the other bitmap option does nothing
[09:07:04]	Azar_Wolf	it currently doesn't support images of varying sizes
[09:07:18]	Azar_Wolf	(you'll get spammed with error messages if you try)
[09:07:39]	Azar_Wolf	(the errors are handled, but having the boxes pop up slows things down epically)
[09:08:17]	Azar_Wolf	the program isn't exactly fast either, and has a huge memory footprint
[09:08:35]	Azar_Wolf	also if you try to make too big of an image, you will get an 'out of memory' error
[09:08:55]	Azar_Wolf	however it compiles the ansabi command ship just fine at the moment
[09:08:57]	Azar_Wolf	40 facings
[09:10:18]	Azar_Wolf	(its the largest ship in the game by sprite dimensions)
[09:10:19]	Azar_Wolf	yeah
[09:11:18]	Azar_Wolf	I just made a 1920x3840 image
[09:11:25]	Azar_Wolf	so it can handle good sized images
[09:11:54]	Azar_Wolf	took 160MB ram to do that
[09:11:59]	Azar_Wolf	used 2 images
[09:12:02]	Azar_Wolf	(screenshots really)
[09:12:03]	Azar_Wolf	X3
[09:12:30]	Azar_Wolf	ok, bbl
Roadmap:

1.0.0.0
-First non-beta release

9.0.0.1
-Over 9000.
(shpOrder gPlayership 'barrelRoll)
(plySetGenome gPlayer (list 'hycrotan 'nonBinary))
Image
Homelab Servers: Xeon Silver 4110, 16GB | Via Quadcore C4650, 16GB | Athlon 200GE, 8GB | i7 7800X, 32GB | Threadripper 1950X, 32GB | Atom x5 8350, 4GB | Opteron 8174, 16GB | Xeon E5 2620 v3, 8GB
Workstations & Render machines: Threadripper 3990X, 128GB, 1080ti | Threadripper 2990WX, 32GB, 1080ti | Xeon Platinum 8173M, 48GB, 1070ti | R9 3900X, 16GB, Vega64 | 2x E5 2430L v2, 24GB, 970
Office Systems: 2x Xeon Silver 4116, 96GB, 2x 1080ti | i7 3770, 16GB, some old quadro | i5 3210m, 8GB | some i7 macbook
Misc Systems: R5 3500U, 20GB | R5 2400G, 16GB | i5 7640X, 16GB, Vega56 | E5 2620, 8GB, R5 260 | P4 1.8ghz, 0.75GB, Voodoo 5 5500 | Athlon 64 x2 4400+, 1.5GB, FX 5800 Ultra | Pentium D 3.2ghz, 4GB, 7600gt | Celeron g460, 8GB, 730gt | 2x Athlon FX 74, 8GB, 8800gts 512 | FX 9590, 16GB, R9 295x2 | E350, 8GB | Phenom X4 2.6ghz, 16GB, 8800gt | random core2 duo/atom/i5/i7 laptops
User avatar
Ttech
Fleet Admiral
Fleet Admiral
Posts: 2764
Joined: Tue Nov 06, 2007 12:03 am
Location: Traveling in the TARDIS
Contact:

Very nice work Wolfy! Can't wait to see the source my self. But this should help with a lot of generation. :)
Image
Image
User avatar
alterecco
Fleet Officer
Fleet Officer
Posts: 1658
Joined: Wed Jan 14, 2009 3:08 am
Location: Previously enslaved by the Iocrym

For those that have access to cygwin or a *nix box, imagemagick is also a good tool to make spritesheets with. If there is interest I can dig up the command to use.
Get your own Galactic Omni Device
Get it now. It's free!!
Image
User avatar
Ttech
Fleet Admiral
Fleet Admiral
Posts: 2764
Joined: Tue Nov 06, 2007 12:03 am
Location: Traveling in the TARDIS
Contact:

alterecco wrote:For those that have access to cygwin or a *nix box, imagemagick is also a good tool to make spritesheets with. If there is interest I can dig up the command to use.
If there's interest? :D There's interest!
Image
Image
User avatar
alterecco
Fleet Officer
Fleet Officer
Posts: 1658
Joined: Wed Jan 14, 2009 3:08 am
Location: Previously enslaved by the Iocrym

Imagemagick is a wonderful tool for manipulating images. If you are not scared of the command line, then I warmly recommend looking at it. Google is full of examples of how to use it (the documentation can be quite daunting).

To stitch together a series of images into one big image, use the -append operation. Here is an example:

Code: Select all


Let us consider a directory that looks like this (imagine that the sequence is complete):

./images/image01.jpg
./images/image02.jpg
...
./images/image40.jpg

to make those into a sprite, simply issue this command:

convert images/*.jpg -append sprite.jpg
That is all it takes. Imagemagick offers many other very nice tools, such as cropping, alpha channel extraction etc... Check it out!
Get your own Galactic Omni Device
Get it now. It's free!!
Image
User avatar
Wolfy
Fleet Admiral
Fleet Admiral
Posts: 5400
Joined: Tue Feb 05, 2008 1:10 am
Location: Somewhere in the Frontier on a Hycrotan station, working on new ships.

nice, though it wasn't designed with the specific parameters required by these games in mind, but creating a shell for naev would actually not be that hard...

Perhaps we should concatenate this into a thread of sprite tools?
(shpOrder gPlayership 'barrelRoll)
(plySetGenome gPlayer (list 'hycrotan 'nonBinary))
Image
Homelab Servers: Xeon Silver 4110, 16GB | Via Quadcore C4650, 16GB | Athlon 200GE, 8GB | i7 7800X, 32GB | Threadripper 1950X, 32GB | Atom x5 8350, 4GB | Opteron 8174, 16GB | Xeon E5 2620 v3, 8GB
Workstations & Render machines: Threadripper 3990X, 128GB, 1080ti | Threadripper 2990WX, 32GB, 1080ti | Xeon Platinum 8173M, 48GB, 1070ti | R9 3900X, 16GB, Vega64 | 2x E5 2430L v2, 24GB, 970
Office Systems: 2x Xeon Silver 4116, 96GB, 2x 1080ti | i7 3770, 16GB, some old quadro | i5 3210m, 8GB | some i7 macbook
Misc Systems: R5 3500U, 20GB | R5 2400G, 16GB | i5 7640X, 16GB, Vega56 | E5 2620, 8GB, R5 260 | P4 1.8ghz, 0.75GB, Voodoo 5 5500 | Athlon 64 x2 4400+, 1.5GB, FX 5800 Ultra | Pentium D 3.2ghz, 4GB, 7600gt | Celeron g460, 8GB, 730gt | 2x Athlon FX 74, 8GB, 8800gts 512 | FX 9590, 16GB, R9 295x2 | E350, 8GB | Phenom X4 2.6ghz, 16GB, 8800gt | random core2 duo/atom/i5/i7 laptops
steelwing
Militia Lieutenant
Militia Lieutenant
Posts: 100
Joined: Sun Aug 01, 2010 4:33 pm

I just used Photoscape and GIMP to assemble my facings into a spritesheet and generate a mask from that. 8-)
Photoscape is dead simple to use. Start it up, click Combine, and save the result.
In GIMP, I opened up my newly generated combined image, then followed this:
1. In the Select menu, click "By Color", then click in the black area of the spritesheet. All black area will be selected.
2. Click the Fill tool. Set FG color as black and BG as white, then set options for BG color fill and fill whole selection.
3. Click in the selected black area, so the background turns solid white.
4. In the Select menu, click Invert. Now the areas corresponding to your ship should be selected.
5. Change Fill options to FG color fill. Click inside the selected area. You should now have your ship filled in with black.
6. Save to the same file type as your facings.
For those that prefer Paint.NET over GIMP, I'm sure you can do something comparable. I just wasn't able to work out how... :P

To render the facings themselves, I used Blender. Once I had my model worked out and my camera and light positioned, I wrote the script below to render all 40 facings automatically. This uses Blender 2.5 APIs, so don't try it in 2.4x or earlier. Paste it in a text viewer pane and hit alt+p to run.

Code: Select all

# Transcendence - Render facings for ship model
# by steelwing
# Make sure you've got your ship set up facing the right way to start.
# Your ship must be the only selected object.

# Set this for the path and filename to use.  Leave the %i intact, as it's used to number the files.
output_filepath = '//facings2\\facing_%i.png'
# specify render format (make sure the extension above matches)
output_format = 'PNG'

import bpy
from math import radians
# Set output format
bpy.context.scene.render.file_format = output_format

#loop for 40 facings
for x in range(1,41,1):
 bpy.context.scene.render.filepath = format(output_filepath % x) # set filename to save to
 bpy.ops.render.render(write_still=True) # perform render
 bpy.ops.transform.rotate(value=(radians(9),)) # rotate to next angle
User avatar
Wolfy
Fleet Admiral
Fleet Admiral
Posts: 5400
Joined: Tue Feb 05, 2008 1:10 am
Location: Somewhere in the Frontier on a Hycrotan station, working on new ships.

The problem with photoscape is that it does not preserve transparency, which is why I went to the other sprite sheet generator, which had its own problems, which is why I made my own.
(shpOrder gPlayership 'barrelRoll)
(plySetGenome gPlayer (list 'hycrotan 'nonBinary))
Image
Homelab Servers: Xeon Silver 4110, 16GB | Via Quadcore C4650, 16GB | Athlon 200GE, 8GB | i7 7800X, 32GB | Threadripper 1950X, 32GB | Atom x5 8350, 4GB | Opteron 8174, 16GB | Xeon E5 2620 v3, 8GB
Workstations & Render machines: Threadripper 3990X, 128GB, 1080ti | Threadripper 2990WX, 32GB, 1080ti | Xeon Platinum 8173M, 48GB, 1070ti | R9 3900X, 16GB, Vega64 | 2x E5 2430L v2, 24GB, 970
Office Systems: 2x Xeon Silver 4116, 96GB, 2x 1080ti | i7 3770, 16GB, some old quadro | i5 3210m, 8GB | some i7 macbook
Misc Systems: R5 3500U, 20GB | R5 2400G, 16GB | i5 7640X, 16GB, Vega56 | E5 2620, 8GB, R5 260 | P4 1.8ghz, 0.75GB, Voodoo 5 5500 | Athlon 64 x2 4400+, 1.5GB, FX 5800 Ultra | Pentium D 3.2ghz, 4GB, 7600gt | Celeron g460, 8GB, 730gt | 2x Athlon FX 74, 8GB, 8800gts 512 | FX 9590, 16GB, R9 295x2 | E350, 8GB | Phenom X4 2.6ghz, 16GB, 8800gt | random core2 duo/atom/i5/i7 laptops
steelwing
Militia Lieutenant
Militia Lieutenant
Posts: 100
Joined: Sun Aug 01, 2010 4:33 pm

Wolfy wrote:The problem with photoscape is that it does not preserve transparency, which is why I went to the other sprite sheet generator, which had its own problems, which is why I made my own.
Does transparency matter? All graphics for Transcendence (except masks) are done on black backgrounds, anyway.
User avatar
alterecco
Fleet Officer
Fleet Officer
Posts: 1658
Joined: Wed Jan 14, 2009 3:08 am
Location: Previously enslaved by the Iocrym

steelwing wrote:Does transparency matter? All graphics for Transcendence (except masks) are done on black backgrounds, anyway.
Your mask can be greyscale, and the easiest way to get a nice soft mask is to use transparency on your object. I think wolfy did a nice writeup of the process somewhere. I will see if I can find it.
Get your own Galactic Omni Device
Get it now. It's free!!
Image
User avatar
alterecco
Fleet Officer
Fleet Officer
Posts: 1658
Joined: Wed Jan 14, 2009 3:08 am
Location: Previously enslaved by the Iocrym

Get your own Galactic Omni Device
Get it now. It's free!!
Image
User avatar
Ttech
Fleet Admiral
Fleet Admiral
Posts: 2764
Joined: Tue Nov 06, 2007 12:03 am
Location: Traveling in the TARDIS
Contact:

we have some source yet? github?
Image
Image
steelwing
Militia Lieutenant
Militia Lieutenant
Posts: 100
Joined: Sun Aug 01, 2010 4:33 pm

alterecco wrote:OK, found it after some digging:

http://neurohack.com/transcendence/foru ... 328#p35328
I read that, though I didn't fully understand it at the time. I guess my confusion is that I'm not fully versed in the way graphics work in transcendence yet. I'm still feeling my way along in terms of shield and armor graphics for my ship that I'm making. :oops:
For one thing, I've looked at the masks for the built-in playerships. They're white images of the ships on a black background, yes? If that's so, then isn't the process I outlined with gimp perfectly good, once the facings are generated?
steelwing wrote:In GIMP, I opened up my newly generated combined image, then followed this:
1. In the Select menu, click "By Color", then click in the black area of the spritesheet. All black area will be selected.
2. Click the Fill tool. Set FG color as black and BG as white, then set options for BG color fill and fill whole selection.
3. Click in the selected black area, so the background turns solid white.
4. In the Select menu, click Invert. Now the areas corresponding to your ship should be selected.
5. Change Fill options to FG color fill. Click inside the selected area. You should now have your ship filled in with black.
6. Save to the same file type as your facings.
And I just realized that I got black and white flip-flopped in my process...Oh well, I'll redo my masks and post the fixed procedure. :oops:
Bobby
Militia Captain
Militia Captain
Posts: 675
Joined: Wed Jul 25, 2007 7:39 pm

steelwing wrote:If that's so, then isn't the process I outlined with gimp perfectly good, once the facings are generated?
It will definitely work, I do something similar with all my ships as well. 1. assemble the images manually in gimp as they are rendered, using snap to grid. 2. copy the background by color, paste onto a new white layer.

Problems can arise if your source images are jpeg, or some other lossy compression, and the background isn't perfectly black, or if you leave on anti-aliasing and keep threshold greater than 0 on the color select tool, the process will leave slightly jagged dark edges which transparency would prevent. Also: I can't seem to get gimp to save in a monochrome bitmap, so I use paint to save the final mask image over itself and cut the file size.
ImageImage
Thanks to digdug for the banners.
User avatar
digdug
Fleet Admiral
Fleet Admiral
Posts: 2616
Joined: Mon Oct 29, 2007 9:23 pm
Location: Decoding hieroglyphics on Tan-Ru-Dorem

Problems can arise if your source images are jpeg, or some other lossy compression
exactly, what i do is render or make all my graphics in BMP or another lossless format, and only at the end compress it to JPG (at various rates of compression to check the maximum compression you can do without too many jpeg artefacts)
Post Reply