Exaultu
Junior Newbie
|
 |
«
Posted
2013-06-16 23:36:28 » |
|
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? 
|
|
|
|
Opiop
|
 |
«
Reply #1 - Posted
2013-06-16 23:44:39 » |
|
That's really way too large. Do you compress your sound files at all? A typical indie game should be nowhere near that big...
|
|
|
|
Exaultu
Junior Newbie
|
 |
«
Reply #2 - Posted
2013-06-16 23:51:57 » |
|
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.
|
|
|
|
Games published by our own members! Check 'em out!
|
|
tyeeeee1
|
 |
«
Reply #3 - Posted
2013-06-16 23:55:25 » |
|
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.
|
|
|
|
BurntPizza
|
 |
«
Reply #4 - Posted
2013-06-16 23:55:52 » |
|
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
|
|
|
|
Opiop
|
 |
«
Reply #5 - Posted
2013-06-16 23:57:15 » |
|
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?
|
|
|
|
tyeeeee1
|
 |
«
Reply #6 - Posted
2013-06-16 23:59:15 » |
|
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
In regards to an mp3 loader, just use libgdx; it works quite well.
|
|
|
|
Jimmt
|
 |
«
Reply #7 - Posted
2013-06-17 00:00:53 » |
|
.ogg is the smallest...
|
|
|
|
Opiop
|
 |
«
Reply #8 - Posted
2013-06-17 00:05:15 » |
|
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
In regards to an mp3 loader, just use libgdx; it works quite well. 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.
|
|
|
|
BurntPizza
|
 |
«
Reply #9 - Posted
2013-06-17 00:09:57 » |
|
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
In regards to an mp3 loader, just use libgdx; it works quite well. 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. 
|
|
|
|
Games published by our own members! Check 'em out!
|
|
Sammidysam
|
 |
«
Reply #10 - Posted
2013-06-17 00:10:11 » |
|
I think .ogg is the best; same quality as MP3 but smaller.
|
|
|
|
Exaultu
Junior Newbie
|
 |
«
Reply #11 - Posted
2013-06-17 00:39:48 » |
|
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?
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.
|
|
|
|
BurntPizza
|
 |
«
Reply #12 - Posted
2013-06-17 00:59:56 » |
|
I know all about trying to avoid 3rd party stuff, but trust me, you want modern audio compression 
|
|
|
|
|
Exaultu
Junior Newbie
|
 |
«
Reply #14 - Posted
2013-06-17 05:40:37 » |
|
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.
|
|
|
|
DrZoidberg
|
 |
«
Reply #15 - Posted
2013-06-17 05:50:13 » |
|
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.
|
|
|
|
Exaultu
Junior Newbie
|
 |
«
Reply #16 - Posted
2013-06-17 06:06:24 » |
|
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?
|
|
|
|
ReBirth
|
 |
«
Reply #17 - Posted
2013-06-17 06:09:02 » |
|
Well, beside task force logo and item icons above everything can be drawn by code. Do you have your sprite rendered repeatedly?
|
|
|
|
pixelapp
|
 |
«
Reply #18 - Posted
2013-06-17 06:28:53 » |
|
1) Use Easy Ogg which is the easiest way to play ogg files on your program: http://www.cokeandcode.com/index.html?page=libs2) 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.
|
Cloud games and fun.
|
|
|
sproingie
|
 |
«
Reply #19 - Posted
2013-06-18 02:43:30 » |
|
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.
|
|
|
|
Jimmt
|
 |
«
Reply #20 - Posted
2013-06-18 03:16:20 » |
|
Oh, and obfuscate it if you really need to cut down on filesize. JShrink
|
|
|
|
Vladiedoo
|
 |
«
Reply #21 - Posted
2013-06-18 03:20:10 » |
|
Extremely Unrelated:It looks (to me) like you're using Java2D. This code might help enhance your game's graphical appearance. 1 2 3 4 5 6 7 8 9 10
| g.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON); g.setRenderingHint(RenderingHints.KEY_DITHERING, RenderingHints.VALUE_DITHER_ENABLE); g.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY); g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); g.setRenderingHint(RenderingHints.KEY_TEXT_LCD_CONTRAST, Integer.valueOf(100)); g.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS, RenderingHints.VALUE_FRACTIONALMETRICS_ON); g.setRenderingHint(RenderingHints.KEY_ALPHA_INTERPOLATION, RenderingHints.VALUE_ALPHA_INTERPOLATION_QUALITY); g.setRenderingHint(RenderingHints.KEY_COLOR_RENDERING, RenderingHints.VALUE_COLOR_RENDER_QUALITY); g.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_PURE);
|
|
|
|
|
arnaud_couturier
|
 |
