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 Discussion / DBC: Is deleting unnecessary objects better than hiding them?

Author
Message
HWT
20
Years of Service
User Offline
Joined: 1st Apr 2005
Location: Earth
Posted: 26th Nov 2005 15:24
I would be really grateful if anyone could answer this question - is it better to delete unnecessary objects or will just hiding them have the same effect?

I ask this question with respect to frame rate primarily.

I am actually trying to accomplish 'loading' an internal scene when the player wants to enter the building (i.e. like a loading barrier).

Thank-you kindly

HelloWorld Tommorrow
Zotoaster
20
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 26th Nov 2005 15:59
I would say deleting them is better, because then not only does it not have to draw them / make the object, but it also clears a space for other objects, i.e. in my game all the level objects are object number 10, I just delete and reload my level before I change the level

blanky
20
Years of Service
User Offline
Joined: 3rd Aug 2004
Location: ./
Posted: 26th Nov 2005 16:00 Edited at: 26th Nov 2005 16:01
Hiding an object will improve the frame rate, as long as you haven't loaded too many objects to begin with.

Re-creating an object (after deletion) would cause a visible pause in your program, so as long as you've got enough video memory in your machine to make it feasable I would recommend just hiding objects that you can't see.

[Edit] Huh... Well, if the user isn't going to see the outside objects when you're inside the building them then deletion *would* be better, I guess... [/Edit]

16-colour PNGs pwn.
SimSmall
20
Years of Service
User Offline
Joined: 7th Aug 2004
Location: United Kingdom
Posted: 26th Nov 2005 17:38
do some planning. break your game down into levels and sub-levels.

If you're going to use that object again in this level, then just hide it, otherwise as blanky said, you're going to notice a slowdown when you reload it.
If you need it this level, but you've reached your object limit (very unlikely), EITHER, add a break in to the level, flush all the objects out, and reload just the ones you're going to need. OR flush out your larger objects that aren't required for the rest of the level/sub-level (thing), deleting objects is virtually instant, and substitute them for your new objects (not recommended if your new objects are big, due to the hated slow down)

Most players I would assume would rather spend longer in a loading screen waiting for objects to load than have sluggish performance during the game because you're substituting objects during the level

...maybe one day I'll finish a project
HWT
20
Years of Service
User Offline
Joined: 1st Apr 2005
Location: Earth
Posted: 26th Nov 2005 20:06
I'm not using many objects.

Just 1 whole object for each level (internal/externals alike). They aren't high-polygon models.

What I am trying to acheive is a smooth transition from 1 object to another so that it seems as if there is no loading going on while keeping the frame rate as high as possible.

Quote: "Hiding an object will improve the frame rate, as long as you haven't loaded too many objects to begin with."

I think that you are right. Even though deletion will work good - I need as quick a loading time as possible.

Thank-you all very much for your help

HelloWorld Tommorrow

Login to post a reply

Server time is: 2025-05-22 20:08:30
Your offset time is: 2025-05-22 20:08:30