Skip to content
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

Closed
wants to merge 2 commits into from

Conversation

Winterleaf
Copy link
Contributor

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.

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.
@dottools
Copy link

dottools commented Nov 6, 2014

Looks good I see no problems.

@Winterleaf
Copy link
Contributor Author

Of course! I wrote it :P

@crabmusket
Copy link
Contributor

Thanks for revising it to be a property of the GameConnection :).

I'd much prefer to lose both the #defines and the additional imports of torqueConfig.h. If the ghost visible distance is set to 0 then the current behaviour (visible distance scoping) should be used.

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 #defines without good reason (i.e. inability to compile on multiple platforms).

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.

@Winterleaf
Copy link
Contributor Author

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),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tabs bad :(.

@crabmusket
Copy link
Contributor

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.

@Winterleaf
Copy link
Contributor Author

If I remember right it had to do w the distance to the camera and angle.

@crabmusket crabmusket added this to the 3.7 milestone Nov 7, 2014
@@ -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;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reason behind change?

Copy link
Contributor Author

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

Copy link
Contributor

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 #defines and fall back to visibleDistance if no ghost distance is defined. Acceptable?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds fine

Copy link
Contributor

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.

@crabmusket crabmusket mentioned this pull request Dec 7, 2014
@crabmusket crabmusket closed this Dec 7, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants