We’re planning to turn on two camera features next Thursday (11/15):
- Smooth zoom
- An overhaul of poppercam
Both features directly affect the default in-game experience and should make gameplay more satisfying for everyone.
Poppercam is the feature that prevents the camera from clipping through walls. When the player moves through the world, the camera automatically adjusts to give the player the best view of your character. This is the default and most popular camera occlusion mode for Roblox games.
At a high level, this change will prevent poppercam from popping in and out rapidly when it encounters transient obstructions between you and your avatar.
Poppercam should only pop when it really needs to–it should not catch on geometry that isn’t completely obscuring the avatar, or that will only obscure the avatar for a short time.
Most modern AAA titles solve this by manually tagging map geometry as “pop” or “don’t pop”–for example, a small tree and a bush won’t pop the camera, but a wall on a house will cause a pop.
On Roblox we want to automatically provide the best possible view of the action, so you can just build your map the way you want without having to worry about manually tagging geometry. In order to achieve this, we had to tread some new ground by developing a general solution to poppercam that doesn’t require manual tagging. The new algorithm works in a predictive two-phase approach which we’ll go over in more detail in a future tech post.
Old Poppercam was walled off from developers behind a rigid engine-level API. In contrast, the new Poppercam is implemented completely in Lua where developers are invited to hack at it and tailor it to their unique gameplay requirements. Moving forward we plan to make it a package so that devs can edit it without completely forking.
Finally, the raycast-based Lua implementation of poppercam inspired several performance improvements for our raycasting API. Those are live on production right now.
Currently, camera zoom distance is separated into discrete steps, which makes the transitions rather disconcerting and visually jarring. We smoothed it out to make it more fluid and satisfying.
For those interested in the math, zoom distance is now simulated as the analytical solution to a critically damped spring. Zoom snappiness is determined by the spring’s undamped frequency.
As part of the PlayerScript refactor, these improvements are available for games on the latest version of the PlayerScripts.
If you have an old PlayerScript fork, we recommend that you unfork so you can continue to get fun stuff like this.
Big thanks to @Rototally @darthskrill and @AllYourBlox for their roles on this project. Feel free to ask questions and let us know if you encounter any issues; our team would love to hear your feedback.