-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Changes in fov resolution #3071
Conversation
Hooray Jenkins reported success with all tests good! |
@@ -97,7 +97,7 @@ | |||
private LocalPlayer localPlayer; | |||
@In | |||
private WorldProvider worldProvider; | |||
private Camera playerCamera; | |||
public Camera playerCamera; |
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.
Why this change?
From the PR alone it seems unnecessary. If it's needed elsewhere it's good practice to comment your own PR about changes that might be puzzling. 😉
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.
The camera present here is needed in another system. Thats why made is public, though a getter method would have been better. But the camera is to be refactored in coming months so i just did it public.
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.
How about you get it from the WorldRenderer then? It's the object that instantiates the camera in the first place and you can find it on the Context/CoreRegistry. No point in going through intermediaries if it can be avoided.
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.
Yeah, that would be better. But @In
annotation doesn't work on WorldRendererImpl
. I think i will need to get it directly from context. Will make the changes today :)
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.
Getting it from the Context is even better. In theory, having spoken with Immortius some time ago, we'd like to move away from annotation-based injection and use the context (and sub-contexts) more widely.
That been said:
@In
private WorldRenderer worldRenderer;
doesn't work? It should.
} else { | ||
playerCamera.resetFov(); | ||
if(charMovementComp.mode != lastMode){ | ||
if (charMovementComp.mode == MovementMode.GHOSTING) { |
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.
And by the way, what's the GHOSTING mode?
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.
IIRC it is literally the ghost
movement mode you can enter via the game console. It changes the camera a bit.
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.
Yeah, cervator is right. Previously it used to change the camera as per the mode in every loop. Now it changes the camera only when the mode is changed.
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.
Ah, thank you. I can see where the "ghost" term comes from - going through walls.
I wish we could find a term that was a bit more explicit in its meaning. But perhaps just a short comment beside the constant in MovementMode would help. I.e.
GHOSTING(0f, 4f, false, false, false, 5f, true), // enables flying and going through solid surfaces
I checked and it seems the only mode that is somewhat ambiguous.
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.
noclip
is the traditional meaning for a 'ghost' (travel through things) mode in engines, if you are looking for a more specific name. Where flying
is the traditional term for being able to fly unbounded. And both combined is usually not given its own name though some things of recent use spectator
mode for that, though that one is often non-interactable.
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.
noclip sounds like a very technical term that only people familiar with the opengl meaning of clipping might understand.
It's been used in cheat codes since back to Doom days idnoclip
. ^.^
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.
Ahh good ole Doom days :-)
But yeah noclip may make sense if you're a seasoned gamer, but just the term on its own always stuck out to me as weird.
We have a separate flight
command that works without the noclip or camera tweaks. Could ghost
be something else? Prolly. spectator
I would think of as something else (having no body)
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.
Ok, if we are brainstorming about this:
immaterial mode, intangible mode, wisp mode, incorporeal mode... oh... I like incorporeal.. let me find some synonyms... bodyless, disembodied, discarnate (yuck!), spectral, spiritlike, ethereal, transcendent, supernatural, nonphysical...
I guess incorporeal is the one I like the best, because I feel most people instinctively would understand that something incorporeal can go through walls. That been said, incorporeal might twist the tongue of some teenager and spiritlike is a more dumbed down contender. Except that some spiritlike modes, i.e. in World of Warcraft, still abide to -some- of the laws of physics, i.e. they must follow the landscape rather than fly through it.
So. Still vote for incorporeal mode. It seems very clear, unambiguos to me. But sticking to ghost (plus comment) or switching to spectator (or maybe observer? watcher? naah) would be fine too.
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.
I was also thinking that terms such as spectator, observer and watcher might have their use in specific game modes.
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.
I was also thinking that terms such as spectator, observer and watcher might have their use in specific game modes.
Yep, agreed.
incorporeal
is a cool term, even if a bit long. wisp
is short and kinda neat, but pretty close to ghost
and not obvious. Maybe we should drop in a TODO or issue to consider the rename as part of the movement refactor since that could involve tweaking at the movement mode. Maybe of interest to @portokaliu
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.
Just a couple of small requests.
@@ -97,7 +97,7 @@ | |||
private LocalPlayer localPlayer; | |||
@In | |||
private WorldProvider worldProvider; | |||
private Camera playerCamera; | |||
public Camera playerCamera; |
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.
How about you get it from the WorldRenderer then? It's the object that instantiates the camera in the first place and you can find it on the Context/CoreRegistry. No point in going through intermediaries if it can be avoided.
} else { | ||
playerCamera.resetFov(); | ||
if(charMovementComp.mode != lastMode){ | ||
if (charMovementComp.mode == MovementMode.GHOSTING) { |
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.
Ah, thank you. I can see where the "ghost" term comes from - going through walls.
I wish we could find a term that was a bit more explicit in its meaning. But perhaps just a short comment beside the constant in MovementMode would help. I.e.
GHOSTING(0f, 4f, false, false, false, 5f, true), // enables flying and going through solid surfaces
I checked and it seems the only mode that is somewhat ambiguous.
Bump. I believe the associated module PR Terasology/CombatSystem#32 got merged (maybe inadvertently from a second thing in the same branch) - does it actually work then? Pinging @0shine0 for an update sometime and to also respond to comments here at your convenience so we can move forward :-) |
@Cervator the combat system pr was merged but the sniper won't work unless this pr is merged in engine too. I have successfully tested the changes and they do not really affect anything but just provide me with functionality to implement sniper scope. |
Have you tried the other way to access the camera which emanuele3d proposed? |
I had tried it, it gave an exception. So i had reverted back to getting camera from LocalPlayerSystem. I think the exception was due to the camera being returned null. |
Can you provide me a link to the calling code/PR which you need? A bit deeper explanation: At the moment, the LocalPlayerSystem is (ranting, sry 😄 ) a grown mess where the main responsibility looks like handling player input logic, aka mapping input events with some rendering stuff and item usage thrown over. If we now break up the field encapsulation, the class will also become an implicit camera provider for the combat logic and a refactoring of this thing will be more painful than it is now. And we don't want to make things worse, we make them better 😎 |
I totally agree. I will also look for a better solution. |
Went for a short digging session. The class responsible for creating the camera is I would suggest to add a method |
I agree with @oniatus that we shouldn't give in on the mess that LocalPlayerSystem is, especially when the camera can be obtained from the WorldRenderer which in turn can be obtained via the Context if @in doesn't work. Regarding a new method getPlayerCamera(): the method getActiveCamera() -was- called getPlayerCamera() but was eventually renamed in view of eventually having multiple cameras, with only one active (and being rendered) at any given time, presumably all handled within the renderer. That was a long time ago and the vision now is for render nodes and entire branches of the Render Graph to potentially use multiple cameras, even switch them at runtime, cameras being managed and interacted with through the ES rather than through the renderer. In this context, in theory I don't disagree with the semantic reasons you mention @oniatus, but in practice the idea is to get rid of even the existing getActiveCamera() method and any other camera-related functionality from the renderer. The renderer will ultimately become a consumer of cameras rather than a provider. So, adding a new camera-providing method would be temporary and going in the opposite direction from what we are aiming for. |
Everything works as before in gameplay. The changes here are required for introducing sniper in CombatSystem module.
Pinging @Cervator and @portokaliu for review and merge.