-
Posts
3,457 -
Joined
-
Last visited
Rikifive's Achievements
Single Status Update
-
After struggling with it for a pretty long time now... (it gave me a bad time ) Twilight can climb slopes (and even stairs! ), so the world doesn't have to be blocky anymore.
It's still a work in progress, as I also need to make Twilight descent gently when going down, so that she doesn't constantly lose contact with the ground, successfully preventing her from jumping, which may be irritating (see Twilight when she's descending from the left side to see what I mean). That happening on the right side (stairs) is fine, it's about the smooth curves, where catching the right moment for jump is really hard and simply annoying.
Eh.. The code for all of it is pretty confusing already, I constantly bump into some glitches here and there. Tried to do one thing, had to modify few other to make it all work together properly.
What kind of bugs you may ask?
These kind of bugs:
Shattered Harmony Speedrun any % confirmed
It's all fixed now, but finding the problem was not an easy task. I was suspecting many things that seemed obvious, but it turned out, that apparently even though she didn't actually collide with the wall, she was so close to it, that it was counting her as standing on the ground, hence vertical_speed being not affected by the gravity and going up. On top of that, there was another tiiiiiiiiiny difference in maths, which ended up making her gently get stuck in the corner, launching her to the other wall due to some mechanics for precise collisions I've put. Today I discovered in the manual, that there are read-only instance properties, that basically tell where the hitbox edges are and I, like a complete moron was doing it manually, counting the pixels from the origin of the sprite on my own. It all was correct, but apparently there were tiiiiny differences between read-only variables and my maths after rounding stuff up, resulting in weird behavior. Now it all bases on the same variables, so it's 100% accurate now.
I hate collision stuff.
- Show previous comments 5 more
-
@Totally Lyra Yes, yes, everything is working now.
@Lord Valtasar Actually ther- Yeah, that would do the thing.
I took a little break after posting the status ~ now got to the thing I wanted to add--
It was super easy, just a single check if there's ground [ x ] pixels below the character - if there is, "grab" to the ground, otherwise do nothing and "detach" from the ground.
[ vsp ] doesn't move, which means she is firmly attached to the ground, so to speak. Now jumping never fails.
Also I gave stairs a try and while everything works and is practical in general (as normally it's best to stop moving before jumping when on stairs), it kinda looks too sharp I think.
When she's going up, she isn't "teleported", she just walks into the wall (assuming the wall is as high as her hooves) and then is slowly moved upwards each frame, which makes it smoother and is better to work with in general I think.
When going down now, I can't do the same, as the point is to stick her to the ground in order to allow her jump all the time.
Hmm.. not sure if I should keep it that way or just do that with smoother curves.
I think I'll resign from stairs. There's still some space to stop and jump, so players will be fine.
-
Yeah it kinda is, but constantly switching between walk-fall while descending was even more awkward. Either way, it is a totally legit approach in games. A very good examples are Tomb Raider games on PS1. She was drastically warped up and down as she was taking steps, rather than having any animation, nor anything for this. To be honest I didn't pay attention to modern games, but I think there's the same thing.
Another way I noticed devs take is to make the stairs' hitbox smooth - I mean, technically there are stairs, but "physically" it's just a single slope. It's not that visible in 3D environment, but in pixel world it might be.
For now I'll keep it as I initially planned - she'll be descending slopes smoothly, but from the stairs she will be simply falling down.
It doesn't look that bad and it's a common thing in these 2D pixel games.
There's that fun feeling ~ like YEEHAW BOI!
I'll see how the level design goes, perhaps I'll adjust things later.
- Show next comments 3 more