Page 20 of 29

Re: Wall portals

Posted: Tue Feb 23, 2016 6:29 pm
by Graf Zahl
I think I should post a short status update.

I have currently implemented handling for Eternity-style portals (i.e. those with no directional change and a fixed offset, both plane and line portals) so that actor collision checks through the portal are working. And without doing anything explicit about it, sliding along an actor on the other side of the portal worked right out of the box so my base concept of using offset functions throughout the play code seems to have paid off already.

I also implemented movement through sector portals - with interpolation remaining intact, of course you'll have to use GZDoom to see this in action - but with the right map this should even work with the limited sector portals in ZDoom.

Next step: Transition through wall portals plus interpolation. Once that is in I'll implement arbitrary portals as teleporters. Doing thorough checks for collision and movement is unfortunately not really doable without having a fixed universally retrievable displacement value, so these will inevitably be somewhat limited regarding game physics. I'm sure some things can be solved but they'll all require explicit coding wherever some handling is needed.

Re: Wall portals

Posted: Tue Feb 23, 2016 6:34 pm
by Major Cooke
Graf Zahl wrote:Next step: Transition through wall portals plus interpolation. Once that is in I'll implement arbitrary portals as teleporters. Doing thorough checks for collision and movement is unfortunately not really doable without having a fixed universally retrievable displacement value, so these will inevitably be somewhat limited regarding game physics. I'm sure some things can be solved but they'll all require explicit coding wherever some handling is needed.
So that may mean moving polyobject portals may be tossed out after all?

Re: Wall portals

Posted: Tue Feb 23, 2016 6:38 pm
by Gez
Polyportals are explicitly covered by the "arbitrary portals" denomination, so yes they'll be possible even if they won't have all the niceties of fixed portals.

Re: Wall portals

Posted: Wed Feb 24, 2016 11:51 am
by Tormentor667
@Graf Zahl - I downloaded the latest build of GZDoom 2.2 right now (605-ge107d8f) and tried the new portals. It works visually but the teleporter doesn't seem to work at all. This is my line setup in GZDB:
Image
The lines have the ids 500 and 501 (and the exit is 501 and 500). I can perfectly view through them but not walk through them which is a bit odd. Is the code not finished yet or am I doing something wrong?

Re: Wall portals

Posted: Wed Feb 24, 2016 11:58 am
by Shadow Hog
You have to use the Special on two-sided lines and add a buffer sector behind the portal. (In Eternity you had to alter the lighting of the buffer sector to avoid rendering bugs; no idea of ZDoom has a similar restriction.)

Re: Wall portals

Posted: Wed Feb 24, 2016 12:03 pm
by Graf Zahl
Line portals are not done yet so of course they do not teleport. Did I say anything different?
And yes, they need to be two-sided - at least the linked portal type.

And overall, the feature is not yet ready for use.

Re: Wall portals

Posted: Wed Feb 24, 2016 12:38 pm
by Tormentor667
Thanks for the explanation :) I am just a bit impatient

Re: Wall portals

Posted: Wed Feb 24, 2016 1:02 pm
by Graf Zahl
As always... :mrgreen:

Sorry, line portals are not that easy because unlike sector portals there isn't just a coordinate to check against whether it got passed.

Re: Wall portals

Posted: Wed Feb 24, 2016 3:19 pm
by Tormentor667
I just spot a lot of places where I can take advantage of these to make my mapper's life easier.

It's just fine, I am sure you will get that sorted out and in the meantime, I will just wait for that - even if it's hard ;)

Re: Wall portals

Posted: Thu Feb 25, 2016 3:14 pm
by ZZYZX
Shadow Hog wrote:You have to use the Special on two-sided lines and add a buffer sector behind the portal. (In Eternity you had to alter the lighting of the buffer sector to avoid rendering bugs; no idea of ZDoom has a similar restriction.)
You had to alter ANY of the buffer sector properties, the point here is that with 2-sided lines, if both sectors of an invisible line have equal properties, the engine wouldnt even try to draw it.
Not sure if Graf retained my explicit check for portal 2-sided lines.

Re: Wall portals

Posted: Thu Feb 25, 2016 3:41 pm
by Graf Zahl
I haven't touched any of the renderer-side code and I do not plan to. I'm far too busy anyway with the playsim side - I hope I get portal transitions finished this weekend - but after that the real fun will start with adjusting the FPathTraverse class, sight check and aiming code.

Re: Wall portals

Posted: Thu Feb 25, 2016 5:58 pm
by Major Cooke
I somehow get the feeling handling A_Warp is going to be painful. Especially actors with +NOINTERACTION and the likes...

Re: Wall portals

Posted: Thu Feb 25, 2016 6:07 pm
by Graf Zahl
That's why I took some effort to wrap all offset calculations info functions like Vec3Offset, so that this stuff can be reduced to a handful of places.
Actually, the biggest headache in the game code were the interpolation options in A_Warp, but I hope I got that resolved now.

That entire coordinate refactoring from January was all preparation for portals.

Re: Wall portals

Posted: Fri Feb 26, 2016 6:05 am
by Tormentor667
No idea what you are talking about, but it sounds lik pain - pretty happy that I am not a programmer now:P

Re: Wall portals

Posted: Fri Feb 26, 2016 9:40 am
by printz
Shadow Hog wrote:You have to use the Special on two-sided lines and add a buffer sector behind the portal. (In Eternity you had to alter the lighting of the buffer sector to avoid rendering bugs; no idea of ZDoom has a similar restriction.)
That was merely a developer mistake in Eternity where he forgot to add a check in an "if" test, due to duplicated code.