Alright, so I’ve seen this issue come up in multiple places across multiple platforms, but still have yet to see it addressed here, so:
The goal: Make a top-down character, isometric in my case, able to 1) successfully jump around on the screen, and 2) able to jump onto things like platforms. Think like Solstice, a game older than I am so I know it's possible!
The problem: Naturally, with top-down, you can't use gravity, as the player would constantly fall off the screen. So smooth jumps, even jumps in general, seem impossible.
I've tried several things: the first I tried was creating an invisible platform under the player, giving it 8 directional movement, giving the player platformer behavior, disabling all his keys but jumps, and attaching the player to the platform's X position. Seems the physics don't appreciate this, when you move down he falls a bit, and jumping upward was.... Odd, to say the least. It actually almost worked, except when you tried to jump up+left at the same time, it just won't jump. All the other directions more or less worked, aside from the fact that he could also jump through things and get caught on the other side of them. Nevertheless, it didn't seem to be putting me in the right direction for the end goal, and the physics really weren't working great, so back to the drawing board it was.
I also tried a simulated jump with timers and forces, where if a timer has run for .25 seconds, switch the force applied to him for another .25 seconds, and then stop. However, the jump created with this method turned to be very blocky and angular, not the smooth arc created by platformer controls, certainly. So again, I switched methods. <> Inspired by other engines' forums with the same question, I started on a new approach. Player: 8-directional movement as normal. Attached to a point at his feet, there is a small invisible object that determines where the ground is. Ideally, when he jumps, it won't move up with him. To test this out, I made a quick "player moves 50 pixels up if he presses the space bar, and when he releases it he moves 50 px down again." Not exactly a jump, but close enough to test what I was working on and--lo and behold, he won't move vertically if you're pressing the "up/left" combo. Once again, every other key combination works but this one. It's puzzling.
Also, I can’t get the ground point to move away from him when he “jumps” this way.
Here's the plan, more or less, for the future: The distance between the ground point and the players feet is a variable called "zheight". Every "jumpable" object, such as a platform, has its own variable that determines its own height. If the player's groundpoint is inside the bounds of a jumpable object's hitbox, AND it's not too tall for him to jump, then when he lands, he'll land (height variable of object) upward of the groundpoint, and be z-sorted properly, thus appearing on top of it.
It's clunky, but it's the best way I can think of. However, I'm stuck at steps 1 and 2: create a convincing "jump", and make the ground point not go up when he jumps. I'm wondering, if anyone has any ideas to improve upon mine, and if anyone has any tips on jumping in general. When I can I'll post the project for other people to look at.
Props to anyone who's read through this whole essay. Cheers!