Jcw87 / c2-sans-fight

Undertale Sans Fight Clone
http://jcw87.github.io/c2-sans-fight/
527 stars 494 forks source link

The combatzone stuff is broken, and platforms are broken as well. #93

Open iKNIFEu opened 3 years ago

iKNIFEu commented 3 years ago

As you can see... the combat zone is "fine" to you, ain't it? Well it's not, if you make the combatzone smaller, and you're in a corner or a wall (overlapping the border probably) you'll get stuck if you're in a corner, and you won't move vertically if you're in wall. I understand if you don't understand me, but please try going into a corner in blue mode or red mode, and make the combatzone lower, if you jump while the combatzone is resizing, you'll get stuck vertically, if you're in a corner, you can't move.

Also, the platforms, it's just, weird, y'know? when you go to the last part of it's width, it's kinda weird seeing it I really don't know how to explain it lol, but thats a bug, and there's also a PLATFORM in platforms 2 that doesn't even hold you, it's the one right below the smallest platform.

If you can't fix them, I understand since the playerheart custom movement is legit bad, like come on, why doesn't custom movement work with solids, haha.

Anyway, have a good day.

Edit: I got the platforms idea from this, i have the same problem. https://github.com/Jcw87/c2-sans-fight/issues/77

Jcw87 commented 3 years ago

I initially wanted to use the platform behavior, but the platform behavior doesn't support changing the direction of gravity, which is important for the sans slam attacks. So, custom movement behavior it is. It is a lot of effort to replicate the many built-in features of the platform movement object. If my goal was to support every edge case, I never would have finished this thing. My goal was to make it work well enough for the vanilla attacks. I think the only vanilla attack that even displays a hint of this issue is the final attack, but you never get stuck from it.

iKNIFEu commented 3 years ago

I see, alright. but is it not possible to use 8-bit direction? It supports solid objects, and I really need it so that at least the combat zone is fixed on my custom attack, what do you say? If you say that it's possible, I'll try adding it on my own.

iKNIFEu commented 3 years ago

No it's not, i'm stupid asf. But there IS a way to fix this, but it's only for the red color. image Idk how to fix this using the blue soul lol sooo yea

Jcw87 commented 3 years ago

I also had to rule out the 8-direction movement due to a subtle difference in how it's implemented vs how Undertale did it. Construct 2's 8-direction movement does the "right" thing, and ensures that the object moves at the same overall speed when moving diagonally as when moving horizontally or vertically. Undertale does not do this. Horizontal and vertical movements are managed completely separately, and so it moves faster overall when moving diagonally.

Example: Imagine that the speed of the red heart is 60 pixels per second. In Undertale, this means that the heart is moving at 60 pixels per second when moving horizontally or vertically, but is moving at approximately 84.85 pixels per second overall when moving diagonally, because it is moving 60 pixels per second horizontally and vertically simultaneously. The 8-direction movement in Construct 2 will ensure that the heart still moves at 60 pixels per second overall when moving diagonally by moving it at 42.42 pixels per second horizontally and vertically simultaneously.

Jcw87 commented 3 years ago

It might be possible to resolve this using the "Push out solid" action, but I don't know enough about how it works to trust it.

iKNIFEu commented 3 years ago

I knew it, in construct 2, I dont like the 8-bit direction, why? You move 2 directions, you become {Half I think} slower. I really don't like it, lol. Btw, I'm gonna try out the push out solid action, and I'll see if it works or not. Thanks :) Edit: Also, in the picture I showed you, it's like, uh, kinda buggy, if u become blue while in red mode, you'll get stuck if you're in a corner. But I know how to fix it, but henceforth, I'm too lazy.

Jcw87 commented 3 years ago

I knew it, in construct 2, I dont like the 8-bit direction, why? You move 2 directions, you become {Half I think} slower.

That's not quite right. You don't move slower when going diagonally. The total speed is the same, but your individual axis speeds are smaller. It is more correct to say that, in Undertale, you move faster than normal when moving diagonally, and in Construct 2, you move at the same speed in all directions. You can calculate all of this yourself with the Pythagorean Theorem (and derived distance formula): d^2=x^2+y^2

iKNIFEu commented 3 years ago

I should give u that bug thingy tho. image this fixed the problem of the blue soul thing. And I still didnt use the push out solid. By the way, should I make the soul move faster when moving diagonally? I think I can try that... So maybe, speed * 1.414167? I did this and it actually started moving faster lol. image Edit Idk how many times lol: I tried push out solid, I also don't know how it works, but blue soul works just fine? You can go to construct's discord or just use the manual to know the idk, push out solid, I'll try doing just that. By the way, please don't close this issue unless the issue is fixed, alright? The reason is probably because I set the borders to solid behaviour.

Nevermind, there are problems with it. But I aksed in the discord and they said: "It pushes out solids when enabled It works just like the platformer or 8Dir behaviors but without the movement." "You see when you add the platformer object to a sprite and it does not fall through solids? the "does not fall through solids" part is caused by a function named "push out solids" And every movement behavior has it." "The push out solid behavior is ONLY that function"

Jcw87 commented 3 years ago

I feel like you have misinterpreted several things I have said. Regarding "push out solid", I know what it's supposed to do. My issue isn't with that. I need to know how it works. Most of the ACE in Construct 2 is very intuitive as to how it works internally, but actions like "push out solid" are an exception, as it could be doing any number of things. The manual won't have that information. I need to read the code for it in the runtime source. I need to know what information it takes into account so that I can make the best use of it. I don't have the motivation to do that right now. I don't always feel like working on my hobby programming projects. And when I do, the project I want to work on may not necessarily be this one.

When I mentioned the 8-direction speed not being the same as Undertale, I really meant only the 8-direction speed. My implementation with the custom movement is already accurate to Undertale, and your change makes it too fast. I'm getting the impression that you aren't quite understanding the why behind the diagonal speed increase.

A vector is represented by 2 numbers, X and Y. Vectors can be used to represent positions, but they can also represent speed and direction. In Undertale (assuming we are still going with the 60 pixels per second assumption), when you press up, it adds the vector (0, -60), and when you press right, it adds the vector (60, 0). If you press both directions, the total vector is (60, -60). If you have an arbitrary vector, and want to know what the speed is, you simply need to calculate the length of the vector. You can do that with the distance formula: You normally use 2 points for the distance formula, but since we only care about the length of a vector, you can simply use (0, 0) as one of the points and simplify the formula a bit: If one of the components of your vector is 0, you can intuit that the speed is simply the absolute value of the other component. If you use the vectors (60, 0) or (0, -60), the length (or speed) is 60. If you put the combination vector of (60, -60) into the formula, the length (or speed) is , or , or 84.8528

iKNIFEu commented 3 years ago

Alright, I know, but is it possible to fix the problem with blue soul? Yes it is, but I just have a headache TRYING to fix it, if I delete ANYTHING of the "0 speed" or "step back", the thingy doesnt work, I mean, the jumps will be extremely low. I'm bad at having a brain, yes, but no matter what I do, I still don't understand how you coded the blue soul, good job on that. However, if you're gonna work on this project anytime soon, you can fix this problem if you want to, but I'd think it'll be hard according to myself. Just saying, now you don't have to reply to this thing, why? Because both of us aren't finding a solution for now, so I say, if you can't fix this issue, you might have to close this, welp, thanks.

iKNIFEu commented 2 years ago

This issue is actually fixable with 8-direction behavior now that I think about it. You could use the formula with 8-direction behavior, which the behavior works extremely well against solids. Could you correct me if possible? Thank you.