How do you make a platformer without adding actual Platforms? I don’t know, I guess I’m stupid for not adding them until now, but completely surprised by how easy it was to start throwing them in. Apparently I’m not completely terrible at writing code that is relatively flexible to new features. I think it was basically just one day to go from no platforms in the game to having moving platforms, flipping platforms, group platform management, designing some of the spaces in the level and making sure the physics system played nice.
Moving platforms was pretty easy, I ended up using the Unity Splines package so I didn’t have to end up creating a bunch of proxy GameObjects or use Vector offsets stuffed into the platform serialization in order to make routes, plus I can make curvy bezier routes with this really easily if I want to do that later (i do).
With the spline we can just evaluate the spline further ahead and just set Rigidbody.linearVelocity in that direction with no fuss. Restrict the Rididbody rotation on all axes, set mass to something huge and poof, nothing will be influencing it externally but everything will just play nice with it moving around. I ended up ignoring terrain/platform collisions with other geometry because it will, well, do what I told it do and respect it… Which just turns into insane forces trying to solve like I told them to. Instead, just letting them overlap turned out a lot more manageable and easier to design with.
Combining hazards with the platforms was of course going to be a thing. Why else make super slow platforms if not to torment the player with anxiety and stress of being kicked off of them?
The flipping platform code is in the same class as the moving platforms, just another 50 lines for the which eventually is just Rigidbody.MoveRotation() and some timing stuff.
The Physics for the rotating ones is way more forgiving than it should be. It’s almost hard to fail if you get the timing just relatively correct. But, maybe thats not a bad thing. I’m sure balance between absurd difficulty and loose fun is definitely something to consider in the controller/physics design that plays a really big part of how the design systems feel and users respond to them.
I’m not really sure if it’s even a bug though. Riding platforms from the floor is almost a feature. Like “how do I jump up there??” Well chief, you don’t, you let it slap you and just ride it all the way up. Could be an interesting little unexpected creative problem solving tool. I’ll be looking for more weird “issues” and seeing if I could actually design some stuff around them.
This ended up being fairly easy overall. Nothing super complex just adding some features on top and putting them into the level. What I did learn from adding them into the level was – wow – the camera follow/rails system in Super Mario 3d World is *amazing*. I designed some pretty basic puzzles and was constantly getting greeted by horrible camera framing, bad angles and blocking content. The automatic rails they have the camera running on is parallel with cinema quality tracking in my opinion – especially after seeing how bad it can actually be with just some simple things.