|
|
Problem: XNB files grooowww hugely
-
04-18-2008, 3:01 PM |
-
04-18-2008, 3:09 PM |
-
Nick Gravelyn
-
-
-
Joined on 03-05-2007
-
Seattle, WA, USA
-
Posts 2,970
-
-
|
Re: Problem: XNB files grooowww hugely
Unfortunately that growth is the nature of the XNB file. It's a quickly read binary file, so it will not be as small as most file sizes. You can take a look at EasyZip (see link in my signature) which lets you have your project automatically place all the built content into a compressed ZIP file. It comes with a ZipContentManager that lets you stream the files out so you don't even have to unzip the package on the Xbox. I heard there are some bugs on Xbox, but that was just one or two and I haven't heard anything lately, but give it a try and see. It is open source, so you can also poke around and see if any bugs are easily fixable if they come up.
Nick Gravelyn -- Microsoft XNA MVP XNA Wiki | Zune Games
|
|
-
04-18-2008, 3:44 PM |
-
Cosmos
-
-
-
Joined on 12-07-2007
-
-
Posts 143
-
-
|
Re: Problem: XNB files grooowww hugely
This is really (really) weird.
I have seen the exact oposite. As an example, I build a model and heavily smoothed it in Max, near to 200.000 vertices to do some test using nprof, and when the standard processor converts the x file (about 29 Mb in size without animations, and 30 Mb in size with constraints and 12 meshes animated) it ends with just 2 Mb!
Also, my tga files consistently decrease in size about 70 to 80%.
I will love to hear why are some files increasing and why others decrease (and decrease radically) in size.
|
|
-
04-18-2008, 3:46 PM |
-
Nick Gravelyn
-
-
-
Joined on 03-05-2007
-
Seattle, WA, USA
-
Posts 2,970
-
-
|
Re: Problem: XNB files grooowww hugely
Depends on the source data and the processor. For instance a PNG is a very compressed file. So if you build it to XNB with mipmaps you'll see massive size increases. As for you getting smaller files, that's new to me. I've never seen a file get smaller.
Nick Gravelyn -- Microsoft XNA MVP XNA Wiki | Zune Games
|
|
-
04-18-2008, 3:51 PM |
-
Cosmos
-
-
-
Joined on 12-07-2007
-
-
Posts 143
-
-
|
Re: Problem: XNB files grooowww hugely
Well, to be strict, my tga files where uncompressed before processed by XNA, so maybe an aparent decrease in size is just because the way and format XNA ends with (with the xnb extension). I have a feel is something very similar to a .dds compresed file. But the .x file is a text file and it really decreased (as I said from 29 Mb to near 2 Mb).
Edit: I checked the .x file and it is 68.736 vertices. Decreased from 30.577 KB to 1.982 KB.
Anyways, I think the texture files size may increase if they where compresed before processed. As I said, I'll love to know why is this.
|
|
-
04-18-2008, 3:57 PM |
-
Nick Gravelyn
-
-
-
Joined on 03-05-2007
-
Seattle, WA, USA
-
Posts 2,970
-
-
|
Re: Problem: XNB files grooowww hugely
If you have an text file version of the X model, it will most likely shrink in size since the XNB is a binary format. Binary formats are almost always smaller than text equivalents. So that might explain why you see a gain there. Plus the XNB only stores the data that the processor deems relevant so any extra information or tags or other things like that won't end up in the final file. This can also result in a large cut-down of filesize.
Nick Gravelyn -- Microsoft XNA MVP XNA Wiki | Zune Games
|
|
-
04-18-2008, 4:01 PM |
|
|
Re: Problem: XNB files grooowww hugely
Nick Gravelyn:As for you getting smaller files, that's new to me. I've never seen a file get smaller.
If you convert a compressed format like .png or .jpg into uncompressed Color format, the data will get bigger. If you convert an uncompressed format like .tga into compressed DXT format, the data will get smaller. If you care about texture sizes, you should make sure your processor properties are set to use DXT compression.
-- XNA Framework Developer blog - homepage
|
|
-
04-18-2008, 4:07 PM |
-
Cosmos
-
-
-
Joined on 12-07-2007
-
-
Posts 143
-
-
|
Re: Problem: XNB files grooowww hugely
Nick Gravelyn:If you have an text file version of the X model, it will most likely shrink in size since the XNB is a binary format. Binary formats are almost always smaller than text equivalents. So that might explain why you see a gain there. Plus the XNB only stores the data that the processor deems relevant so any extra information or tags or other things like that won't end up in the final file. This can also result in a large cut-down of filesize.
Yep. That makes absolute sense. I think this about model files plus what Shawn said about compresed/uncompresed files explain it all.
|
|
-
04-18-2008, 4:26 PM |
-
Fanboy Junior
-
-
-
Joined on 03-01-2008
-
Brazil
-
Posts 23
-
-
|
Re: Problem: XNB files grooowww hugely
So, there is no solution to this problem :-( However, my last chance to try shrinking those files is using that EasyZip, if that is the only way to shrink the files, I don't have another option except this :-\ I wish with the Next GameStudio 3.0 they solve this problem with a new feature capable to reduce the size of the XNB files, I hope so. Thanks for help!
|
|
-
04-18-2008, 6:32 PM |
|
|
Re: Problem: XNB files grooowww hugely
Fanboy Junior:So, there is no solution to this problem :-(
Sure there is. "If you care about texture sizes, you should make sure your processor properties are set to use DXT compression."If you want you can then use EasyZip to compress your data even further, but switching to DXT format is the easiest place to start.
-- XNA Framework Developer blog - homepage
|
|
-
04-18-2008, 7:05 PM |
-
The ZMan
-
-
-
Joined on 03-19-2007
-
WA, USA
-
Posts 3,190
-
-
|
Re: Problem: XNB files grooowww hugely
Though remember DXT compression is lossy so may blur depending on what i in your textures and can possibly blur any alpha resulting in a non perfect alpha around edges.
The 3rd solution is not to worry about it.... disk space is cheap - are you actually running out?
The ZBuffer - News and information for XNA and Managed DirectX
|
|
-
04-18-2008, 8:22 PM |
-
Fanboy Junior
-
-
-
Joined on 03-01-2008
-
Brazil
-
Posts 23
-
-
|
Re: Problem: XNB files grooowww hugely
Shawn Hargreaves: Fanboy Junior:So, there is no solution to this problem :-(
Sure there is. "If you care about texture sizes, you should make sure your processor properties are set to use DXT compression."If
you want you can then use EasyZip to compress your data even further,
but switching to DXT format is the easiest place to start.
Nice, I will take a look at the DXT format! After you posted here I googled seeking this DXT creator and find some tools from ATI and Nvidia, well, if the result excite me, I will be glad to use that kind of file in my game :-) Thanks
|
|
-
04-18-2008, 8:40 PM |
-
Fanboy Junior
-
-
-
Joined on 03-01-2008
-
Brazil
-
Posts 23
-
-
|
Re: Problem: XNB files grooowww hugely
The ZMan [MVP/Moderator]:Though remember DXT compression is lossy so may blur depending on what i in your textures and can possibly blur any alpha resulting in a non perfect alpha around edges.
The 3rd solution is not to worry about it.... disk space is cheap - are you actually running out?
I guess, if there's no other way to shrink the size of the xnb files, so the only option left is to use the DXT converter, since you want to use a lot of sprites with different aspects (because I want), maybe that is the short way to manage the size of xnb files maintaining them under control. If I found another way to evade this problem, off course I will try, but now, right now this is the quickest option that shows to me
|
|
-
04-18-2008, 9:02 PM |
-
Cosmos
-
-
-
Joined on 12-07-2007
-
-
Posts 143
-
-
|
Re: Problem: XNB files grooowww hugely
You don't need any DXT file converter.
XNA 2 texture content processor does that job for you!. Just select the DxtCompressed in the Texture Format property (see image).

|
|
-
04-19-2008, 8:13 AM |
-
Fanboy Junior
-
-
-
Joined on 03-01-2008
-
Brazil
-
Posts 23
-
-
|
Re: Problem: XNB files grooowww hugely
Cosmos:You don't need any DXT file converter.
XNA 2 texture content processor does that job for you!. Just select the DxtCompressed in the Texture Format property (see image).

WOW thanks,
I did that and the forest.xnb shrink to 1 MB it get smaller than original forest.jpg
EDT - Ok all problems solved, thanks, you helped me alot!
|
|
|
|
|