Math for Game Programmers: Juicing Your Cameras With Math

preview_player
Показать описание
In this 2016 GDC session, SMU Guildhall's Squirrel Eiserloh explores the math behind a variety of camera behaviors including framing techniques, types and characteristics of smoothed motion, camera shake, and dynamic split-screen.

GDC talks cover a range of developmental topics including game design, programming, audio, visual arts, business management, production, online games, and much more. We post a fresh GDC video every day. Subscribe to the channel to stay on top of regular updates, and check out GDC Vault for thousands of more in-depth talks from our archives.
Рекомендации по теме
Комментарии
Автор

the split screen demonstrated is really cool

raiju
Автор

I come back to reference this talk every now and then so

0:00 Overview
2:41 Juice intro
3:27 Camera shake
6:40 Camera shake 2D
7:27 Camera shake 3D
9:53 Camera shake implementation
15:07 Camera shake takeaways
15:37 Smoothed motion
21:26 Framing
27:00 Voronoi split-screen cameras

yuler_
Автор

A tiny improvement on asymptotic averaging for anyone who comes by: if you're doing the timestep-dependent variant, i.e. x += (targetx - x) * smoothness * timestep, it's better to do x += (targetx - x) * min(1.0, smoothness * timestep) so that you don't overshoot when your timestep gets too large (e.g. unexpected lags, framerate drops, etc).

lisyarus
Автор

Holy frick this is an insanely good presentation. You don't think about these things when you play games but they make a world of a difference. Even his silly little platformer demo for this instantly gave me a "polished" vibe just because of the smooth camera.

ObeseWizard
Автор

Squirrel Eiserloh was my game programming professor at SMU Guildhall. He was the best teacher I ever had. The most amazing person, who explained complex concepts in such a cool, interesting and easy-to-understand manner. Everyone has their No. 1 teacher that they remember fondly for the rest of their lives. For me, that teacher is Squirrel Eiserloh.

KKomalShashank
Автор

The part about camera shake was very insightful

demonsnails
Автор

Great talk! I keep coming back to it every now and then. Using perlin noise instead of simple random numbers or designing different rules for camera movement in certain directions are the things that are easy to overlook and not even consider but they could make a huge difference in making sure that your game just feels right.
One interesting thing to point out is that for some games you can choose not to shake the camera itself but rather to shake the UI. I've just noticed this in Doom (2016) and it appears to work well. The player's camera does not move at all, but all the interface elements do. Great way to add "weight" and "juice" to explosions and hits without messing with the player's aim or spatial awareness. There's still vertical recoil from some of your own shots but that's rather standard and expected by players anyway. I assume shaking the UI works best if you have UI elements in most if not every corner of the screen so that it feels more immersive.

RealRushinRussian
Автор

Great talk, very well explained and no wasting time

ZeroZo
Автор

Instead of Asymptotic Averaging, I would recommend using damping, which is effectively the same, but takes a delta time into account so it's not framerate dependent. Equation is very simple: (src * factor + dest * dt) / (factor + dt), where src is the source (starting) value, dest is the destination (target) value, factor is the damping factor (0 = instant, and you can go up from there), and dt is the delta time or frame time.

jitspoe
Автор

This talk deserved to be a full hour; great talk and especially good for the limited time allowed.

masondeross
Автор

I love all the illustrative graphics, little visualizations like that help a lot

torphedo
Автор

The Voronoi split screen technique is bloody brilliant!

scottcourtney
Автор

Screen Shake is so important that early arcade games used to make up for the hardware's inability to do screen shake
by flashing the colors of the screen.
The effect can be really intense and deadly to epileptics.

I'm really glad that we can now do screen shake.
This effect is subtler, and by that I mean that it's still intense
but only as intense as it needs to be.

sosasees
Автор

an additional method of 3D camera shake, which is by far my favorite, is projection, frustrum, or shear shake. (I don't know the actual term for it, but shear is probably the most understandable, since it's how Build Engine games and Doom '93-derived games did looking up and down in a column-based renderer: shearing the Y axis projection.) It's essentially a 2D shake in 3D, where you shear the projection matrix about the X and Y axes. In simpler terms, the vanishing point moves around instead of staying at the center. I'm lacking the vocabulary to do it justice here.

Lethal Company is the best real world example I have, and is most noticeable when a spike trap slams down.

NoahtheEpicGuy
Автор

I am not at all in the game development area, I am just a mere gamer, but this was extremely interesting and very well explained.
Great presentation of a very interesting aspect of games !

anonymous-demn
Автор

Actually on my forth beer when 9:00 . Was gettin a bit dizzy, TY for killing that slide.

REAL-NANO
Автор

1) Camera shake in 3D, Translation helps show how it effects your hero in a 3rd person game and foreground, while Rotation is mostly going to effect things in the distance or background. Typically in 3D you also want to reduce the amount of roll you do, as that tends to make people sick. While your argument for no translation movement (or is very bad) might be accurate for a First Person game, I think it's incorrect with a 3rd person game.

2) Camera shake in VR can be done, but in general you want to use all translation changes Vs rotation (because Rotation will make people sick). We had camera shake in Lone Echo 1 & 2 with just translation and it worked very well.

Overall an amazing talk!

chadverrall
Автор

The exponential increase shake feels wrong when implemented in rapid shooting weapon. The early shoots will have no noticeable recoil feel. But it seems great to emphasize killing streak or successive combo.
I think we should have several instances of shake in different intensity and amplitude for various context such as explosions, shoots, constant shake etc.

dioricergy
Автор

note: in practice, for 3d (projected onto a 2d screen), pitch and yaw _are like_ "2d translation" and roll _like_ "2d rotation", so 3d rotation by itself is "equal to" 2d's rotation+translation, which is preferred, and 3d translation a bad kinda jittering ground effect dependant on perspective that, if you even _could_ do in 2d, _you would avoid like the plague_

so in essence, good camera shake in 2d and 3d "work the same"

thego-dev
Автор

The slides are at mathforgameprogrammers dot com

cacheman