• Advertisement
Sign in to follow this  

3rd person camera on "rails"

Recommended Posts

Hi all ^_^

In my 3rd person game the player can fully rotate the camera around him(like in the most 3rd person shooters or jump'n'run games), however I think that this control isn't needed in my game, and I think it would be better to "hardcode the camera" orientation for every different place in my game, something similar like in Super Mario 3D land.

I'm not sure how to approach this problem, how to design the helpers in my level editor for that type of camera.
The only thing that comes to my mind is each time the player enters a room/place the camera jumps and moves along a "rail" associated to that place?

Are there any other approaches?

Share this post


Link to post
Share on other sites
Advertisement
On 12/29/2017 at 10:58 PM, ongamex92 said:

Hi all

In my 3rd person game the player can fully rotate the camera around him(like in the most 3rd person shooters or jump'n'run games), however I think that this control isn't needed in my game, and I think it would be better to "hardcode the camera" orientation for every different place in my game, something similar like in Super Mario 3D land.

I'm not sure how to approach this problem, how to design the helpers in my level editor for that type of camera.
The only thing that comes to my mind is each time the player enters a room/place the camera jumps and moves along a "rail" associated to that place?

Are there any other approaches?

Based on your description I'm assuming you're not having trouble with setting up the view matrix so the camera looks at the player.

It's not really clear, though,  if your problem is related to how to place the camera in the scene so it isn't obscured by objects or if you're simply concerned with the transition from one angle to another.

The former is a fairly complex problem and either likely requires manual camera placement or allowing the camera to see through geometry, as for instance in Divinity: Original Sin.

The latter kinda depends on the context. Alone In The Dark simply jumps from one angle to another - the effect is jarring and highly effective at briefly disorienting the player. If your locations are more tightly knitted together, you might consider a fast transition and obscure it with something like motion blur or lens distortion (you're likely already using  a quaternion to interpolate the position and lookat vector anyway), or if you want to move really slowly and cinematically, you'll need to set up your camera movement manually - eg have it follow a spline and stop at specific locations based on where the player is.

Share this post


Link to post
Share on other sites

You can define a 3D path in space using eg a number of bezier curves between points in the space. (Bezier curves being the first that comes to mind, no doubt there are other forms of curves that you can use.)

The point you are looking at can be defined in a similar way, although I can imagine that it might be difficult to design a level like that, as you need to be aware of the camera position and the point it looks at, at the same time. Some way of showing how the camera moves is probably useful both from "within" the camera, and as a scene view. Alternatively, you could define angles of the camera at a graph (position -> angles).

A totally different solution is to have a free moving camera in the editor, and be able to 'record' and 'play back' the camera position and orientation that the game uses.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

  • Advertisement