Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Slow Resource Loading - What to do..

Author
Message
Paronamixxe
AGK Bronze Backer
14
Years of Service
User Offline
Joined: 10th Feb 2012
Location: Sweden
Posted: 2nd Jun 2012 01:48
Ok, I have started delving into 3D coding now, and realized that, with barely a fraction of the 3D content that will be needed being loaded, it takes around 20 seconds / 30 seconds before it even starts rendering.

I have 7 'groups of code' which are like this:


and this takes ages to load, Please help, otherwise my game will take minutes before you can even see the login screen :/

If you can like increase the ammount of RAM allocated to the program, or load objects in a smarter way?

//Anton
Sergey K
22
Years of Service
User Offline
Joined: 4th Jan 2004
Location:
Posted: 2nd Jun 2012 01:51
i belive you trying to load a too high poly count model?
if so..
its not a movie where u can use the highest polygon objects.
its a game! and for that u need a low poly models.
optimize your mesh to the minimum, then use shaders to make it look like high poly model.

Advanced Updater for your games!
Benjamin
23
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 2nd Jun 2012 09:46
I'm not 100% sure on this but I believe DBO and DDS are the quickest-loading formats, so try to use them instead.

If you are loading several copies of the same object you can instead just load one and use CLONE OBJECT or INSTANCE OBJECT to make a copy.



Support a charitable indie game project!
Paronamixxe
AGK Bronze Backer
14
Years of Service
User Offline
Joined: 10th Feb 2012
Location: Sweden
Posted: 2nd Jun 2012 11:39
Im am loading different buildings here, and yes, I beleive that they are high-poly. But how can I reduce the count and use shaders??

THanks in advance!

//Anton
Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 2nd Jun 2012 11:58 Edited at: 2nd Jun 2012 12:00
Buildings are mostly boxes, so high poly buildings are a waste. And normal maps are quite easy to make. If you are careful you can make a greyscale map, and convert it to a normal map in photoshop with the Nvidia plugin.

Fallout
23
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 3rd Jun 2012 23:13
It might be worth changing your images to PNGs to see if they load faster too.

Mage
Valued Member
19
Years of Service
User Offline
Joined: 3rd Feb 2007
Location:
Posted: 4th Jun 2012 10:54 Edited at: 4th Jun 2012 11:05
Some helpful design principles.

1. Make Sure You Aren't Reloading The Same Resources
Keep track of whats loaded already, clone existing objects and texture using existing images before loading new ones.
This will keep the memory footprint efficient and you can skip massive heaps of load times.

2. Preload Resources You Know You Need
Don't load monsters on the fly in real-time, load them all ahead of time. If at all possible, some games don't have load screens.

3. Cache Resources You Know You Might Need
Have a copy of the object loaded even if it's not being used. Then clone or instance the object when needed instead of loading it. For example suddenly you need 100 bits of debris for an explosion, or you need 10 Monsters loaded now. If you have a guy with a Rocket Launcher, cache the rocket.

4. Use Enhanced Animations Addon
You can attach animations to objects without having to load them from a file each time. Also keep animations spread out on multiple "animation objects/files" so the process of attaching animations to your objects can be shorter if managed well. Object files for your game characters shouldn't have the animations bundled into the same file for this reason. TLDR: Cut down on what needs to be loaded.

5. Manage And Prioritize Sounds
If there are too many sounds to load all at the same time, keep track of how often they are played. Keep the more frequently used ones loaded using a priority system. Build in priority levels, since some sounds might be known to be needed, or take a very long time to load, where you might want to ensure it stays loaded. In the body of the game only use Customized Functions like PLAYGAMESOUND(Pathname$), let your priority system handle the details, that way you aren't juggling loaded sounds everywhere in the body of the game code.

Paronamixxe
AGK Bronze Backer
14
Years of Service
User Offline
Joined: 10th Feb 2012
Location: Sweden
Posted: 4th Jun 2012 21:38
What a mamoth post! Thank you, I'll definitely be able to use this effectively! Although, I am using pre-made .x models (talking about animations here) and therefore the animations and model are in the same file. However, at the moment I only have 7 buildings which donot have any animations and only one jpg image being loaded onto each one. It might be worth noting that they are separate buildings. As I am going to need a load more, I was just wondering how I could make these files load quicker. But thanks for the other stuff Mage, I will use that aswell

//Anton

Login to post a reply

Server time is: 2026-07-08 05:38:53
Your offset time is: 2026-07-08 05:38:53