Broken Sword file compression

Ask for help with ScummVM problems

Moderator: ScummVM Team

Post Reply
User avatar
Largo Lagrande
Posts: 4
Joined: Fri Jul 21, 2006 6:24 am

Broken Sword file compression

Post by Largo Lagrande »

Not a SCUMMVM problem or question per se, but I could use a little help with it anyway, so I thought I'd ask here!

Is there any way to compress the speech*.clu files from Broken Sword (1) They take up the majority of the space and I'd like the game to be somewhat more compact, to be honest (so it'll leave more space for other games on my MS).
I already encoded the music wav files to ogg files, but now I'm wondering if there's a way to compress the speech files as well.

If anyone knows a good way to do that, I'd really appreciate a pointer in the right direction!

Thanks in advance :)
User avatar
eriktorbjorn
ScummVM Developer
Posts: 3525
Joined: Mon Oct 31, 2005 7:39 am

Re: Broken Sword file compression

Post by eriktorbjorn »

Largo Lagrande wrote:Is there any way to compress the speech*.clu files from Broken Sword (1) They take up the majority of the space and I'd like the game to be somewhat more compact, to be honest (so it'll leave more space for other games on my MS).
Look for the "compress_sword1" tool. Like all of the ScummVM compression tools, it's meant for running from a command prompt, and uses an external program (oggenc or lame) to do the actual compression.
User avatar
abelthorne
Posts: 43
Joined: Fri Jun 02, 2006 11:50 am
Location: France

Post by abelthorne »

I've just compressed BS1 files usng the compress_sword1 tool. It compressed speech and music files as expected except a small detail : one music file (6M13.WAV) has not been compressed.

Is that normal ? Can I remove it safely ?

EDIT : I can manually compress the file using oggenc, but I wonder why the compress_sword1 tool skips it.

Also, is it possible to compress the *.CLU files apart from the speech files (i.e. COMPACTS.CLU, GENERAL.CLU, etc.) ?
User avatar
eriktorbjorn
ScummVM Developer
Posts: 3525
Joined: Mon Oct 31, 2005 7:39 am

Post by eriktorbjorn »

abelthorne wrote:I've just compressed BS1 files usng the compress_sword1 tool. It compressed speech and music files as expected except a small detail : one music file (6M13.WAV) has not been compressed.

Is that normal ? Can I remove it safely ?
It's not used. The only music files that Broken Sword 1 plays are listed in _tuneList[] in engines/sword1/staticres.cpp, and 6m13 is not in that list.
abelthorne wrote:Also, is it possible to compress the *.CLU files apart from the speech files (i.e. COMPACTS.CLU, GENERAL.CLU, etc.) ?
There's no support for that in ScummVM.
clem
Posts: 2159
Joined: Mon Oct 31, 2005 11:14 am

Post by clem »

abelthorne wrote:Also, is it possible to compress the *.CLU files apart from the speech files (i.e. COMPACTS.CLU, GENERAL.CLU, etc.) ?
most of that are probably gfx files/animations

I tried converting the pcx files in FOTAQ to bruteforced png files once, the gain was negligible

anyway, BS1 with cutscenes and mp3-compressed audio comes to about 364 mbyte, anyone today should be able to live with that HD usage
User avatar
abelthorne
Posts: 43
Joined: Fri Jun 02, 2006 11:50 am
Location: France

Post by abelthorne »

clem wrote:anyway, BS1 with cutscenes and mp3-compressed audio comes to about 364 mbyte, anyone today should be able to live with that HD usage
Yes, the size is not an issue. It was juste by curiosity : I wondered why some CLU files could be compressed and others could not. That didn't leap to my mind immediately that they were data files other than sound.
User avatar
eriktorbjorn
ScummVM Developer
Posts: 3525
Joined: Mon Oct 31, 2005 7:39 am

Post by eriktorbjorn »

abelthorne wrote:Yes, the size is not an issue. It was juste by curiosity : I wondered why some CLU files could be compressed and others could not. That didn't leap to my mind immediately that they were data files other than sound.
I don't know about Broken Sword 1, but in Broken Sword 2 the data files that are named after areas in the game - paris, jungle, etc - contain the resources specific to those areas. For instance, paris.clu contains:
  • 223 Animation resources, total size 19.4M. These are pretty self-explaining.
  • 44 WAV File resources, total size 3.5M. These are the sound effects. Cars, birds, etc.
  • 9 Screen resources, total size 5.2M. These are the graphics for the rooms. I don't remember if they also contain the scripts specific to that room or not.
  • 9 Run List resources, total size 796 bytes. These are lists of resources to run scripts for.
  • 8 Walk Grid resources, total size 2K. These control where actors can move.
Then, there are the data files that are used all over the game:
  • general.clu contains... well, lots of things. Animations, icons, mouse cursors, etc.
  • players.clu contains mostly animations (George and Nico doing various things, probably), and a few run lists.
  • scripts.clu contains the global variables, the object scripts, and the screen managers (used only for debugging?)
  • text.clu contains, not surprisingly, text.
So once you take away the speech and music, most of what remains of the game is the graphics. The sound effects are uncompressed WAV files, but they are mostly quite small.

It looks like Revolution did consider adding some sort of generic compression for the Broken Sword 2 resources. There are fields in the resource header for compression type, compressed size, etc. I don't know if they decided it wasn't worth the effort, or if they simply ran out of time.
Post Reply