This is a two part post. First part is a specific suggestion on how to handle the anchor point of the 3rd Person Camera for I:B.
Second part is some musings about two kinds of ways cameras are controlled in 3D space and gives the context to why I am thinking about the topic as well as some basics.
While thinking about the topic of camera controls I noticed a potential problem with offset anchor points. I mean following:
In order to be able to see beyond whatever you are piloting in 3rd person mode one option is to point the center, the anchorpoint of the camera, around which it rotates, outside of the ship or character that is being controlled.
Now. What happens if you rotate the view to look directly up, down or some other angle? The ship might get in the way again, because that anchorpoint is placed outside the ship at a specific point. Now, most games donât have to care about that because the player usually is not supposed or just doesnât have to look below or above their vehicle or character.
In I:B we control ships in 3D space though.
I suggest a dynamic anchor point that adapts depending on the position of the camera in order to have the ship always in the screenarea it is supposed to be (e.g.: lower third).
Each camera position has a corresponding anchor point. So when looking straight down the anchor point will be at the bow of the ship, when then rotating the view left/right it will be on the ship port/starboard side and when looking straight up on the aft of the ship.
The default would be looking straight ahead along the ships forward axis in which case the anchor point would be exactly where it would be with a simple offset point. In the center of the ship ofset âupâ/âaboveâ.
Mathematically this results in half of an ellipsoid around the player ship on which surface the possible anchorpoints would sit. Instead of defining a fixed anchor point an ellipsoid shape (or its boundaries) is defined for each ship. An algorithm then translates angle position of camera to anchorposition.
Geometry calculations could be skipped by defining endpoints for every possible camera position extreme and two dimensional linear extrapolating them ⌠although my intuition tells me that would result in jagged behavior because it wouldnât be a smooth ellipsoid but a (low poly) polytope. And thinking about it more it might even be more complex then finding a tangent on an ellipsoid.
I just now realized that many games do that. Some in smoothed over âshoulder switchâ or stepped or even fluid like I suggested. Eh. Felt like writing a post again after all this time.
Lately while playing with the big ships in I:B I noticed how the camera controls behaved for both 1st and 3rd Person.
I was kind of weirded out by itâs wonkeyness in some situations ⌠namely in the extreme regions when looking directly up and directly down from its fixed âaxisâ. So I though about alternatives. Hereâs a comparison with another camera control option I know of and a bit of insight how both of them behave.
I:B for its freelook and 3rd Person and really most games including first person shooters use a system where they not only lock the cameras position but also lock the cameras rotation around itself (think turning your phone or computer screen into portrait or landscape and intermediate states) to the entity the player is also controlling. Like the character or the ship. An axis is chosen that defines what is up and what is down and the cameras self rotation is always locked onto that axis.
In praxis there usually isnât anything specifically locked but really the players inputs are translated into the cameras movement in such a way that it can only always stay in a certain orientation.
This applies to both first and third person mode. The only difference really is that the axis is in front of the camera in third person mode and in or behind the camera in first person mode.
The other option is to only have the camera locked to the character or ship by a single point and no specific axis. This is also, indirectly in some way, used in many games and 3D edditing programms. Itâs when the camera is locked but you move the ship, character, or work in 3D space or just directly controll the camera like a âshipâ. In that case you are usually given full 6DOF freedom. When flying the interceptor, thereâs no prefered up or down position and rotating the ship is always the same ⌠not so with the fixed axis method.
Now it might be hard to imagine both these side by side ⌠and I donât have time or energy to whip up graphics right now but I can present a though experiment:
Imagine looking at a Rook Chesspiece. Itâs upright and you see all of its profile. The crest of the depicted horse. The anchorpoint of the camera is in the center of the chesspiece. Rotating the chesspiece or rotating the camera is effectively the same.
We will input following: Rotate up: 45deg, Rotate left: 90deg, Rotate down: 45deg.
With a fixed anchor point and a fixed axis you will get following behaviour:
- After the first step you will see the piece from diagonally above. Visually the piece appears to have shortened.
- During the second step the view is rotate in such a way that it is still looked at from the same angle as above but now the camera is looking at either the front or the back of the piece. Like itâs on a turntable. (Notice how the view has rotated as if it still was looking at the piece from the front)
- During the last step the view is rotated down again ⌠but it would now show the back or front of the piece instead of its side.
With just a fixed anchor you will get following behaviour:
- Here the same as above happens.
- During the second step the view is rotate in such a way that now the piece is viewed from the front again and looking at the back or front side of the piece and on top of that it is now not upright anymore but being presented landscape. (Notice how the view has moved from looking obove the piece to suddenly being back to centered even though the view was rotated to the left and not up and down)
- During the last step the piece stays landscape but the view is rotate so that the piece is looked at diagonally from the left, would it sit on a table. Repeating this step would return us to looking at the piece from the front ⌠but it would still lay on its side in landscape mode âŚ
Another way to imagine the diferences is to imagine a globe where in its center is the anchorpoint or for our purposes the player ships.
Fixed axis method is traveling along latitude and longitude by moving the mouse left/right and up/down respectively.
With just anchorpoint though you arenât traveling along but directly moving your view arround the center. This makes you effecively traveling always on a circle which center always goes trough the center of the globe.So if you go up a bit and then go left you start to near the âimaginary equatorâ again ⌠but you are going âsidewaysâ. Your view will be slanted because you have gone up first.
This different behavior has following implications:
Fixed Anchor and Fixed Axis
- Depending on the position of the camera the same amount of input results in a different outcome with more distortion the more you get to the âpolesâ.
- Distortions require the player to compensate and âsail aroundâ them.
Just Fixed Anchor
- Input always results in the same Camera movement.
- Consecutive inputs without returning to a plane results in the camera rotating around itself. Requiring additional inputs to control that rotation.
- Added freedom can lead to disorientation.
In the end I realized that having a fixed axis is an alright tradeoff to minimize potential confusion and disorientation and to simplify the camera controls.
Still. The distortions are much more of a problem in space games like I:B and since manual weapons aiming has been introduced. Much more so then in other games where mostly nothing is happening âstraight upâ or âstraight downâ. Some games even limit how much you can near those distorted zones.
Another thing that made me accept these distorted zones is that the turrets have those zones too ⌠so in a way itâs an accurate representation of their capabilities.