Quote: "Very interesting point regarding the hide object command. I thought when you hide an object it would take up less processing time because it doesnt have to render the graphics each loop"
Hiding the object will improve processing time because the processor does not have to render the object.
And yes, it will exist in memory even if it is hidden. This can affect performance but only when the memory use is tight. If the processor has to deallocate and reallocate several chunks of memory to try and squeeze as much free memory out of your machine, then you'll notice a performance hit - bascially as you run out of memory, the machine will slow down because it has to figure out ways to manage dwindeling resources - not likely to happen unless you have very little memory to start with, or you have huge amounts of objects and/or media. If the object is being displayed, it of course uses more memory than it does being hidden and if it's displayed, the processor has to perform all the necessary math and fire off the correct pixels etc.
So in short, hiding objects improves performance. If you take managing object resources a step further, only create the objects at the point that they are necessary, and remove any that won't be needed. Do not however, constantly create and delete the same objects in succession over and over, because deleting and creating an object over and over takes more processing time than hiding and displaying the object. If you won't be using some obejcts for a while, delete them. And don't create them until you actually need them.
Quote: "it will need to remember there is an object there but didnt think it would take up the same time"
Unless you actually reference the hidden object, the processor doesn't have to deal with it. In DirectX, the objects are stored in memory and referenced by an address held in a pointer - which is really just a variable. If you don't call the pointer with some object command in DB, the object will still be sitting in memory, but the processor doesn't have to do anything. Once you reference that object, then the processor has to do something with it.
Note the screen fps change in the following example that displays or hides 200 spheres.
sync on
sync rate 0
for n=1 to 200
make object sphere n,50
next n
do
text 0,0,"Press space to toggle hiding or showing spheres"
if spacekey()=1
repeat
rem wait for spacekey to be released
until spacekey()=0
hitspace=1-hitspace
gosub toggle
endif
if hitspace=0
text 0,40,"Showing 200 spheres"
else
text 0,40,"Hiding 200 shperes"
endif
text 0,60,"FPS :"+str$(screen fps())
sync
loop
toggle:
if hitspace=1
for n=1 to 200
hide object n
next n
endif
if hitspace=0
for n=1 to 200
show object n
next n
endif
return
Enjoy your day.