Rare case of portal not getting crossed when it should be

Is there something that doesn't work right in the latest GZDoom? Post about it here.

Moderator: GZDoom Developers

Forum rules
Please construct and post a simple demo whenever possible for all bug reports. Please provide links to everything.

If you can include a wad demonstrating the problem, please do so. Bug reports that include fully-constructed demos have a much better chance of being investigated in a timely manner than those that don't.

Please make a new topic for every bug. Don't combine multiple bugs into a single topic. Thanks!

Rare case of portal not getting crossed when it should be

Postby FishyClockwork » Wed Oct 20, 2021 4:00 pm

Tested with 4.7.0 and g4.8pre-51-gbb44f3dcd

Apologies if the title seems a bit vague. It's rare in the sense that this was hard to pin down but I have a reproducible sample.
So basically I have a custom moving actor that moves between mapspots.

breaking-portal-test.wad

In this test map a you'll see a flying zombieman moving between three points.
Two points in the STARTAN2 room and a third one is in the red room which is actually though a line portal.
When the zombieman attempts to fly back into the STARTAN2 room, it will vanish at the point where it should cross the portal. A few seconds later it'll be back, coming through a wall.
What's happened is that the zombieman ended up behind the portal's "buffer zone" instead of actually transitioning through the portal.

It's just a simple two-way static portal set up. (You can walk back and forth no problem.)
I've no idea if it's something to do with level.Vec3Offset() or Vec3To() since that's the only thing special in its code.
Spoiler: "ZScript code"
You do not have the required permissions to view the files attached to this post.
User avatar
FishyClockwork
 
Joined: 23 Feb 2011

Re: Rare case of portal not getting crossed when it should b

Postby Graf Zahl » Thu Oct 21, 2021 3:58 am

You have to use TryMove instead of SetOrigin. The latter does not move the actor, it merely repositions it and thus is not portal aware.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Rare case of portal not getting crossed when it should b

Postby FishyClockwork » Thu Oct 21, 2021 5:45 am

That seems to have fixed it. Thank you very much.

Although I was under the impression that Vec3Offset (with the "absolute" parameter being false) was portal aware as well?
User avatar
FishyClockwork
 
Joined: 23 Feb 2011

Re: Rare case of portal not getting crossed when it should b

Postby Graf Zahl » Thu Oct 21, 2021 6:31 am

You got that precisely reversed: 'absolute = true' DISABLES all portal checks.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Rare case of portal not getting crossed when it should b

Postby FishyClockwork » Thu Oct 21, 2021 10:46 am

I guess I should have worded that differently.

At any case, shouldn't Vec3Offset (absolute = false) have taken care of any portal checks for SetOrigin?
User avatar
FishyClockwork
 
Joined: 23 Feb 2011

Re: Rare case of portal not getting crossed when it should b

Postby Graf Zahl » Thu Oct 21, 2021 11:34 am

Normally, yes. This function is used for all internal offset calculations.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany


Return to Bugs

Who is online

Users browsing this forum: No registered users and 0 guests