My game is almost half a Gigabyte in size

I’m working on my first official Java game. The smallest I can make my whole game is about 400 MB. It seems that most of the space is taken up by the sounds (WAV) which is about 300 MB altogether.

It’s a 2D game based off of the Modern Warfare 2 multiplayer. It consists of a lot of sounds and sprites. Does this sound like an unusually large size for a game like this or should I not worry about it?

http://s16.postimg.org/h3jjv4yh1/OCODPREV.png

That’s really way too large. Do you compress your sound files at all? A typical indie game should be nowhere near that big…

No, to my knowledge they’re not compressed at all. How would I go about doing so? Right now I literally have a folder with about a thousand WAV files.

Look for a batch Wav to Mp3 converter. I’m not sure if Wav is very compressed compared to Mp3 but if it isn’t then that should help quite a bit.

First, if you can, use something like MP3s instead of WAVs, that will save a ridiculous amount of space.
Might need to investigate a mp3 loader or library for it, but it would be worth the investment.

EDIT: Kinda ninja’d, but yeah, WAV is totally uncompressed, and MP3 is pretty well compressed, and still sounds fine to most ppl down to about 192 Kbps or so

WAV files are huge. I would recommend converting your sound files over to a different format like MP3 because they are much smaller. Also, why do you have almost a thousand sound files?

In regards to an mp3 loader, just use libgdx; it works quite well.

.ogg is the smallest…

But if he’s not using libGDX, then what would be the point? He would have to include the library in his jar file which would greatly increase the file size. Just write your own loader, you’ll learn more in the process.

Yea, well if he went LibGDX for sound then he would probably want to use it for the rest of the game (I’m still assuming he isn’t already), and while it might improve performance etc, that’s pretty much premature optimization and would greatly increase development time, and I find that completely changing the way you do things in the middle of a project is not the way to stay focused and get it done. :wink:

I think .ogg is the best; same quality as MP3 but smaller.

There’s a lot of things that can go on at once in this game. Shooting, explosions, helicopters making noise, etc.

But anyhow thanks for the answers so far guys. I know WAV files can be very big but I decided to use them because I preferred to avoid using 3rd party libraries. But I guess I’ll have to suck it up. I’ll look into using MP3s or OGGs instead.

I know all about trying to avoid 3rd party stuff, but trust me, you want modern audio compression :wink:

Look at this thread for a very easy to use ogg library
http://www.java-gaming.org/index.php?topic=24702.0

Also what compression do you use for the sprites? png or jpg are the usual choices.

For my sprites I use PNG.

And I was actually looking at that thread just now, haha. So I guess I’ll give EasyOGG a try.

I’m wondering why your sprites take up 100MB. That seems too high.
Judging from your screenshot I would guess that your sprites should not use more than a few MB in total.
Can you upload a few of your biggest sprites? Maybe we can see why they are too big.

I just realized that I left all the Photoshop copies of all my sprites inside the sprite folder. After removing all of them, it drops the size of the sprites folder to about 18.7 MB

Sorry for the confusion on that. Is that still large? Do you still want to see some of my sprites?

Well, beside task force logo and item icons above everything can be drawn by code. Do you have your sprite rendered repeatedly?

  1. Use Easy Ogg which is the easiest way to play ogg files on your program:

http://www.cokeandcode.com/index.html?page=libs

  1. Or use this ogg player which is a bit harder to use. Here you can download the ogg player:

http://www.jcraft.com/jorbis/ -click on the jorbisxxx.zip file under the download tab.

Also ogg is open source which means you don’t have to pay royalties.

I’ll second (or more like fourth or fifth at this point) using ogg. Even the AAA studios like Blizzard use it. As for your sprites, store them as PNG and run them through OptiPNG and they should become quite a bit smaller.