CanCollideWith and teleporting stuff

Discuss all aspects of editing for ZDoom.
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

CanCollideWith and teleporting stuff

Postby JPL » Mon Sep 11, 2017 3:32 pm

I have a setup where the player teleports (ACS special 70) to a TeleportDestination, and very close by is a ZScript actor that overrides CanCollideWith for some custom touching/not-touching logic. When the player enters and exits the actor's radius by walking its CanCollideWith logic operates as intended, but when the player teleports into its radius as described, CanCollideWith only begins to fire once the player begins moving within its radius - if the player doesn't move after teleporting, they'll never trip the actor's CanCollideWith logic.

This seems like a bug rather than intended behavior... if it is, feel free to move this to the bugs forum. If not I'd be curious as to what the rationale is. There's probably a way I can work around this (manually nudge-moving the player a bit right after the teleport maybe?) but if it's a bug I'll let the fix save me that work.
User avatar
JPL
 
Joined: 09 Apr 2012

Re: CanCollideWith and teleporting stuff

Postby Vaecrius » Wed Sep 13, 2017 1:23 pm

Could this be related to the (intended, canonical vanilla) behaviour with pickups where they won't be picked up unless you're moving (or, in ZDoom, crouching)?
User avatar
Vaecrius
Putting the XD into *xdeath since 2007
 
Joined: 04 Jan 2004
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia

Re: CanCollideWith and teleporting stuff

Postby JPL » Wed Sep 13, 2017 6:49 pm

Vaecrius wrote:Could this be related to the (intended, canonical vanilla) behaviour with pickups where they won't be picked up unless you're moving (or, in ZDoom, crouching)?


As best as I can tell from the code, yes quite possibly. Pickups have their own special case handling via Touch / P_TouchSpecialThing, but that happens during PIT_CheckThing which I don't think is called for players that aren't moving(?).

I think I found a workaround, which is to run CheckPosition in the Tick of the object I want to detect collisions with, effectively re-checking for collisions every frame. On a map with about 30 of these, it appeared to add 1ms to "stat think". The map will eventually have about 200 of them so we'll see how that scales!

If anyone with deep knowledge could weigh in on whether the current behavior is intended (or, alternately, "unintended but way too sensitive to try fixing") that would be useful!
User avatar
JPL
 
Joined: 09 Apr 2012


Return to Editing

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot] and 3 guests