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

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

Various things about Spring that do not fit in any of the other forums listed below, including forum rules.

Moderator: Moderators

Post Reply
User avatar
Caydr
Omnidouche
Posts: 7179
Joined: 16 Oct 2004, 19:40

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

Post 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.
Gnomre
Imperial Winter Developer
Posts: 1754
Joined: 06 Feb 2005, 13:42

Post 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.
User avatar
aGorm
Posts: 2928
Joined: 12 Jan 2005, 10:25

Post 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
User avatar
Caydr
Omnidouche
Posts: 7179
Joined: 16 Oct 2004, 19:40

Post 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.
Dwarden
Posts: 278
Joined: 25 Feb 2005, 03:21

Post 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 ...
User avatar
aGorm
Posts: 2928
Joined: 12 Jan 2005, 10:25

Post 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
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6242
Joined: 29 Apr 2005, 01:14

Post by FLOZi »

All of AATAs 256-colour BMP BPs are 11kb, with practically no visible degradation due to the colour reduction.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post 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
User avatar
Buggi
Posts: 875
Joined: 29 Apr 2005, 07:46

Post by Buggi »

PNG hasn't been supported yet?!

ARGH!
User avatar
Neuralize
Posts: 876
Joined: 17 Aug 2004, 23:15

Post by Neuralize »

Photoshop Batch Processing + Actions = Eff all.
Post Reply

Return to “General Discussion”