Sign in to follow this  
Thokas

Portal Gun - Like Teleportation

Recommended Posts

Hey guys! I'm working a voxel exploration game. I'm pretty far along with it, and I decided that I need to have my own portal gun inspired weapon. I'm a novice engine programmer. This is my first step outside of excel VBA development. Point is, handle me with gloves and if you have any examples I would greatly appreciate it.

Most I have so far is camera setting and a way to display the viewport on a decal. What I don't know where to begin is how to make the game teleport objects the way Portal does. I love how seamless it is and I think something similar would work well with the game I am creating. How would you guys suggest I go about making my own version of a Portal like teleportation experience.

I'm using C# and XNA 4.0 if that give you and idea of the environment I am in.

Share this post


Link to post
Share on other sites
The basic mechanism is very simple: you use a flat shape (rectangular is easiest) that acts as the "portal." When an object collides with the portal, you teleport it into the "exit" portal, and do some simple local-coordinate-space transforms to make sure that things like the momentum behavior carries over.

Where things get messy is with full physics, and if you want to allow things to be partially in one portal and out the other. If you opt for the simplest approach, you can still get really good-looking results with a decent amount of effort. If you want the whole package deal, though, be prepared to invest a lot of work.

I'd be happy to elaborate on the processes involved if you're interested in going the extra mile :-)

Share this post


Link to post
Share on other sites
[quote name='ApochPiQ' timestamp='1313920515' post='4851840']
The basic mechanism is very simple: you use a flat shape (rectangular is easiest) that acts as the "portal." When an object collides with the portal, you teleport it into the "exit" portal, and do some simple local-coordinate-space transforms to make sure that things like the momentum behavior carries over.

Where things get messy is with full physics, and if you want to allow things to be partially in one portal and out the other. If you opt for the simplest approach, you can still get really good-looking results with a decent amount of effort. If you want the whole package deal, though, be prepared to invest a lot of work.

I'd be happy to elaborate on the processes involved if you're interested in going the extra mile :-)
[/quote]

Greetings! Thanks for the reply.

I had given thought to a simple teleport approach. It could work with what I want to achieve. I'd like to have anything that does move to be able pass through the portals. However, I am absolutely in love with Portal's implementation of the portal experience. Presentation is everything, the seamless approach is what I want. I just can't wrap my mind around how to actually get it done. If you could elaborate on the methods involved I'd greatly appreciate it.

Share this post


Link to post
Share on other sites
[quote name='Thokas' timestamp='1313934785' post='4851893']
I just can't wrap my mind around how to actually get it done
[/quote]

have you tried the "Developer Commentary" ?
i cant remember most of the stuff from it, but if i remember correctly, they used a physics approxomation on the cube.
maybe used two, one on either side.
very interesting how they solve some of the stuff.

Share this post


Link to post
Share on other sites
One of the things I remember from a Valve article is, when going trough a portal pair, an object can collide with itself. In gameplay terms. I wonder what does that even means when it comes to low-level. Clearly, no physics API I know supports portal natively and likely never will.

Share this post


Link to post
Share on other sites
[quote name='ryan20fun' timestamp='1313936482' post='4851902']
[quote name='Thokas' timestamp='1313934785' post='4851893']
I just can't wrap my mind around how to actually get it done
[/quote]

have you tried the "Developer Commentary" ?
i cant remember most of the stuff from it, but if i remember correctly, they used a physics approxomation on the cube.
maybe used two, one on either side.
very interesting how they solve some of the stuff.
[/quote]

Great tip!

They talk about it a few times in this clip
[url="http://www.youtube.com/watch?v=Kz97yu1SPxk&NR=1"]http://youtu.be/Kz97yu1SPxk[/url]

They mentioned creating a bubble around portal locations to handle physics calculations. To shorten time it would take to process object interactions. They also mention that said physics was separate from the standard source engine. Are was much simpler to help processing times.

I haven't actually started adding any objects that require physics interactions yet. Most I have is player jumping. It's all new to me so I'm taking it one step at a time. So designing said bubble might be a bit of a hurdle for me.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this