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.

Newcomers DBPro Corner / exclude object VS hide object

Author
Message
mr Handy
17
Years of Service
User Offline
Joined: 7th Sep 2007
Location: out of TGC
Posted: 17th Jan 2014 21:17 Edited at: 17th Jan 2014 21:25
Hi! What is best way: to 'hide' or to 'exclude' object? I have read that speed is the same in both cases but you have benefits of deleting object with 'exclude'. Then why does 'hide' still exist? For compatibility? Also in rare cases I saw both commands in use on same object.

Derek Darkly
13
Years of Service
User Offline
Joined: 22nd Sep 2011
Location: Whats Our Vector, Victor?
Posted: 17th Jan 2014 22:03
I thought EXCLUDE OBJECT ON only removed the object from multi-object loops but still rendered the object to the screen.

...or are you taking about a different type of EXCLUDE?

D.D.
mr Handy
17
Years of Service
User Offline
Joined: 7th Sep 2007
Location: out of TGC
Posted: 17th Jan 2014 22:10
It also excludes from rendering.

Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 18th Jan 2014 16:42
I think it excludes it from all processes, whereas hide object merely hides it but still gets processed in other calculations.

Yup, sounds like I'm correct.

HIDE OBJECT
This command will hide the specified 3D object from view


EXCLUDE OBJECT ON
This command will remove the object physically from any loops involving multi-object checking, used to increase performance in scenes that use a large quantity of redundant objects in memory.

mr Handy
17
Years of Service
User Offline
Joined: 7th Sep 2007
Location: out of TGC
Posted: 18th Jan 2014 20:35
As I thought. But why then Hide is not obsolete?

Rudolpho
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 18th Jan 2014 22:05
Assume you're still using box objects for collision checking or a dummy object positioned slightly above your player that the camera follows. There hiding would be better suited than exclusion.
Of course, it isn't very probably you would use the built-in collision functions or the automatic "following" camera these days but still


"Why do programmers get Halloween and Christmas mixed up?"
mr Handy
17
Years of Service
User Offline
Joined: 7th Sep 2007
Location: out of TGC
Posted: 19th Jan 2014 00:12 Edited at: 19th Jan 2014 00:15
Now that makes a lot of sense! Then I believe the best way is to always use 'exclude' until it break something and in that case use 'hide'.

Derek Darkly
13
Years of Service
User Offline
Joined: 22nd Sep 2011
Location: Whats Our Vector, Victor?
Posted: 19th Jan 2014 15:40 Edited at: 19th Jan 2014 15:47
Quote: "It also excludes from rendering."


Oh.. well that seems kind of silly. The visual exclusion should have been left to HIDE OBJECT alone.

Let's say I have an NPC who becomes invincible (just humor me here) so I want to exclude him from damage and all other checks, yet keep him visible. EXCLUDE OBJECT ON would have been great except for the hiding part.

I suppose if you turn exclude on, do your checks, then turn it off before the screen update then the object would still be rendered, eh?

Nevertheless, we could easily use a simple flag to say if an object should be included in a certain check or not.

D.D.
Rudolpho
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 20th Jan 2014 10:48
Exclusion of course causes it to be omitted from the rendering loop as well so can't really have that.

Like you say for what you want you would just keep a flag for that yourself. As for the built-in loops of DBPro (such as that in pick object, etc.) they really should accept a custom array rather than just contiguous start and end ID's, but that's another matter I guess.


"Why do programmers get Halloween and Christmas mixed up?"

Login to post a reply

Server time is: 2024-11-23 15:15:28
Your offset time is: 2024-11-23 15:15:28