Focal point with first person terrain navigation

Started by
16 comments, last by JoeJ 1 year, 3 months ago

This is probably a very basic question for many of you,

I am developing a very basic first person terrain navigation ‘engine’ (I hesitate to call it ‘engine’ because if really basic). One of the problems I run into is that when I am roaming on my terrain I some times run into some strange behavior (I cannot advance and each time I press the advance button it flips scenes totally). I have double checked whether my calculations are correct and they seem to be. There is however something else I have noticed. The problem disappears the moment that a new camera focal point is selected. So I am am assuming this has to do with the fact that the camera focal point is not being updated. Hence, here is my question: what should the camera focal point be in a first person engine? Should it be set to the center of the screen?

Any help with this will be appreciated.

Advertisement

mllobera said:
Hence, here is my question: what should the camera focal point be in a first person engine? Should it be set to the center of the screen?

Yes. It is where the crosshair is, and that's centered on the screen for almost every game i ever saw.

However, personally i think it would be worth playing around with some options in certain situations, e.g. cut scenes.
And it might feel better to put the crosshair a bit up, to compensate for occluding gun model and assuming there are more enemies on ground than in air.

However, the issues you describe sure have a reason you want to find.
Personally i rarely had the case that my view somehow flipped backwards and upside down. This was only in editor and tools stuff, but i never found the reason and had this bug for decades.
After i rewrote a new camera control from scratch, the bug went away. But i realize this only now with writing this.

Thanks @JoeJ This is very helpful!

mllobera said:
… it flips scenes totally

Can you elaborate on this, please? Do you mean that the camera stars rendering an entirely new environment model…? Or (as JoeJ seems to suggest) that the camera suddenly changes direction such that it's looking in the opposite direction? Or something else again…?

mllobera said:
The problem disappears the moment that a new camera focal point is selected.

What is the purpose of your “camera focal points”? What are you doing with them? (I'm thinking that perhaps knowing this might suggest a reason for the behaviour that you're seeing.)

MWAHAHAHAHAHAHA!!!

My Twitter Account: @EbornIan

Thaumaturge said:
What is the purpose of your “camera focal points”? What are you doing with them?

There we have it - game devs do not even know what it is. : ) I must enlighten you. Imagine cool side of car camera:

The car blocks half of the view, so not much point of showing that. But if we move the focal center to the same side, we see more of the street, and might even use it for gameplay.

So that's totally underused in games, although we can easily use it if we want.

I would not know either, if i had not worked on software rendering before GPUs came up. And i have never used it in practice, but surely good to know.

You sure remember it from ‘drawing perspective scenes aid’.

EDIT:

Old 2.5D games used it to fake looking up and down. They could not rotate the view direction vector out of the horzontal plane, but they could move the focal center up and down.
Iirc, Shadow Warrior is such example.

JoeJ said:
There we have it - game devs do not even know what it is.

No, I know what a “focal point” is in general, I do believe--but I want to know what it means in this engine.

(Well, I had somewhat forgotten, and hadn't thought to (consciously) apply it to a realtime 3D rendering. An I appreciate the refresher! ^_^)

In short, I don't know that the original poster is indeed using the term as you define.

JoeJ said:
The car blocks half of the view, so not much point of showing that. But if we move the focal center to the same side, we see more of the street, and might even use it for gameplay.

JoeJ said:
Old 2.5D games used it to fake looking up and down.

Hmm… Something like that could be what they mean, indeed. I hadn't thought that it might be that!

But I don't see how the effect of such an offset might change as the player moves, or over time…

(My guess thus far has been that the “point” in question is a 3D location, and that they're doing some vector maths to keep the camera looking at it. Thus when they approach too closely, the angles become somewhat extreme, resulting in the camera swinging around and--as they pass the point--flipping over.)

MWAHAHAHAHAHAHA!!!

My Twitter Account: @EbornIan

Agree the focal point has probably nothing to do with the reason for the bug. Maybe setting it reinitializes some corrupted state of the camera, but the reason for the corruption may be elsewhere.

JoeJ said:
It is where the crosshair is, and that's centered on the screen for almost every game i ever saw.

Then you never played Resident Evil 4, 5, or 6, because those games have a moving crosshair and it's awful/nausea inducing. Those games are almost unplayable due to the bad aiming controls. Would not recommend using a similar method.

Aressera said:
Then you never played Resident Evil 4, 5, or 6, because those games have a moving crosshair and it's awful/nausea inducing. Those games are almost unplayable due to the bad aiming controls. Would not recommend using a similar method.

Hmmm… i have played either 5 or 6, but can't remember special issues.
However, i always have a bag prepared to vomit when playing over the shoulder TP games. I can not even move forwards in a straight line with those.
Damn console gamepads ruined all the FP fun. The bag is not because i feel sick, it's due protest. :D (But ironically, i'll probably end up at some third person stuff too…)

In case you like RE, i currently play the game Signalis, which i think is close to classic RE. Tried it because the interesting pixel art look, but then really liked the gameplay too.

JoeJ said:
Maybe setting it reinitializes some corrupted state of the camera, but the reason for the corruption may be elsewhere.

That is a distinct possibility; maybe the wrong piece of memory is being addressed, or something like that…

Aressera said:
… because those games have a moving crosshair and it's awful/nausea inducing.

I'm reminded of (ancient) games like CyClones and ShadowCaster, which had keyboard-based movement-and-turning, and a freely-moved targetting cursor within the view.

In those cases, however, I think that it actually kinda worked--for me, at least. (Mouse-aiming likely would have been better, but what they had was arguably an improvement over keyboard-only movement-and-aiming.)

MWAHAHAHAHAHAHA!!!

My Twitter Account: @EbornIan

This topic is closed to new replies.

Advertisement