Wall portals

Moderator: GZDoom Developers

User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49091
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Wall portals

Post by Graf Zahl »

hfc2x wrote:Lol, I had already made an article for the special: [wiki]Line_SetPortal[/wiki].

You got the meaning of 'interactive' wrong, but aside from that it's clearly the better one.
Interactive means that if any action reaches through a portal it will happen on the other side, for example spawning a projectile with an offset or stuff like that,

The simple teleporter has less overhead and can be used in places where monsters cannot go, for example.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49091
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Wall portals

Post by Graf Zahl »

Hm...

I just realized - the z-offsetting that's possible here may have to be restricted to visual and teleport-only portals.
There's absolutely no way that the bulk of the playsim code can ever be rewritten to handle that transparently, there's just way, way too much code that handles z as an afterthought, not as an integral part of the actual position.

Here's a small example of the function DoCheckRange that shows rather well what's up here:

Code: Select all

	// Check distance first, since it's cheaper than checking sight.
	fixedvec2 pos = camera->Vec2To(self);
	fixed_t dz;
	fixed_t eyez = (camera->Top() - (camera->height>>2));	// same eye height as P_CheckSight
	if (eyez > self->Top())
	{
		dz = self->Top() - eyez;
	}
	else if (eyez < self->Z())
	{
		dz = self->Z() - eyez;
	}
	else
	{
		dz = 0;
	}
If that has to reach through an interactive portal with z-offset all bets are off - unfortunately there's so many places in the code where similar stuff is done that refactoring all of them would become a major chore - so I'm definitely putting this off for the time being.
User avatar
Major Cooke
Posts: 8182
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: Wall portals

Post by Major Cooke »

So any of those calls while around an interactive portal will force it to transform into a different type? I'm slightly confused. Or is it whenever between a portal?
User avatar
DBThanatos
Posts: 3101
Joined: Fri Apr 14, 2006 3:17 pm
Location: in "the darkness that lurks in our mind"

Re: Wall portals

Post by DBThanatos »

Well, I dont understand any of the technicalities being mentioned here. All I know is that this is one wonderful feature, that whenever is ready, I'll love to mess with it, even if nothing productive comes out of it.

(I can only try to imagine what someone like cyriak would do with stuff like this :P )
Last edited by DBThanatos on Fri Feb 05, 2016 10:42 pm, edited 1 time in total.
User avatar
randi
Site Admin
Posts: 7746
Joined: Wed Jul 09, 2003 10:30 pm

Re: Wall portals

Post by randi »

It means exactly what he wrote:
Graf Zahl wrote:the z-offsetting ... may have to be restricted to visual and teleport-only portals.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49091
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Wall portals

Post by Graf Zahl »

What I do is to reduce the portal to 'teleport only'.

The issue is actually quite simple: A lot of code that calculates offsets, my guess would be half of it, does it in a way that just does not work if a portal offset with a z-delta != 0 needs to be added.
As long as z on both sides of the portal is identical this all will work fine.

But keep in mind now, that the original submission never even got close to what I define here as 'interactive'. (and to be honest it remains to be seen how extensive that needs to become.) The code I saw was pretty much 'teleport only', i.e. it handled P_TryMove, P_RadiusAttack and P_RecursiveSound. The real horror lies beyond those (rather trivial) basics.

And that's also why absolutely do not like the idea of passable one-sided-wall portals. They'll never work correct because stuff like sliding would inevitably fall apart around such a portal.
With all respect to ZZYXZ and what he achieved here, conceptually it's really not bad and it certainly worked to the degree this got implemented - but making this robust and failure proof is an entirely different matter and won't be possible without setting some restrictions. If we approach this with 'anything goes, let's just try' the end result will be a mess.

To be frank, I'd be more than satisfied if we got this to a state where:

- Eternity-style linked portals are fully working
- arbitrary portals can transfer all effects directly affecting the portal (i.e. an actor moving in, some explosion moving in and some monster alerting sound moving in)
- any passable portal is required to have some space behind the portal line to ensure no physics breakage (no, it's not possible without that, not universally!)
- interactive portals handle anything a teleporting portal can, plus any action from another actor that reaches through a portal (like a projectile spawn at an offset), provided that there's no z-offsetting.

This will take some time for sure.
Anything beyond that would be icing on the cake but definitely enter non-trivial territories, and should be deferred until after the simple basics have been worked out. Remember: Even those basics are a fantastic feature. But it'd be a shame if that failed because the ambitions were too high and as a result nothing works right because too many edge cases need to be handled.
Edward-san
Posts: 1774
Joined: Sat Oct 17, 2009 9:40 am

Re: Wall portals

Post by Edward-san »

... portal2 branch? :mrgreen:
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49091
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Wall portals

Post by Graf Zahl »

Let's first get the basics to work.
User avatar
Nash
 
 
Posts: 17449
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia

Re: Wall portals

Post by Nash »

Edward-san wrote:... portal2 branch? :mrgreen:
The cake is still a lie. :mrgreen:
User avatar
edward850
Posts: 5886
Joined: Tue Jul 19, 2005 9:06 pm
Location: New Zealand

Re: Wall portals

Post by edward850 »

I got bored.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49091
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Wall portals

Post by Graf Zahl »

Yay, Vaprdemo.wad 8-)

Too bad that there's too much that's still very problematic...
User avatar
Tormentor667
Posts: 13534
Joined: Wed Jul 16, 2003 3:52 am

Re: Wall portals

Post by Tormentor667 »

Now that this is added, is there also a way to make "travel through" ceiling/floor portals possible?
User avatar
edward850
Posts: 5886
Joined: Tue Jul 19, 2005 9:06 pm
Location: New Zealand

Re: Wall portals

Post by edward850 »

User avatar
Tormentor667
Posts: 13534
Joined: Wed Jul 16, 2003 3:52 am

Re: Wall portals

Post by Tormentor667 »

When I Understood it correctly it is not possible yet?
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49091
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Wall portals

Post by Graf Zahl »


That post had nothing to do with sector portals.

With sector portals there's the obvious problems that they are EXTREMELY glitchy and volatile in ZDoom's software renderer so implementing them makes very little sense.
In GZDoom things look different - GZDoom's portal renderer can handle Vaprdemo almost error-free (there's one cross portal lift that does not work but I'm going to find what breaks it),so yes, it's definitely on my list. Whether it makes sense to include the code in ZDoom in the hope that these portals eventually get fixed I cannot say. I sure hope someone finds the right voodoo to make them render properly.

Return to “Closed Feature Suggestions [GZDoom]”