HitPlane/Wall

Post a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is ON
[img] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: HitPlane/Wall

Re: HitPlane/Wall

by Major Cooke » Sun Nov 24, 2019 1:53 pm

Agreed. Right now the only troubling thing I have to put up with is figuring out where and when to have the function calls.
Apeirogon wrote:IIRC gzdom internally set any line actor touch as blocking line, regardless of its type (one sided two sided) and flags on it.
Which is exactly what this is for, to go through and iterate against all lines that may turn out as potential blocking.

Re: HitPlane/Wall

by Marisa the Magician » Sun Nov 24, 2019 6:31 am

Honestly the main point of these have very little to do with "bugs" or whatever, but it's more about being able to precisely know when something collides with world geometry, without having to, say, do some complicated Tick override that checks the before/after of every move they perform (and even then it's still very hard to check exactly what they bumped into). Also they would allow for having finer control on bouncing behaviour (e.g.: making missiles have different bouncing angles, only bouncing on specific textures, etc.)

Re: HitPlane/Wall

by phantombeta » Sun Nov 24, 2019 5:22 am

Apeirogon wrote:
Major Cooke wrote:BlockingLine/Floor/Ceiling can sometimes return false positives
Maybe its better to fix those cases when it bugs, rather than create workaround around bug?
Returning false positives does not mean there are bugs. They're working correctly for what the C++ source code uses them for.

Re: HitPlane/Wall

by Apeirogon » Sun Nov 24, 2019 3:14 am

Major Cooke wrote:BlockingLine/Floor/Ceiling can sometimes return false positives
Maybe its better to fix those cases when it bugs, rather than create workaround around bug?
Major Cooke wrote:I've seen BlockingLine being non-null when going over a line that's not actually supposed to be blocking.
IIRC gzdom internally set any line actor touch as blocking line, regardless of its type (one sided two sided) and flags on it.

HitPlane/Wall

by Major Cooke » Sat Nov 23, 2019 7:15 pm

I'm working on creating these virtuals for projectiles after talking about them with Marisa Kirisame. The idea behind these is like SpecialMissileHit but for map geometry.

Code: Select all

virtual int HitWall( Line hitline, int hitside, int hitpart, F3DFloor ffloor );
virtual int HitPlane( Sector hitsector, int hitpart, F3DFloor ffloor );
  • hitside - Indicates if the front, dead center or back of the wall was hit.
  • hitpart - For walls, it's Side's ETexpart's top (0), mid (1) or bottom (2) constants. For planes, it's Sector's EPlane's floor (0) or ceiling (1) constants (although I don't know why they're reversed like that...)
  • ffloor - Simply not null if it's actually a 3D floor that it hits.
The returns are just like SpecialMissileHit: -1 to let the engine handle it, 0 to blow up the missile, 1 to allow passing through terrain like it's not there. Want a projectile to pass through all 3D floors? Return 1 if ffloor isn't null!

If this works out well enough I may just invest time into getting these working properly with solids. But this could still be tricky.

The reason I'm working on this is because BlockingLine/Floor/Ceiling can sometimes return false positives and are very unreliable at times. I've seen BlockingLine being non-null when going over a line that's not actually supposed to be blocking.

Top