Okey dokey, following my original intention of making this thread into an actual development log, here's an account of the technical challenges I'm facing. GIGANTIC POST AHEAD.
As I said before, this is being made in Unity. I'm a confess unity fanboy, but I admit it's not the best tool for 2d games right now. In very recent news, the Unity team announced the next version will have native tools for 2d development! yay! But I'm not waiting for that, so I'm using
RagePixel, a free tool to create 2d sprites inside unity. I'm only using it to take my sprites into the game, but it does more than that.
I studied the possibility of using game maker. I'm not too familiar with it, but it does look flexible, easy and focused in 2d, which is great. But I had things planned that I didn't know if it could be done in gm, and a quick scout ahead didn't convince me enough to risk developing there.
Right from the moment I had the idea I could immediately identify two challenges: making a decent 2d controller and that whole rotation thing. Developing the controller led me to one of the most notorious facepalm moments in my hobbyist game developer life.
Unity comes with a character controller. It's quite decent for 1st/3rd person games, but the capsule collider (it has a round top and bottom) isn't ideal for 2d platformers, the player can slide edges etc. And it doesn't rotate, so that's a deal breaker for me. Thus I decided to make use of the physics engine and make a character controller that is in fact a rigidbody highly constrained to achieve that 2d game feel. That never works, obviously! physics engines are unreliable. But I was going to try anyway.
Finally, after many days of implementing, fixing bugs and tweaking, I had something that I was happy with. It didn't seem to have any bugs, it could be rotated at will. Fantastic! Then I decided to make a test level. Made the whole thing in 3ds max and imported into unity. And the god damn controller goes bananas with the imported mesh. It gets stuck in every corner, goes through solid objects. Just a big disappointing mess. My only thought is that the physics engine is more effective with those native colliders and it doesn't like mesh colliders.
So I took a deep breath and accepted the facts; I was going to have to scrap the whole thing and make my own character controller from the absolute scratch. Raycasting my way into a usable controller. SO I DID. That took a few days of cracking my head, several equations and diagrams into my white board, implementation, bug solving, tweaking... It is done. Not fantastic, but it works. Then I started taking this system into my project. At a certain point I wanted to know how I did something inside my previous controller, so I just inserted the previous apple into the scene and realized it was slightly misaligned with the test level geometry... So I adjusted it. It worked. The previous controller worked fantastically well
And that's the controller crisis' first hand account. Now comes the other challenge, which hopefully there won't be any crisis related to it, the rotation or 'curved space'.
What you see in those gifs and video is a first attempt, and it doesn't work nearly well enough. It only looks nice because I know exactly where to step to make it look like it works. In theory it sounds simple: you have a region in space, define on it a center, calculate on each frame the angle displacement from that center, rotate the player that angle. The problem is entering and leaving this volume, because the translation is discrete (obviously, this is a game) when the volume detects the player he's already inside the volume, so there is a tiny displacement unaccounted for. When the player leaves we have an analogous problem. Taking these extra displacements into consideration is difficult, and not doing it creates problems. That first corner in the video, for example, should rotate the player 90º but it never does.
The rotation problem is still unsolved and is my current task. I might work on some art if I get sick of that though. Whatever gets done first I post here