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 / Loading objects faster?

Author
Message
CumQuaT
AGK Master
16
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 27th Mar 2011 18:27
Hi all,

Another odd problem here... Is there a way to load objects fast that I'm missing?

Well... To be precise... Duplicate them. I'm trying to create a scene built out of 5 different models. Each a .X file that is between 2kb and 73kb using jpeg textures that are all under 300kb each. These 5 items are being duplicated multiple times to create the in-game world using the CLONE OBJECT statement.

In total there ends up being 400 copied objects, with a total polygon count of around 140,000 and while the engine is running I am executing a function to hide objects that are either too far away from the viewer or not in the screen at the time. While the objects are being loaded before the main loop, however, they are being hidden straight away to try and conserve memory.

However, despite the model files and texture files being quite small, and despite the textures being small, and despite the polygon count being more than acceptable, the program still takes about 5 to 7 minutes to go through and clone all of the objects.

I have run into a similar problem before, but I found out that I had put a SYNC command in the loop that loads up all of the objects, which was slowing it down. However that is not the case this time around.

Playing around with it, it's not the loading in of the model files that slows it down, but the function that clones them all.

Also, I should add that it's not because I'm on a slow computer. I'm running the latest Alienware m17x Mk3 with a 3.33GHz quad core i7 processor, 1.5GB nVidia GTX 460M and 8GB DDR3 memory.

Has anyone had this same problem? If so, I'd love to hear your thoughts on why it's going so slow...

As always, if you need more info, please let me know and I'll do my best.

Malevolence: The Sword of Ahkranox
The infinite RPG
http://www.msoa-game.com
Max P
16
Years of Service
User Offline
Joined: 23rd Jan 2010
Location:
Posted: 27th Mar 2011 19:07
You can try to use instance object instead of clone object, it is faster but has some limitations since it is sharing some data with the source object.
Brendy boy
20
Years of Service
User Offline
Joined: 17th Jul 2005
Location: Croatia
Posted: 27th Mar 2011 19:46
instead of cloning them try instancing them, that should be much faster

CumQuaT
AGK Master
16
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 28th Mar 2011 06:59
Hi guys.

I should have put it in my original post, but I did actually try that without success

Malevolence: The Sword of Ahkranox
The infinite RPG
http://www.msoa-game.com
revenant chaos
DBPro Master
19
Years of Service
User Offline
Joined: 21st Mar 2007
Location: Robbinsdale, MN
Posted: 28th Mar 2011 08:08
If instancing (rather than cloning) the objects doesn't speed it up at all, then there must be something else going on. My engine does the same thing as you are describing and I have no problems at all.
What format are your models? .DBO objects load much faster than the others, but I don't think that will help with your cloning.
Have you used Sync On, or are you letting DBpro sync for you?
CumQuaT
AGK Master
16
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 28th Mar 2011 08:29
Hi RC.

I am using .X models, and all are quite small and low poly. I have also tried .3ds as well.

I have Sync On and am manually syncing using CometSync, though not during the model cloning phase. Only during the main loop.

Malevolence: The Sword of Ahkranox
The infinite RPG
http://www.msoa-game.com
CumQuaT
AGK Master
16
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 28th Mar 2011 08:30
I've also tried running it without using any textures and it takes the same amount of time. I've also tried it with all object parameters off (set shadow shading, etc, etc) and it still does it. It's very strange...

Malevolence: The Sword of Ahkranox
The infinite RPG
http://www.msoa-game.com

Login to post a reply

Server time is: 2026-07-16 23:19:21
Your offset time is: 2026-07-16 23:19:21