FransBouma / InjectableGenericCameraSystem

This is a generic camera system to be used as the base for cameras for taking screenshots within games. The main purpose of the system is to hijack the in-game 3D camera by overwriting values in its camera structure with our own values so we can control where the camera is located, it's pitch/yaw/roll values, its FoV and the camera's look vector.
BSD 2-Clause "Simplified" License
718 stars 249 forks source link

All new cameras: Add camera path editing for movie recording #43

Closed FransBouma closed 2 years ago

FransBouma commented 7 years ago

Hatti's BF1 tools have this, and it's really cool.

Basically it should work like this: (All quaternions are unit quaterions. We already do this, but just in case we're not, they have to be normalized)

Calculating the speed.

As smooth play requires a ticker, we can calculate based on the time taken between frames the time needed to play y units. E.g. if we play on 30hz, and we have a 60fps framerate, we get a new tick every 2 frames. If the speed is 10, we can define e.g. that '10' means we move 10 units per tick. If the speed is 5, we move 5 units per tick. the lower the value, the more interpolations are done between two nodes in a path.

We have to come up with a formulate for this, but it looks rather straightforward. It's either a lower-boundary on the speed (the 'slowest' one can move) or a higher-boundary on the speed (the maximum one can move).

Papers / Guides

See Catmull-Rom/Overhauser splines: https://www.codeproject.com/Articles/30838/Overhauser-Catmull-Rom-Splines-for-Camera-Animatio They're superior for this.

See: https://graphicsrunner.blogspot.nl/2008/05/camera-animation-part-ii.html

Also: See: https://www.engr.colostate.edu/ECE481A2/Readings/Rotation_Animation.pdf (or equivalent) See: https://www.scss.tcd.ie/publications/tech-reports/reports.94/TCD-CS-94-18.pdf (bezier/bspline based camera paths)

Todo

Bezier curves/spline curves for interpolation between multiple nodes on a path. See e.g. https://gamedev.stackexchange.com/questions/64529/camera-movement-with-slerp

danysterkhov commented 4 years ago

Hey! Wanted to ask if you get to try this out in any of the new cameras you did? I'm interested in function like this for DMC5 camera, and if you could get this done, how much do you want for it?

FransBouma commented 4 years ago

It's a lot of work and I don't have a lot of time atm, so when I have time I'll perhaps add it, but it's not my top priority. THe lack of time is the main roadblock

danysterkhov commented 4 years ago

Got it, thank you for fast response!

Kasatos95 commented 4 years ago

i've used the Cinetools by hattiwatti, he went to work for DICE. The Tools were simple to use to be honest. i don't have any experience with coding other than just changing some keybinds in text files.

there was an option to do slowmotion in the tools to a degree. but i presume it would only go to a certain limit because of the servers in bf1 bf4 exct. i know of people that want to record their footage in slowmotion to have more frames in the clips they want to record. such as myself i can only do 60fps and it hurts to not be able to slow down animations. currently i can only record freeze frames and it makes video not as interesting, because of there not being any movement other than the camera movement i can get with my controller. especially in Batman Arkham knight, it is one of my favourite games and i would have loved to do more creative cinematics in the game. There are too few options to make something good

do you think you can make such cinetools like done by hatti in future? maybe even with better features? and if you were to have the time. how much effort and time goes into this? i dont want to annoy people asking these kind of questions like: can you update this tool or fix a bug or implement something new.

FransBouma commented 4 years ago

@Kasatos95 I can make tools with camera paths etc. but as I said above, it takes a lot of work and thus time and currently I don't have a lot of time so it's not going to happen soon.

Another limiter is that I often don't have access to dof/other effects in the game's engine of the particular game. For me camera paths require effects to be settable at given points so the camera can interpolate between them. Reshade would work great but one can't set reshade properties from the outside, so camera paths might work out but there won't be camera effects in it, which to me is something which makes the whole feature useless.

Kasatos95 commented 4 years ago

ah okay, thanks for making a simple explenation! i understand that you don't have much free time, also thanks for doing what you can and have done before :) @FransBouma you make life easier!