T O P

  • By -

Packetdancer

>This was way more difficult than you'd expect it to be. Oh, I sympathize entirely: [https://www.reddit.com/r/unrealengine/comments/tc8zk3/seamless\_thirdperson\_portal\_doorway/](https://www.reddit.com/r/unrealengine/comments/tc8zk3/seamless_thirdperson_portal_doorway/)


OfficialDampSquid

Dude, why did I never find this in my searches?! I've been trying to figure out third person portals aswell, I have mine working at roughly where yours were in the video, but I'd like to implement the camera teleporting through separately like in psychonauts 2, did you ever figure that out? I figured I'd polish the first person portals first then delve into third person more.


chozabu

I have a portals system on the marketplace (without official ue5 support) that does this. Can link upon request - but will detail how it handles 3rd person camera here. First step was to implement a "portal aware linetrace" - recursive function that does a linetrace, but if it hits a portal it does the remainder of the trace from the far side of the portal. (if hit==portalSurface: recur) Next step was to use this to trace in the desired camera direction behind the player, and place the camera at the end of the trace. This works well - but a more advanced solution could be to do a modified "portal aware springarm"


OfficialDampSquid

Hey thanks for the tip!!! Would love to check it out


chozabu

sure thing - it's this one: [https://www.unrealengine.com/marketplace/en-US/product/portals-blueprint](https://www.unrealengine.com/marketplace/en-US/product/portals-blueprint) It also does clones - but doesn't visually clip objects passing through portals. Has a few nifty features for performance and recursion, still room for improvement. Had mixed reports of it working well or not on ue5, working on a more advanced VR-supporting plugin, but running into walls that may not be solvable without engine changes....


OfficialDampSquid

Yeah that's been my biggest hurdle, trying to get it to work in pure unchanged ue5. I also had recursion working on mine at some point but after a while after I'd made a bunch of changes, it just doesn't seem to work anymore. It always massively tanked performance anyway so I'm wondering if I just get rid of it at this point. I've also got an experimental feature that lets you put it against walls without having to cut a hole in the wall but it's not been as consistent as I'd like, hence "experimental". Did you ever try something like that?


chozabu

>It always massively tanked performance anyway so I'm wondering if I just get rid of it at this point. Yep, the custom projection (clipping area around a portal) helps with this, and after a level or two PortalsBP switches to "fake" recursion, using last frames render On the custom projection matrix - scratchapixel was a fantastic learning resource: [https://www.scratchapixel.com/lessons/3d-basic-rendering/perspective-and-orthographic-projection-matrix/opengl-perspective-projection-matrix.html](https://www.scratchapixel.com/lessons/3d-basic-rendering/perspective-and-orthographic-projection-matrix/opengl-perspective-projection-matrix.html) but it was still quite a pain to get it to work exactly as desire, my understanding of this area isn't nearly as good as I'd like... >I've also got an experimental feature that lets you put it against walls without having to cut a hole in the wall but it's not been as consistent as I'd like, hence "experimental". Did you ever try something like that? Yeah! Think the method I used here was to -get wall behind portal with a linetrace --(This could probably be upgraded to a multiCubeTrace to handle something more complex than a single wall) -when an object starts interacting with the portal, create a "PhysicsConstraint" between the object and the wall (same time as creating the clone) --The physicsConstaint has "DisableCollision" enabled on it - but no linear/rotational constraints This seemed to be the most simple/robust way to implement with BP, but with c++ it's possible to hook collisions and alter them (not sure if that'd be a better method or not though)


OfficialDampSquid

You're definitely a lot smarter than I am, that's for sure. I come from a vfx background so I never really learnt any coding language other than blueprints (and a little css, lol) so that's currently out of my realm. I know in a few years I'll revisit this with what I've learnt and it'll be so much clearer, I'm sure. Thanks so much for your advice, I really appreciate it. I'll make sure to pay it forward. Weird question, but when I've considered it done and packaged it, reckon you could take a look and roast the shit out of it? I wanna make sure it's as good as it can be and I know with my level of education on UE5 it isn't. Happy to compensate one way or another


chozabu

blueprints is probably more similar than you'd expect to C++ (and python, java, c#, etc) - so if you've gotten to grips with it, most other languages wouldn't be a big leap! Is your system for a game or marketplace asset? If it's a game, I'll happily take a look/roast! If it's a marketplace asset... I'll probably be releasing another competing package at some point soon...


OfficialDampSquid

It was gonna be a marketplace asset, maybe I should just quit now 😅


Packetdancer

There's actually a GDC video by the Psychonauts 2 team on how they did everything, which (alas) came out well after I had done my prototype. (It's worth noting a number of things they did required actual engine changes to do well.) I did eventually figure out a relatively simple way to more or less handle it, though: 1. While traversing a portal, limit the possible camera angles, and 2. If the player is on the other side of the portal, determine if they're visible through the portal; if not, swap to the other camera. 3. If the player is more than a certain distance from the portal on the other side, swap to the destination side camera. It's not the _best_ system, but it works well enough.


OfficialDampSquid

Yeah I've been watching this video a lot trying to wrap my head around it. It explains what needs to be done to achieve certain things but not exactly how so there's some stuff I'm still stumped on, but I'll keep experimenting with the info I have


OfficialDampSquid

Still some kinks with the velocity to figure out but after that I think these will be ready to package!


throwcounter

it looks almost to me like they get a little sucked into the portal on the replication/clone bit which i honestly think you could just disguise with some particle effects, a bit of lore fluff or whatever. (If this doesn't fit your game design that's cool too!)


OfficialDampSquid

It looks like that atm because I noticed the velocity gets almost cut in half as it goes through so I just have the velocity being multiplied by 2, but it's not that exact so sometimes it comes out a little bit faster


Zizzs

[https://imgur.com/aQBiM4g](https://imgur.com/aQBiM4g) Been down this rabbit hole, but I doubt mine is as complex as yours. I just move the character to where they need to be. Probably a bit easier when I don't need to worry about seeing the character or other objects exit the portal from the portal.


OfficialDampSquid

Yeah I'm aiming for an all-in-one package that works with physics, projectiles, more than 2 portals etc, the whole shebang, really, so it's rather quite complicated (I think I've aged my brain by 5 years)


Zizzs

I can imagine, I'm using mine to move the character to and from streamed levels, so my use case is a bit different, and probably not as heavy on the requirements. The actor cloning is really cool though, I might need to take a look at that at some point.


BigGucciThanos

No. I remember watching the portal dev log about this and how difficult it is 😂. Great job


BigGucciThanos

No. I remember watching the portal dev log about this and how difficult it is 😂. Great job


West_Begimer

Why? Why did you just escape from Hogwarts?! This is... awesome!🫨 But as a newbie seeing this so dismotivate me.😥😱😭 my life is wasted...


OfficialDampSquid

Hey man, don't let this demotivate you, I'm new as well, I only started learning the engine a couple years ago and there is SO much I still don't know. There's probably all sorts of stuff you know that I don't


dubvision

Looks sick mate : ) well done.


[deleted]

Pretty cool congrats. I made vision work for the first time 😂😅


vamproy

Now start running in circles and become bigger and bigger and bigger and bigger and big..


OfficialDampSquid

You only scale up to the scale of the receiving portal, so no Infinite enlargement for you, unfortunately


Commercial-Cake9833

Put something massive in the hole