Hello All,
I am currently working on a platformer with a focus on exploration sort of like a metroidvania style. I have been experimenting with different ways of implementing scrolling to try and make it a smooth process across different devices and computers. I am looking to see if anyone has done any testing around different camera/scrollTo methods that you have found give the most consistent results. Below are the options I have tried and most of them seem to introduce varying degrees of background stutter depending on what device they run on:
1. Simple applying the ScrollTo behavior to the character object. This works great but shows way too much below the character. You have to create really large sections for flooring, etc... if you don't want the player to see what is below them This is mainly due to the character being centered on the screen when scrollTo is applied to them.
2. Pinning a "Camera Sprite" to a position above the character. The Camera sprite would then have the scrollTo behavior applied to it. This seems to introduce a good amount of stuttering randomly. Especially when parallax is used for background layers.
3. Using events to position the camera sprite above the player, and then using the Scroll To action to scroll to the camera sprite. This is all of course done every tick. This seems somewhat smoother than the above option, but when testing on other computers it seems to introduce random stuttering of the background.
Has anyone played around with the above options or found another option that works better? My goal is to have the scrolling of the layers as smooth as possible and also allow for some flexibility as to where the focus of the scroll is. What I have found so far is the best position seems to be about 150 - 200 pixels above the character. Combining this with adjusting the jump strength helps to ensure they can't see too much below themselves, but can still see the ground when they jump.
I am open to any better ways of implementing the scroll to/camera behavior to allow for control and smoothness. I have multiple layers though only about 2 or 3 of them have parallax applied to give varying degrees of depth. All other layers are either at 100,100 or at 0,0 for the HUD.
Thanks!