Kane & Lynch: Dead Man - Camera System

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Def5
Posts: 21
Joined: Thu Nov 27, 2008 7:50 pm

Kane & Lynch: Dead Man - Camera System

Post by Def5 »

If somebody played Kane & Lynch, then he knows how camera works when you are in normal state (idle,running), and when you zoom. The question is: how to create similar camera that is placed left on a screen and when you zoom, it place a camera over shoulder of character (node).
Is there any sample or code snippet on Irrlicht forum that is similar or same to what i need? If there isn´t any, can someone suggest how to create it or knows a good tutorial on web?

NORMAL CAMERA
Image
ZOOMED CAMERA
Image
Any help would be useful. :D
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

I've never played Kane & Lynch, so I'm not exactly sure how it works, but it seems relatively easy to do what you're describing. When the user presses the zoom button, you move the camera to a position that is closer to the characters head, and when the button is released, you move the camera back.

Travis
Def5
Posts: 21
Joined: Thu Nov 27, 2008 7:50 pm

Post by Def5 »

It works just like you described.
When the user presses the zoom button, you move the camera to a position that is closer to the characters head, and when the button is released, you move the camera back
DtD
Posts: 264
Joined: Mon Aug 11, 2008 7:05 am
Location: Kansas
Contact:

Post by DtD »

Yes, that's also how you would accomplish it in code...

~DtD
christianclavet
Posts: 1638
Joined: Mon Apr 30, 2007 3:24 am
Location: Montreal, CANADA
Contact:

Post by christianclavet »

For me it look like a camera type rig you'd see on Unreal Engine. (AKA Gears of War)

The Camera is parented to a invisible pivot near the player, and when the player use the "target" button to shoot, the pivot is animated to go near the position of player avatar. That pivot point should be parented to the player avatar (mesh). So it follow the avatar as it moves.

From the shoots I see, I think the camera target is somewhat moved further. Perhaps I'm wrong there.

What you will have to do is create a new camera setup(rig) to do this.
dlangdev
Posts: 1324
Joined: Tue Aug 07, 2007 7:28 pm
Location: Beaverton OR
Contact:

Post by dlangdev »

Def5: Do you know how to code and just asking for directions? Or are you fishing for code because you don't know how to code?
Image
Def5
Posts: 21
Joined: Thu Nov 27, 2008 7:50 pm

Post by Def5 »

Do you know how to code and just asking for directions? Or are you fishing for code because you don't know how to code?
I know how to code, but sometimes I get some errors so I always look firstly for tutorials, code snippets and examine it. Also, there are a lot of people who maybe have different ideas how to implement something (in my case "over-the-shoulder" camera). I am not "fishing for code" or anything else similar. I am not stealing or rewriting anybody´s code. When I go programming I always start from creating C++ files and then start writing code from beginning. How good programmer I am? Well, in scale from 1 to 10 it would be 6. 8)
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

Then why can't you write an event receiver that just moves the camera when the 'Z' key is pressed? Once you have that, post the code for it. It should only take you an hour or so.

Once that is done, we'll move on to the next step. FYI, I've got mine working just fine...

Travis
sjb
Posts: 19
Joined: Tue Dec 23, 2008 10:35 pm
Location: Sweden

Post by sjb »

Def5, just a general recommendation to you.

It's fairly common these days, more so than it used to be I do believe, that asking for help == getting directions on where to go. Not code handed to you. Not saying you were fishing for code, but what I would do in your case. Establish what you want to do.
You want the camera to follow your player. Start there. Search the forums for that. Now once you've gotten that implemented. All you really need is to offset the camera closer to the players head when he's aiming. So look at the code you wrote for following the player. Where does it set co-ordinates? Try changing them, what happens? By just doing these few steps I'm 100% sure you can implement this camera.

If you are unsure about handling keys you could search the forum for an eventreceiver class and see how that is used. That class is basically so easy that a monkey could get input in his game. If he ever had one. Then again it would probably be about bananas.

Anyway. Good luck. And I do recommend searching the forums a few times (maybe even a few times each day) because there is extensive knowledge to gather, especially on basic topics such as this. :)
Velud
Posts: 6
Joined: Thu Jan 01, 2009 8:01 pm

Post by Velud »

I've seen something like this in Oblivion.
I think that the move camera with the model of character.
What can change the nature of man?
Halifax
Posts: 1424
Joined: Sun Apr 29, 2007 10:40 pm
Location: $9D95

Post by Halifax »

Alrighty. Here's a video of the camera in action(0:00-0:12) with the zoom: http://www.youtube.com/watch?v=cz0MVpYeLBw

So, as christianclavet said, it works just like the Gears of War camera(0:00-0:10 http://www.youtube.com/watch?v=_iZyFv7SRCw). One thing I notice, although I'm not sure about it, is the player and the camera are controlled separately. Meaning that the player can manipulate the direction the player is in, or the direction that the camera points in, but they aren't dependent on each other.

Then the zooming affect is easily done with interpolation from one point to the point behind his shoulder, as christianclavet said. Or you could use spring calculations, with a damping, to make it pull in faster and slow up when it gets closer to his back.

Also you will probably want to set some limits of where the camera can rotate to look at, otherwise the calculation to go towards his back when zooming will get screwed up. It appears that they do that in the video for Kane & Lynch too.

And now that I look at the full video, Kane & Lynch appears to be a direct copy of Gears of War. Just by how the character runs, the cover system, the crouching run, zooming in and slowing up when shooting, etc.
TheQuestion = 2B || !2B
dlangdev
Posts: 1324
Joined: Tue Aug 07, 2007 7:28 pm
Location: Beaverton OR
Contact:

Post by dlangdev »

What's challenging with implementing a camera like that would take a lot of analysis and coding. Well, I've never written one so I would imagine there is more to it than simply attaching or parenting a node. What I see from the video clip is that both actor and camera are parented to an invisible body.

The last camera I made was for the bowling game which is totally different from K&L, as there are three states to it. I learned quite a bit implementing a camera that behaves like a cinematic camera, tho.
Image
Post Reply