This week I've started investigating on the controls for the game. As I'm on the preproduction stage and this could be a project developed in Unity I decided to go for one of those "ready to use" 2D platformer solutions, already found on the Unity asset store.
The one I came up featured many interesting things I surely will need for my game. For instance, variable height jumping, ladder climbing, crouching and many other interesting things if someday I need them. There were still some things I'll need to do, but surely this will save me a lot of hours of work. That was the idea, not reinventing the wheel, and just invest time where nobody else could.
On the other hand, one of the coolest things I loved from that solution was its integration with Mecanim, something I will surely use.
During this study I had to introduce some missing features to check if the overall result is something I like or not.
Things I've introduced:
- Inertialess movement in the air. Player moves as long as he holds the direction key, and once he releases it, no horizontal velocity moves the player. Only when the player starts a jump with no movement.
- Walkable floor over ladders: Player can walk over the top of a ladder, this is because in a 2D representation of a 3D scene these things happen, and player needs to walk over the top of a ladder and also be capable of moving through the ladder to the top of it.
- Ladder-only pass-throught platforms. Allow pass through only when on the ladder, but not when the player jumps and touches the ceiling of the platform.
Things don't like:
- Trying to get a perfect control is nearly impossible. Jumping and controlling the height in the air depending on the time the control is hold is really difficult, or it seems it's like in the moon, or player has only 2 options to press and one is pressing in less than 1 milisecond. The same applies to horizontal movement. Having to deal with material frictions, player mass and forces, to control how player speed behaves is a pain in the ass.
- When player falls into the corner of a platform, bounces like a rock.
- Player gets stuck many times in the corners of the platforms. Probably because of my player collider configuration, but it's the best I achieved. One large box with zero friction and 2 small spheres, one is just a trigger to know when the player is grounded, and another with normal friction. Ok, when the small sphere touches one of the platform corners then it gets stuck. Applying a big force will probably unstick the player from that place but also make unwanted movement.
- Unexpected things. Behaviour not expected, for instance when player fail to jump to the next platform, falls, and just slides down agaisnt a wall, but the next time player also fails the jump but touches a corner, and then bounces like a rock. May be this can be cool for a ball or the Indiana Jones Big Rock Sphere but not for the player.
Control is a key part in any platformer game or in any game where movement is important. Level design is built around it, and the space of things achievable depend on them. In order to keep the player focused on the game experience, they should respond to the player intentions. And last but not least, even if I find my perfect controls, many players will complain about them, so imagine if before they play the game I already know they were far from perfect.
I haven't still took a decision on what way should I go but most probably I will try to use one controllers I used on my previous games and adapt it to my new needs.