And then... chaos. You see, a friend had recently played Don't Starve over the weekend, and I was very interested in how the game's camera works. It's like 2.5D. It has a parallax effect. In all my previous versions, Ponyland is stationary; nothing moves because it's all done with an orthographic camera. I really wanted to try this parallax effect and... everything is a mess now!
The pony has been sentenced to the warped dimension:
Good-bye, cruel world...
So, what has to be done in order to achieve a 2D parallax effect is to change the camera from orthographic to perspective. But alas... this creates a lot of problems. Things are no longer just 2D. Life is no longer simple. They must now be 3D. My sprites and artwork are fine, but all the components and tricks I used to sort and order my sprites had to be changed or modified. Now instead of using 2D colliders for things like clicking on interactive objects and sprite transparencies, I must use 3D colliders. Every asset needs to be updated. That's not all though, now my raycasts need to be converted and done in a different way.
My fancy golden crosshair marker is being wonky. My dropped fruits are now stuck halfway through the ground... I need to figure that one out. Oh, and the way the parallax is done is by rotating all the sprites 45 degrees, and the camera 45 degrees as well. It's very strange to work with the 3D colliders when everything is rotated 45 degrees. It's not a thing I can eyeball, I need to test out the position of every collider in order to make sure it's working well. See Stella's cottage with 3D colliders:
I've made a branch in my version control for this parallax effect stuff, so nothing is horribly mutated from my last post to the point where I can't get it back. This 2.5D/3D work would open the door to a lot of cool things. Like... uh... this ball:
And then I made it into an eyeball. Get it?! Ahahahahaha.
But seriously, I would be able to use all three axes now. In 2D mode, I used only X and Y. In 2.5D mode, I use X as my X, but Z as my "Y" which is a little strange, but now my Y can actually be used for things like height. Woah, I wonder if I can have clouds and floating platforms? The possibilities... I haven't thought of all of them yet. But I'd be able to have towers and bridges and other cool things! Gravity actually works now too. The pony can fall off colliders.
Here's a final shot of the parallax effect.
No comments:
Post a Comment