Forums Gallery LOGIN |REGISTER

Community Archive is read-only - Here you can view content recorded up until February 2017. To join the latest discussions visit our new forums


Camera Code for Action RPG and First Person Cameras

Please use this forum for questions on C++, Lua, XML, and any other languages used in CryENGINE development.


 

User avatar ivanhawkes
Regular Dev
Regular Dev
 
Posts: 508
Member since: 13.11.2012, 17:55
Location: Australia
Likes: 160

Camera Code for Action RPG and First Person Cameras

Postby ivanhawkes » 13.09.2016, 16:39

Thanks to CryTek opening up the source code from GameSDK and providing the new c++ game templates in release 5.2 I am finally able to write up an article on the camera code I am writing for Chrysalis (my Action RPG SDK). Code for a third person camera was one of the most requested things during the days of GameSDK. There is now a template that provides a simple third person camera, so on the back of that I would like to present my code for a more feature rich Action RPG style camera.

I have written an article, available on my blog which breaks down all of the code needed for:

  • A Camera Manager
  • A First Person Camera
  • An Action RPG Camera (third person)
  • Player Input (support code)

The ActionRPG camera has smooth interpolated motion, zoom levels, can switch into first person mode and out again via mouse scroll wheel, provides cvars for "over the shoulder" views, and offsets for aim positions. It can report aim targets back to the animation system to aid in setting up aim poses. I even included a fairly simple collision detection.

The code is a refactor of sections of CryTek code and my own original work. CryTek code is covered under their license for CRYENGINE users, and my personal code is offered under a BSD style of license. You are free to re-use it in your own projects.
User avatar ivanhawkes
Regular Dev
Regular Dev
 
Posts: 508
Member since: 13.11.2012, 17:55
Location: Australia
Likes: 160

YouTube Demo

Postby ivanhawkes » 13.09.2016, 17:27

Australian internet is pretty bad for uploading video, so here is a very short demo of the camera in use on YouTube:

.
User avatar ArcticLion
Just getting started
Just getting started
 
Posts: 77
Member since: 17.07.2016, 17:31
Likes: 8

Re: Camera Code for Action RPG and First Person Cameras

Postby ArcticLion » 15.09.2016, 20:13

Thanks for sharing this, very useful info !

One question please

How to switch cinematic camera to in-game camera ?
let's say my game starts with short cinematic move on engine-renderer, and when character reach some point in world(area trigger or something else..) it must softly blends to in-game camera.

Could you explain how to solve this ?

Is this may works with same one instance of character or need separated instances of camera and character. I mean, what in one same time: we have in-game character and logic for it, and in same time we have cinematic-character and cinematic logic for it, and by triggers we are switching between them ?
User avatar ivanhawkes
Regular Dev
Regular Dev
 
Posts: 508
Member since: 13.11.2012, 17:55
Location: Australia
Likes: 160

Cinematic Camera Switching

Postby ivanhawkes » 16.09.2016, 05:28

I haven't reached the point in my project yet where I needed to investigate this behaviour, but I was asked just the other day by the Dark Vale team how to do just that. They were asking in GameZero or the other c++ game template projects needed anything special done to handle Trackview cameras.

I had a quick peek at the various cameras implemented by GameSDK and didn't see any in particular that would be required for use by trackview, but that was all I had time for then. I suspect Trackview creates it's own view and captures the view - and the game must then be capable of capturing it back once the Trackview has completed. I don't know for sure yet, since I haven't had time to cover that code.

It's pretty close to the top of my work list, so I should be able to get back to you early next week with an answer (family is over for the weekend now, and that usually means I get nothing done.)