Will hide() work?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By HatEm
:warning: Old Version Published before Godot 3 was released.

I’m making a challenge for myself to make an open world kind of 3D game as fast as possible, I did some tests but the only thing I’m concerned about is optimizing the game; I’m gonna use VisibilityNotifier but I don’t know what to do with the exit_screen signal, Will hide() and show() do the job of optimizing the game or what is your suggestion?

i hope i did understand your question correctly :slight_smile:

exit_screen signal will be fired if the object is exits the screen. usefull if the object has a script attached to it that you dont need when not visible. you can then set processing false.

if you use hide() objects will not get rendered and thus your fps will go up. but your object will still be in the memory. if your world is huge (memorywise) show/hide will not be sufficent.

to save memory you could seperate your map into chunks and load only the surrounding chunks into the memory. im not 100% sure but i think godot does not render stuff that is offscreen. if im right you dont need hide/show for performance.

additionally you can try to implement LOD via the options Range begin and Range end. its pretty easy to do but you need multiple LOD models

ingo_nikot | 2016-12-13 01:26

Setting process false seems to work well (for the challenge at least) and I think that Godot doesn’t render objects that aren’t on the screen like you said, make your comment an answer so I can choose it

HatEm | 2016-12-13 17:05

make your comment an answer so I can choose it

sry i dunno how to do that, i can only repost it again as an answerif you wish so.

ingo_nikot | 2016-12-13 20:35

Yeah I meant copy paste

HatEm | 2016-12-14 00:07

:bust_in_silhouette: Reply From: ingo_nikot

i hope i did understand your question correctly :slight_smile:

exit_screen signal will be fired if the object is exits the screen. usefull if the object has a script attached to it that you dont need when not visible. you can then set processing false.

if you use hide() objects will not get rendered and thus your fps will go up. but your object will still be in the memory. if your world is huge (memorywise) show/hide will not be sufficent.

to save memory you could seperate your map into chunks and load only the surrounding chunks into the memory. im not 100% sure but i think godot does not render stuff that is offscreen. if im right you dont need hide/show for performance.

additionally you can try to implement LOD via the options Range begin and Range end. its pretty easy to do but you need multiple LOD models