Game Development Community

Preload Materials

by Matthew Hoesterey · in Torque X 2D · 11/09/2009 (2:29 am) · 62 replies

I have a question about preloading materials in torque. I'm trying to improve load times and was wondering. When preload materials is set to true does torque only load the materials that are used in the .txscene or all the materials in all levels?

Thanks for any info.
#41
12/28/2009 (2:31 pm)
fyi: the latest edition of the book is 2nd Edition, so make sure that's the one you ordered (it's easy to change an order on amazon if you need to).
#42
12/28/2009 (2:58 pm)
Great I got the right one. :)
#43
12/29/2009 (12:21 am)
I had a reference tell an employer "Look at Henry's code before you give it to a client", I tend to write thing in there that make me laugh, clients not so much. : )
#44
12/29/2009 (11:02 am)
LOL, I can Imagine. A few of my comments prolly are not so pc in some of my code as well. Luckily any code I do at my real job never leaves the department, usually just a tool to implement design faster.
#45
12/30/2009 (2:19 pm)
Hi Matt,

the sw works just great, thanks. At any rate my first level (not even complete!) on the Xbox takes 3 MINUTES to load! On the PC 2 seconds... :( I cannot understand this issue so I'm now investigating into TX source code trying to get a grip on this.

If anyone has any knowledge on this any pointer wil be appreciated.
#46
12/30/2009 (2:41 pm)
Heya,

Load time issues on the xbox are caused by a problem with how the .ccfiles are packed. Apparently the xbox has a seek time problem till you ship your game. Once shipped your load times will decrease by up to 10 times. You can't test this till your game is approved though :(.

One thing you can do. Right now the seek time problems cause the xbox to take about 300ms to find a file and then only a few ms to open it. So if your loading a ton of separate materials try combining them into huge texture sheets. Also if you have a ton of sub-directories reducing the number will reduce load times.

To give you an Idea I had a 60 sec load time. 4 characters with around 30 1024x1024s each.

I consolidated these character textures onto 8096x1024 (would have gone 8096x8096 but the builder crashes with a y greater then 1024 yay torque) and my load time reduced to 15 sec.

Once shipped it should go down by even more. :)

Microsoft has stated that they may not be able to fix this load time problem so we may need to live with it. :(
#47
12/30/2009 (3:22 pm)
Quote:
Right now the seek time problems cause the xbox to take about 300ms to find a file and then only a few ms to open it.

That's useful information mat, thanks.


One way to speed things up is also to test by running the game from the dashboard - it's not quite a 10x speed increase, but it's something at least (two or three times maybe - and prob mainly due to no VS/debug overheads rather than seek time improvement).

#48
12/30/2009 (5:31 pm)
Well... 3 minutes are counted running the game from the dashboard :(

I'll try to consolidate the materials the best possible way... I'll post the results here once I've done.

Thanks!
#49
12/30/2009 (6:20 pm)
Yep, 3 mins is a really long time - There's something seriously not right there. For reference I can load enough materials to get an out of memory error on xbox and it takes less than 10 seconds (170 separate image files).

Maybe your txscene files are really big/complex? If so then hopefully you'll get the promised 10x speed up with the released version of the game.
#50
12/30/2009 (8:17 pm)
Hi Duncan,

actually there is nothing complex at all... have a look to my YouTube channel to get an idea of what I'm working on: quite simple stuff till now. Ok... every sprite on the screen has normal maps, but I hope that'll not be the issue.
#51
12/31/2009 (10:19 am)
I heard that the load time problem I mentioned above doesn't happen with all Xboxs and depends on the hardware version of the Xbox.

I actually never had load time issues until my Xbox red ringed and they sent me a new one. :( So there may be inconsistency across xboxes. For more info on the load time problems make sure to check out the xna forums. People have had games that load in 4 min load in 10 sec once released in the most extreme cases.

Another thing to check is particle systems. I'm not sure how many you have active in your torque x scene but I've found that they add more to the load time then you might expect.

Have you tried hooking a profiler to the project? In one case I found just changing the way I had a if statement nested in my collision code saved me 25% of my processor power in one case 0_o. Maybe you have some-type of hidden performance problem.

#52
12/31/2009 (12:43 pm)
That's interesting mat. My current xbox is one of the newer ones (Jasper) so maybe that helps. Certainly 170 files seeking each one at 300ms would be a 51 second load time compared to the sub 10 that I'm actually getting (which is easily hidden by the startup splashscreens anyway).

It's pretty awkward that there is such a big discrepancy between games in dev and released games though - hopefully MS can do something about it or at least officially recommend which versions of xbox are subject to big load time issues and which aren't.
#53
12/31/2009 (2:13 pm)
Ya Sadly Last I heard Microsoft said that they had no current way to fix the problem.

It is very frustrating. It wouldn't be as bad if there was some way to test to find your "real" load times.

Here is one of the main posts on the file seek time problem:
http://forums.xna.com/forums/p/34364/197775.aspx#197775
#54
12/31/2009 (3:05 pm)
That's an interesting thread. This post in particular caught my eye: http://forums.xna.com/forums/p/34364/197837.aspx#197837

It does sound as if the the issue does disappear on release - although it's not great to have that issue in peer review hopefully games can't be failed for it.
#55
02/23/2010 (3:39 pm)
This thread should be stickied!

Joshery
#56
02/28/2010 (9:01 pm)
Just an FYI the utility doesn't remove LightingMaterial that isn't being used in the scene... I think I'm going to go venture into the code to see if I can change that.

Joshery
#57
03/03/2010 (11:36 am)
Heya Josh. If you've updated it let me know and I'll post the update in the resource. I can add this functionality easy enough though. :) I'll try to get to it by early next week. :)
#58
03/03/2010 (3:30 pm)
I did, what's the best way to get it to you?

You can email me:
joshery (at) msn.com
#59
03/03/2010 (9:11 pm)
Uploaded the material ripper update. Thank Josh for the Lighting Material Update. The material Ripper now Rips out unused Lighting materials from levels too.

www.mhoesterey.com/TorqueX/TorqueXLevelMaterialRipper.rar
#60
05/28/2010 (3:05 am)
cool, any chance this can be packaged as a zip file?