Page 1 of 1

DDS=borked, JPG=crashes, PCX=huge filesize, BMP=even larger

Posted: 05 Jan 2006, 20:35
by Caydr
(Note: I used this page for reference - http://taspring.clan-sy.com/wiki/Units:Buildpics )

As I am the first person to try new image formats for their mod's buildpics, I'm the one who's going to have to bear bad news and bug reports.

After some testing last night, I'm quite sure there's a problem with buildpic code. When I converted all my buildpics to DDS, regardless of DXT1, DXT3, DXT5, with or without mipmaps, I get a gray box for all my buildpics.

I've also done several test games. Identical versions of AA, except that one uses JPG for buildpics, the other uses PCX. PCX never crashes, JPG almost always crashes. There's no possibility of typos entering the buildpic name, or making a wrong tag, or anything of that sort either, since i've got the whole process automated.

PCX, on the other hand, works perfectly. But the compression is quite bad. Most buildpics in this format range between 25 and 30 KB.

BMP, as anyone whose used Paint knows, is about the worst image format on the planet. The filesizes BMP gives are positively massive. I've not bothered testing whether these actually work ingame for this reason.

25-30 kb per picture doesn't sound that outrageous, but let's compare:

40 KB per BMP
28 KB per PCX
4 KB per DDS
2 KB per JPG

The savings are clear. Whether I use JPG or DDS, as long as I use one of those two, AA shrinks in size by nearly 9 megabytes when compressed.

I'd really like to use JPG, or at the very least DDS (DDS is larger, but the difference when compressed is only half a megabyte combined) in Absolute Annihilation, but it appears that for the time being I'm stuck using PCX.

I don't know what could possibly be causing the crashing with JPG, I'm really at a loss. The crashes appear random but generally between the 10 and 20 minute mark, or sometimes not at all. I've had a full length game with JPG compression. Smokeynseinor reports he's finished 3 games and never had a crash - and with his connection, that's practically legendary.

Maybe you folks could find a flaw in my automated process. Here's the sequence of events:

#1 - Photoshop converts all buildpics to JPG with 85% compression, in batch mode.

#2 - I open all unit FBI files in UltraEdit (a powerful text editor with advanced macro features)

#3 - I instruct UE to do the following:

go down 3 lines (this places cursor at the point of the UNITNAME field)
highlight that line
copy that line to clipboard
go to end of that line
create new line
paste from clipboard
go to end of line
backspace one time
type ".jpg;"
go to beginning of line
go one tab over
delete 8 characters
type "buildpic"
save file
close file
repeat macro on next file (infinite loop until all files are closed)

The resulting file appears as so:

Code: Select all

[UNITINFO]
{
	Name=Archer;
	UnitName=ARMAAS;
	Buildpic=ARMAAS.jpg;
..........
Keep in mind that I can reliably always place the unitname field on the third line since I use Maelstrom's FBI edit, which always places it there.

Posted: 05 Jan 2006, 22:54
by Gnomre
BMP certainly does work without a problem. That's what all the SWTA buildpics are saved as, and I haven't heard a peep out of anyone about any crashes that could have been generated by them.

JPEG does, or at least did work at one point without a problem. See the TAK mod topic. TAK shipped its buildpics as jpegs to begin with, I just had to change the directory they were in and they worked fine.

Can't comment on dds, haven't tried it.

Posted: 05 Jan 2006, 23:13
by aGorm
Not relevent, but I have to say...
UltraEdit (a powerful text editor with advanced macro features)
Yes it is THE BEST. So usefull. BTW, have your tried IrfanView for batch Image manipulation?? It does loads more than teh photoshop one... (unless teh options for the photoshop ones are hidden away...)

aGorm

Posted: 06 Jan 2006, 00:02
by Caydr
Haven't tried infanview for batches, no. And yes, photoshop has some nifty features hidden away :-)

Sorry if I'm being alarmist and there's really no problem... but I have no other conclusion to come to. In one case, stability is perfect (or limited only by random spring problems that happen one in a hundred games), and in the other version which is identical save for JPG buildpics, constant crashing.

If the TAK mod works fine despite this, maybe it's something to do with a buffer hitting critical mass? TA:K has only some dozen units per side, while TA has hundreds per side. Maybe once a certain number of jpgs are in cache Spring can't handle it anymore? Something to do with the relatively high compression of JPGs or something maybe... meh. I've really run out of ideas. If anyone at all can come up with a solution they'd help me out a lot.

Posted: 06 Jan 2006, 14:17
by Dwarden
Caydr i would suggest myself to use IrfanView or / and XnView to done test batch conversion ...

i already encoutered some similar issue with one game in past ... if it was done via Photoshop (nothing against it's excelent program but for picture converting only not needed :) ...

not remember exactly (2+ years :) what was source of that problem it was related to JPG format settings used to save ...

Posted: 06 Jan 2006, 14:24
by aGorm
Yhe... what I ment was irfanview has all the options right there easy to see. :-) I mean... You can do everything!! Even mess with te hues and saturations on a batch level... all sorts of great stuff.

Of course I only Got Photoshop CS 1, maybe version 2 has more batch options.

aGorm

Posted: 06 Jan 2006, 14:57
by FLOZi
All of AATAs 256-colour BMP BPs are 11kb, with practically no visible degradation due to the colour reduction.

Posted: 06 Jan 2006, 18:24
by AF
I think it's more complex than that, spring isnt actually decompressing the jpegs at all, it leaves that up to a library called DevIL.dll. If I recall correctly, ti does do ti for bitmaps and maybe pcx btu that was before I noticed the DevIL library and another thing where bundled with spring

Posted: 07 Jan 2006, 02:42
by Buggi
PNG hasn't been supported yet?!

ARGH!

Posted: 08 Jan 2006, 07:29
by Neuralize
Photoshop Batch Processing + Actions = Eff all.