Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (516)
Games in Android Showcase (122)
games submitted by our members
Games in WIP (577)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1] 2
  ignore  |  Print  
  My game is almost half a Gigabyte in size  (Read 2471 times)
0 Members and 1 Guest are viewing this topic.
Offline 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?

Offline opiop65

JGO Kernel


Medals: 156
Projects: 7
Exp: 3 years


JumpButton Studios


« 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...

Offline 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!
Legends of Yore - The Casual Retro Roguelike
Offline 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.
Online 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
Offline opiop65

JGO Kernel


Medals: 156
Projects: 7
Exp: 3 years


JumpButton Studios


« 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?

Offline 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.
Offline Jimmt
« League of Dukes »

JGO Kernel


Medals: 136
Projects: 4
Exp: 3 years



« Reply #7 - Posted 2013-06-17 00:00:53 »

.ogg is the smallest...
Offline opiop65

JGO Kernel


Medals: 156
Projects: 7
Exp: 3 years


JumpButton Studios


« 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.

Online 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.  Wink
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Sammidysam
« Reply #10 - Posted 2013-06-17 00:10:11 »

I think .ogg is the best; same quality as MP3 but smaller.
Offline 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.
Online 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  Wink
Offline DrZoidberg

Senior Duke


Medals: 15



« Reply #13 - Posted 2013-06-17 05:35:05 »

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.
Offline Exaultu

Junior Newbie





« Reply #14 - Posted 2013-06-17 05:40:37 »

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.
Offline DrZoidberg

Senior Duke


Medals: 15



« 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.
Offline 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?
Offline 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?

Offline pixelapp

Junior Duke




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=libs

2) 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.
Offline sproingie

JGO Kernel


Medals: 202



« 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.

Offline Jimmt
« League of Dukes »

JGO Kernel


Medals: 136
Projects: 4
Exp: 3 years



« Reply #20 - Posted 2013-06-18 03:16:20 »

Oh, and obfuscate it if you really need to cut down on filesize. JShrink
Offline 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  
// Put this at the start of your rendering. No need to use every single one.
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);
Offline 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
Offline CodeHead

JGO Knight


Medals: 41


From rags to riches...to rags.


« 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.
Offline jh62

Senior Newbie





« 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.

Online 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.'
Offline CodeHead

JGO Knight


Medals: 41


From rags to riches...to rags.


« 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.
Online 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?
Offline CodeHead

JGO Knight


Medals: 41


From rags to riches...to rags.


« 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. Cool

Arthur: Are all men from the future loud-mouthed braggarts?
Ash: Nope. Just me baby...Just me.
Online BurntPizza
« Reply #29 - Posted 2013-06-18 04:47:42 »

Yea, I think it is mostly just the traditional advice.

As an aside, I would avoid using mp3's in anything I distribute at the moment. There are currently too many licencing/patent uncertainties involved with their use that can be sidestepped with the ogg/vorbis suggestion. Cool

Ah, now there is a legitimate reason in regards to file format, good idea, thank you sir.
Pages: [1] 2
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

TehJavaDev (31 views)
2014-10-27 03:28:38

TehJavaDev (26 views)
2014-10-27 03:27:51

DarkCart (40 views)
2014-10-26 19:37:11

Luminem (21 views)
2014-10-26 10:17:50

Luminem (26 views)
2014-10-26 10:14:04

theagentd (32 views)
2014-10-25 15:46:29

Longarmx (61 views)
2014-10-17 03:59:02

Norakomi (57 views)
2014-10-16 15:22:06

Norakomi (46 views)
2014-10-16 15:20:20

lcass (43 views)
2014-10-15 16:18:58
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!