-
-
Notifications
You must be signed in to change notification settings - Fork 152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
setHidden() is broken in multiple ways #253
Comments
Bloodknight
added
QoL Enhancement
Non functional enhancements that make work easier (New or improved UI parts for example)
and removed
QoL Enhancement
Non functional enhancements that make work easier (New or improved UI parts for example)
labels
Aug 9, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Just putting this here for future reference. @Azaezel and I were working on this a few weeks ago but I'm not sure we found a conclusive fix.
Quick summary of the problems with setHidden():
1). Parts of the engine assume that setHidden() is an editor-only function that will only be called while the world editor is open (see SimObject::setHidden()). This results in weird behavior like hidden objects being rendered when the mission is reloaded, setHidden() not working at all on certain classes (like StaticShapes and Precipitation), etc.
2). The engine 'hides' an object by just removing it from the scene manager which conflicts with how objects are ghosted. Objects marked GhostAlways typically hide/show correctly for all clients due to the ghost objects being forcibly removed but objects that are marked Ghostable won't have their 'hidden' status propagated correctly. This results in desyncs and issues with things like collision (client thinks the object is visible & collidable but the server doesn't).
The world editor deals with this issue by manually calling setHidden() on every clientside ghost (see WorldEditor::onEditorEnable).
The text was updated successfully, but these errors were encountered: