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
This adds limiting the ghost data to a specific area around the client. #908
Conversation
By default it is not included in the build, you must #define GHOSTSCOPING in the torqueConfig.h to enable it. The distance can be set via the mission file by adding visibleGhostDistance = "1000"; Or if it is not set in the mission file it will default to what is defined in torqueConfig.h #defined as GHOSTSCOPING_DEFAULT_DISTANCE_IF_NOT_IN_MISSION The mission default distance can be overridden on a per connection basis by using gameconnection:setVisibleGhostDistance and gameconnection:getVisibleGhostDistance The logic for setting the scoping distance was moved from shapebase in the original design to SceneObject so that it will affect cameras, players, etc.
Looks good I see no problems. |
Of course! I wrote it :P |
Thanks for revising it to be a property of the I'd much prefer to lose both the Ooh, I see, this may interfere with the current behaviour with defaults of 0. But I'd really prefer to not have features barred out using EDIT: So currently, you can set the visible ghost distance in the connection, and if that's zero, it can be overridden by the distance in the level info. Maybe we need one additional step - if that's also zero, use the visible distance. |
I’ve received word from a user that it causes issues with sidescrollers. Thus the reason I #defined it. |
@@ -77,6 +79,9 @@ static SFXAmbience sDefaultAmbience; | |||
LevelInfo::LevelInfo() | |||
: mNearClip( 0.1f ), | |||
mVisibleDistance( 1000.0f ), | |||
#ifdef GHOSTSCOPING | |||
mVisibleGhostDistance (200.0f), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tabs bad :(.
Interesting. Any chance you could point them to this discussion? I'd love to know what these issues were and how we could reproduce them. There is probably some underlying problem that also needs to be solved. |
If I remember right it had to do w the distance to the camera and angle. |
@@ -388,7 +388,14 @@ F32 GameBase::getUpdatePriority(CameraScopeQuery *camInfo, U32 updateMask, S32 u | |||
// Weight by field of view, objects directly in front | |||
// will be weighted 1, objects behind will be 0 | |||
F32 dot = mDot(pos,camInfo->orientation); | |||
|
|||
#ifdef GHOSTSCOPING | |||
bool inFov = dot > camInfo->cosFov*1.5f; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reason behind change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it gets ride of the jitters on the edge of the camera view when objects are on the edges
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it. I'm modifying this PR to get rid of the #define
s and fall back to visibleDistance
if no ghost distance is defined. Acceptable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds fine
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See #1018, and in particular this commit for what I changed in your code.
By default it is not included in the build, you must #define GHOSTSCOPING in the torqueConfig.h to enable it.
The distance can be set via the mission file by adding
visibleGhostDistance = "1000";
Or if it is not set in the mission file it will default to what is defined in torqueConfig.h #defined as GHOSTSCOPING_DEFAULT_DISTANCE_IF_NOT_IN_MISSION
The mission default distance can be overridden on a per connection basis by using gameconnection:setVisibleGhostDistance and gameconnection:getVisibleGhostDistance
The logic for setting the scoping distance was moved from shapebase in the original design to SceneObject so that it will affect cameras, players, etc.