SRB2 Message Board  

Go Back   SRB2 Message Board > Sonic Robo Blast 2 > SRB2 Discussion > Bug Reports

Reply
 
Thread Tools Search this Thread
Old 11-23-2016   #1
Simsmagic
i am a wizard
 
Simsmagic's Avatar
Default Moving intangible from bottom FOF can launch players

I wasn't quite sure how to title this one so bear with me.

I created a continuously moving FOF that's intangible from the bottom. If the player walks into the bottom of the FOF when it's on the ground and jumps, they'll be launched high into the air.

The forum's uploader isn't working for some reason so here's an imgur gif:


edit: now imgur's failing to work but after doing a quick test it does happen in 3D mode as well.

Last edited by Simsmagic; 11-23-2016 at 06:21 PM.
Simsmagic is offline   Reply With Quote
Old 11-29-2016   #2
SANICBOOM644
Blue Hedgehog Acceleration
 
SANICBOOM644's Avatar
Default

Aren't intangible Fofs not supposed to touch the ground?
__________________
Friend Code 3DS :
NNID Wii U: luigiboy6444
Smash and Pokemon ORAS, and Mario KArt
SANICBOOM644 is offline   Reply With Quote
Old 11-29-2016   #3
Mystic
チェン!
Administrator
 
Mystic's Avatar
Default

Well this bug makes it obvious that the situation clearly wasn't checked for when implementing it. That doesn't mean it's not a clear bug and shouldn't be fixed.
Mystic is offline   Reply With Quote
Old 11-29-2016   #4
Wolfy
Lumberjack Yandere
Developer
 
Wolfy's Avatar
Default

For reference: this bug was caused by this merge request. Reverting it fixes the issue, though I still have no idea which part caused this.
__________________
Quote:
[23:56:36] <SM-MaxX> prisma illya is a gift to this impure earth and a shining beacon for all anime
Wolfy is offline   Reply With Quote
Old 11-29-2016   #5
toaster
トースタちゃん
Developer
 
toaster's Avatar
Default

Hey Wolfy! Try not to say you don't understand something on the forums, because that's very good bait for me to get hooked on a problem and forget to shower.

This is the first time I've ever looked closely at the code. Line 2068 of p.map.c seems to stand out pretty hard - that "if (onfloor && !(thing->flags & MF_NOGRAVITY) && floormoved)" check is too lenient for pmomz to be applied, considering the fact that the section of code just beneath it allows you to "step up" inside FOFs once your vertical midpoint is above their vertical midpoint, which is caused by whatever function adjusts floorz and ceilingz for FOFs, which is somewhere in p_mobj.c and has a fairly obvious name I can't remember right now.

The thing is that because this check is so lenient - and doesn't prohibit being stepped up, which will technically register you as onfloor - the step up slingshots you. I have no idea how to make a more lenient check that doesn't allow for you to fall through the FOF, though, without avoiding the pmomz-setting hack done there and instead adding struct variables to sectors that handle the dy/dt of the movement of their planes.
__________________
Quote:
<MonsterIestyn> surely it's good ass though
Quote:
<MonsterIestyn> watch porm to keep warm

Last edited by toaster; 11-29-2016 at 11:01 AM.
toaster is offline   Reply With Quote
Old 11-29-2016   #6
Monster Iestyn
Friendly Neighbour-Hood
Moderator
 
Monster Iestyn's Avatar
Default

Actually it might be more simple than that - by my own examination, P_IsObjectOnGround returns true if the Object is on or below the ground (or rather, the Object's last calculated "floor" z position, which is assumed to be the ground). When inside such an FOF and above the middle your floorz becomes the FOF's top, so you could be counted as "on ground" in the pmomz handling function, in which case your pmomz then becomes the difference between your position and the top of the FOF (this is how it normally tries to calculate how much the floor you're standing on has moved, but because you're below the actual ground to begin with the assumptions used fail entirely). Depending on how large this difference is, your momz could well be increased greatly, which is no wonder you get thrown upwards like a rocket.

I'm still convinced the pmomz fixes don't actually work except when you least want them to, such as being crushed by the floor crushers in ERZ1 (resulting in you rocketing into the ceiling during your dying "jump").

Last edited by Monster Iestyn; 11-29-2016 at 04:13 PM.
Monster Iestyn is offline   Reply With Quote
Old 11-29-2016   #7
toaster
トースタちゃん
Developer
 
toaster's Avatar
Default

No, that's part of the issue. If P_IsObjectOnGround returned false unless z == floorz (or z + height == floorz), you'd clip through anything that was going upwards. Try it yourself and see!
__________________
Quote:
<MonsterIestyn> surely it's good ass though
Quote:
<MonsterIestyn> watch porm to keep warm
toaster is offline   Reply With Quote
Old 11-29-2016   #8
Monster Iestyn
Friendly Neighbour-Hood
Moderator
 
Monster Iestyn's Avatar
Default

I wasn't saying P_IsObjectOnGround was at fault necessarily, though I probably didn't make that clear. What I do think is up is that the pmomz is supposed to be set to the difference between the old and new positions of a plane, but is actually set indirectly via the Object's floorz and actual z. When the Object wasn't actually standing on the plane in the first place this doesn't give the expected result though.

Last edited by Monster Iestyn; 11-29-2016 at 05:15 PM.
Monster Iestyn is offline   Reply With Quote
Old 4 Days Ago   #9
Monster Iestyn
Friendly Neighbour-Hood
Moderator
 
Monster Iestyn's Avatar
Default

Hey Simsmagic, does this bug still occur at all as of 2.1.17? I think we included a fix for it, but I don't know what level's being tested in the gif so I can't check for myself.
Monster Iestyn is offline   Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:59 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.