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.

Dark GDK / Loading taking forever

Author
Message
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 16th Jul 2009 18:51
Just bought a laptop and the game I'm making seems to run fine once everything is loaded, but is seems to take forever to load my models etc... compared to my desktop.

Is there anyway of keeping your models in RAM so you dont have to load them everytime you run your code?

If not, is there anything you can do to speed up the loading process?

I know I can append the model animations so I dont load what Im not using, but is there any other tricks?

While I'm here, why does colonelX and Miko models take same amount of time to load when colonelX has 900+ frames, yet Miko has 40000+?

Thanks for any advice you may have.
Potassium
15
Years of Service
User Offline
Joined: 12th Jul 2009
Location:
Posted: 16th Jul 2009 21:50
If you don't mind, can we see the source for your project or at least see the code snippets. It loads fine on ym computer, and many others I ought to see the source code, before I can help you further.

In this case:
No Source Code = No Help
Morcilla
21
Years of Service
User Offline
Joined: 1st Dec 2002
Location: Spain
Posted: 17th Jul 2009 12:19
Quote: "Is there anyway of keeping your models in RAM so you dont have to load them everytime you run your code?"

I don't think so.

Quote: "is there anything you can do to speed up the loading process?"

Use .dds textures and .dbo objects.
Loading images with mipmapping parameter set to off can speed up the process as well.
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 17th Jul 2009 15:30 Edited at: 17th Jul 2009 15:32
This is my constructor when I create a model:



And this is how I call it.





I dont understand why it takes so long to load on my laptop as I think the CPU is faster and it has more RAM.

I just had a thought but have no time to test it right now, my laptop is widescreen and my game is 1024 by 768.
I have a vague memory of something similar happening before when I changed the screen size it seemed to slow the loading process, I will try messing with it later, anyone else experience anything like this?
Mista Wilson
16
Years of Service
User Offline
Joined: 27th Aug 2008
Location: Brisbane, Australia
Posted: 17th Jul 2009 16:28
Laptop hardware isnt designed to be as powerful at these kinds of tasks as desktop hardware....

I mean 3D calculations and graphics, while there are exceptions with some high end laptops, generally a laptop's harware is required to use less power, generate less heat and be alot smaller than its desktop counterpart(even if its actual "spec" seems higher, it still has to meet the above)... in that kind of situation something has to give...logically if something is as close to as small as it can be and as powerful as it can be in a desktop, shrinking it further to put it into a notebook, means some things have to be removed(unless you've won the lottery or somethin lol).. so it will take longer for your notebook's graphic card to process all the 3d info than it would for you desktop...

To speed it up, keep your graphics drivers as current as you can, if your notebook is lucky enough to have an nvidia or ati model card, you are lucky as they generally update their drivers pretty regularly, make sure that your hard disk is defragmented to reduce thrashing while loading from the disk aswell.

In terms of your actual game, I can only suggest that using the smallest possible media, like, use the image format for textures, that you can get the most compression from(or alternatively that you can load the fastest, sometimes being compressed isnt better for speed) - when your models are designed, try to make them with as few poly's as you can while still looking how you want. Using a smaller size texture, instead of loading say, 512x512 textures for your models, use a lower resolution.. 128x128 or 256x256 will speed up loadtimes aswell, although wont look as nice obviously.

If it ain't broke.... DONT FIX IT !!!
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 25th Jul 2009 17:10
That screen size idea was from when I was messing with directX, you have to be alot more careful, but with DarkGDK it doesn't seem to be an issue.

Thanks for your reply Mr Wilson, you must be right, the specs are better on my laptop but obviously something is giving somewhere, my model is only about 3.5 Meg and it seems to take forever to load, I have 4 Gig of RAM, so like you say, it must be loading them into the graphics memory and thats what is slow, I dont really know enough to completely diagnose the problem.

I will just work on other aspects of my game on the laptop and use my desktop when it comes to the models.

Sorry about the delay in the reply, I was on holiday.
Mista Wilson
16
Years of Service
User Offline
Joined: 27th Aug 2008
Location: Brisbane, Australia
Posted: 25th Jul 2009 20:43
no worries mate, I hope you can find a workaround that will let you work at a decent pace without waiting too long each time you want to compile to test something....

Maybe you could try using placeholder models while you are developing on your laptop ? very low poly stnd-ins kind of(the models that come with DarkGDK have some low poly ones in there that make great placeholders), they might load quicker than your normal model... of course, anything that is intensive graphically may slow it down, if loading a model does then things like shaders will definately.

If it ain't broke.... DONT FIX IT !!!
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 28th Jul 2009 00:20
A twist....

When I create a release and run that on my laptop it loads the model very quickly, now I'm completely confused.com
the longest thing to load is now my map which is about right, but even inside my VS project the map loads normaly, its just the model(col-X) that takes forever.

Anyone have any ideas?


Thanks for the advice Wilson, I will use a place-holder model if I cant get to the bottom of this.
Mireben
16
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 28th Jul 2009 10:27 Edited at: 28th Jul 2009 10:29
I have also noticed that loading X models takes forever from inside Visual Studio, but they are fast to load when the EXE is running on its own. (I have a laptop too.) My guess was that the models and VS are somehow fighting for resources, but it never occurred to me that it behaves differently on a desktop and on a laptop. Using placeholders was my solution too, maybe combined with #ifdef statements to make compilations with placeholder or the final model.
Potassium
15
Years of Service
User Offline
Joined: 12th Jul 2009
Location:
Posted: 28th Jul 2009 15:34 Edited at: 28th Jul 2009 15:35
Here's a tip:

DON'T LOAD MODELS INSIDE THE MAIN LOOP!

The reason is that when you do the program can lag because it is repeatedly loading the same model. Just place all the loading outside of the main loop.

So...load the models outside of the main loop, but do animations and game logic inside the main loop. Same for images, load outside the main loop.

Summary:
Load Images, Models - Outside of Main Loop

Try that and see if their's improvements.


Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 28th Jul 2009 16:15
@Potassium - If you loaded your models inside your loop your frame rate would be 1 frame every 5 seconds or so, forget 60 FPS lol.
I can't believe that you think we could be loading our models over and over again, unless I have misunderstood some aspect of your post.

Thanks for trying to help though, any input is much appreciated.

@Mireben - So its just X models? if so, then at least we're making a little progress with this issue. I'm going to try a few things and I will update if I find a solution.
dark coder
21
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 28th Jul 2009 17:43
I'd guess because the GDK static lib was compiled with debugging information thus that gets run when running with debugging, whereas .dbo files don't use the D3DX code to load.

Mireben
16
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 28th Jul 2009 19:01
Quote: "@Mireben - So its just X models? "

I tried X and 3ds format and both were slow. I haven't tried the dbo format.
Mista Wilson
16
Years of Service
User Offline
Joined: 27th Aug 2008
Location: Brisbane, Australia
Posted: 29th Jul 2009 00:58
Definately give the DBO format a try, ive had some large speed gains when loading that format natively compared to the same model in an .X format. And I've heard other people also noticing some really large speed gains in GDK and DarkBasic when using the DBO format...

It might be a case of doing some timing tests with various formats, then write a small model converter utility to convert the models into whichever format you get the best performance out of. You can save DBO format objects from GDK once they are loaded.

As for a reason, GDK is internally converting the data structures of the model into its DBO format(and setting up its internal pointers and variables and what not), when you access a models internal info from inside GDK, you access it via its DBO structures and variables, whether it was loaded as a .X or a .DBO. Using dbGetObject you get a pointer to the object's internal data and can set it manually. The data that you are altering from inside GDK matches upto what is in the DBODATA.h file.

I dont know why though, it would be slower to do that inside visual studio than when being run outside VS.(not in debug mode, of course it will run slower in debug mode - its tracking a heap of data about the program while it runs) I would think running in release mode inside visual studio would be at least very close to the same as outside, in reltation to loading.

If it ain't broke.... DONT FIX IT !!!
Kaboooom2000uk
15
Years of Service
User Offline
Joined: 1st Aug 2009
Location: England, United Kingdom
Posted: 5th Aug 2009 06:21
Quote: "Quote: "Is there anyway of keeping your models in RAM so you dont have to load them everytime you run your code?"
I don't think so."


I can help you if you wish to make a ramdisk to store your models. there is a tool you can get from Qsoft, It allows you to add a virtual ramdisk that can be accessed from my computer.

The size can be adjusted, as well as format in the device manager. It will appear in your list of devices, and show up as RAMdisk by Qsoft. open the properties of it, to adjust the prameters.

Just make sure you have a few GB of ram to spare.. The min size is about 1MB.

http://members.fortunecity.com/ramdisk/Download/download_and_001.htm

or the main page.

http://members.fortunecity.com/ramdisk/RAMDisk/ramdriv001.htm

If your lucky like me, to have a server board with 32GB of ddr2 then you can make some rather fast transfers, im talking 2000Mb/sec as its only limited to the bus between the CPU and ram.

Sorry if its a bit off subject, but just thought I provide some facts about ramdisks.

Hope this helps!

Login to post a reply

Server time is: 2024-10-06 09:21:21
Your offset time is: 2024-10-06 09:21:21