«
Reply #22 - Posted
2013-06-18 03:37:50 » |
|
I'm not sure why you need thousands of sound effects. You're making your life harder for little benefit IMO.
1) Especially with small games, you should be ok with less than a hundred SFX, having more won't make the game more fun.
2) if you load all your sounds at once, they will still take up 500 MB in RAM, even if their files are compressed with vorbis
|
|
|
|
CodeHead
|
 |
«
Reply #23 - Posted
2013-06-18 03:45:53 » |
|
I'd have to agree with Arnaud. You'd probably get a lot more bang for the buck by using a relatively small pool of sounds and applying blending/audio processing to get variation. A single "footsteps" sound effect could have reverb added to or a low pass filter to simulate walking in large cavernous spaces, or a grassy field respectively for instance. DSP may be a bit more complex, but it can potentially save you a lot of space in your final product.
|
Arthur: Are all men from the future loud-mouthed braggarts? Ash: Nope. Just me baby...Just me.
|
|
|
jh62
|
 |
«
Reply #24 - Posted
2013-06-18 03:53:27 » |
|
Generally you would use WAV files for short sounds (Special FX) and Mp3 or other compressed format for music and large sounds.
|
|
|
|
BurntPizza
|
 |
«
Reply #25 - Posted
2013-06-18 03:57:59 » |
|
Generally you would use WAV files for short sounds (Special FX) and Mp3 or other compressed format for music and large sounds.
I've heard that, but I always wonder, why? Is it loading times? I have several theories on this, but I want to know other people's opinions on this, as I am wondering if I am doing something genuinely 'wrong.'
|
|
|
|
CodeHead
|
 |
«
Reply #26 - Posted
2013-06-18 04:07:34 » |
|
I think it's for ease of processing since you don't have to unpack/decode the data on the fly. I would imagine many sound libraries would store the data in memory in an unpacked format for this reason. Just my $0.02.
|
Arthur: Are all men from the future loud-mouthed braggarts? Ash: Nope. Just me baby...Just me.
|
|
|
BurntPizza
|
 |
«
Reply #27 - Posted
2013-06-18 04:21:27 » |
|
I think it's for ease of processing since you don't have to unpack/decode the data on the fly. I would imagine many sound libraries would store the data in memory in an unpacked format for this reason. Just my $0.02.
That is a reason I've considered, but also, all sounds loaded into memory are in an uncompressed (raw) format. Only files streamed from the HDD avoid this (and only partly, as they must be decoded in as the stream comes in), which is what you try to do for long sounds, like background music, to avoid using hundreds of MB's. But surely the processing time required to decode many small mp3's or such is small compared to other concerns?
|
|
|
|
CodeHead
|
 |
«
Reply #28 - Posted
2013-06-18 04:44:00 » |
|
But surely the processing time required to decode many small mp3's or such is small compared to other concerns?
Indeed. Although I've seen people use .wav files for sound FX, I can't say I've really seen many people advocate using it outside of beginners tutorials. Maybe it's just traditional to suggest them since they were pretty ubiquitous back in the early days of game development before we had accessible and affordable/free compression technologies. It seems like rather dated advice to me, but there may be other reasons that I'm not aware of. I'd be interested to hear other's take on it as well. As an aside, I would avoid using mp3's in anything I distribute at the moment. There are currently too many licensing/patent uncertainties involved with their use that can be sidestepped with the ogg/vorbis suggestion. 
|
Arthur: Are all men from the future loud-mouthed braggarts? Ash: Nope. Just me baby...Just me.
|
|
|
BurntPizza
|
 |
«
Reply #29 - Posted
2013-06-18 04:47:42 » |
|
Yea, I think it is mostly just the traditional advice. Ah, now there is a legitimate reason in regards to file format, good idea, thank you sir.
|
|
|
|
|