Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Snapbacks" #256

Closed
SkyTheLeafeon opened this issue Mar 20, 2018 · 8 comments
Closed

"Snapbacks" #256

SkyTheLeafeon opened this issue Mar 20, 2018 · 8 comments

Comments

@SkyTheLeafeon
Copy link

SkyTheLeafeon commented Mar 20, 2018

This is the second issue I ran into while doing that screenshared run.

This seems to happen randomly, and at any place in the game.

As it turns out, the GIF that shows this is larger than 10 MB. I'll email it to you.

Note how Quote snaps to the right.

@andwn
Copy link
Owner

andwn commented Mar 21, 2018

Surprised nobody brought this one up earlier. The same thing happens with ceilings too.

applicationframehost_2018-03-20_20-40-14

Try to fix it every so often but keeps happening. Per pixel checking was one of the ideas (so if the player moves 0x600 units, 3 pixels, collision will be checked 3 times). It's what the real Cave Story does, but I'm afraid it could slow things down.

Another is checking floor/ceiling vs walls first if the player is moving up/down faster than they are moving left/right. That's something I do with platforms (imagine a platform moving up and quote falling into it. In that situation floor collision needs to be checked before walls or else quote will get pushed to the side).

Limiting the maximum amount of "pushback" could also mitigate it, instead of pushing quote out of the wall entirely in one go. Quote's speed is never (or at least rarely) faster than 3 pixels per frame.

And this one I came up with just now. Rewrite the level collision just for the player to check all directions but hold off on adjusting the player's speed and position, then compare how "in" the walls/floor each side of the player is, and take the path of least resistance.

I'll stop rambling now.

@SkyTheLeafeon
Copy link
Author

Looks like that might be tedious to do, but I'll leave you to it. You can do this!

andwn added a commit that referenced this issue Mar 22, 2018
Make (most?) flickering sprites flicker a bit slower #258
Attempt to mitigate #256, it's fixed for the booster on ceilings at least
@andwn
Copy link
Owner

andwn commented Apr 5, 2018

Not completely fixed but mitigated it to a point. At first I tried rewriting the player collision but it wasn't working out, so I just made it so when this happens you will never be pushed more than 3 pixels. This is good enough for me. Maybe someday I'll come back to it again.

@andwn
Copy link
Owner

andwn commented Apr 5, 2018

The booster ceiling thing should be fixed though. I forgot that the collision on the booster was separate.

@luRaichu
Copy link

BTW this also happens on the presses in Hell, it makes it a lot harder do get the hearts above them.

@luRaichu
Copy link

*TO get the hearts above them.

@andwn
Copy link
Owner

andwn commented Aug 14, 2020

That does happen but the code that causes it is different (object vs object collision). I mitigated it with platforms but for some reason it still happens with presses in particular

@andwn
Copy link
Owner

andwn commented Jan 17, 2022

Fixed for next release

Screen Shot 2022-01-17 at 1 21 11

@andwn andwn closed this as completed Jan 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants