Jump to content
shadmar

Portal prototyping

Recommended Posts

I was going to enter the one week game project Aggror started, but I realized I only had 2 evenings to work on it this week, so maybe next time smile.png

 

portal.jpg

 

The portals render their counterpart views using two buffers and the regular diffuse.shader. I use camera:pick to place portals on the walls or roof/floor.

 

When App.player collides with one of them I move player, and set camera orientation to the portal orientation, so all good..

 

My problem is :

 

If I step through the portal I get collision in rapid succesion since player is moved between the portals every frame since collision occur immediatley after player is moved.

 

So I havent figured out a smooth way to solve this, any tip would be appreciated.

Share this post


Link to post

How about a simple boolean variable for each portal that is changed after the player stopped colliding ?

Share this post


Link to post

That is so cool.

 

I might consider a callback to discard specific collisions, just to support this.

Share this post


Link to post

I always thought we needed OnCollideEnter, OnCollideLeave which might help with this and many other things as well.

 

Maybe chaining multiple collides can work. It's like having 2 lasers at the entry of a door. By telling which one breaks first and which one breaks second you can tell which way someone is going. If you are coming out from a portal you don't trigger the teleporting logic. If you are going into a portal you trigger the teleporting logic.

Share this post


Link to post

What you need to do is have two player entities. For each one, discard collisions that lie on the wrong side of your portal plane (which requires me to add a new callback). Then take the average resulting position and force them both to that.

 

This guy does some insane things using that technique:

Share this post


Link to post

I always wondered who would be the first person who would make a good attempt on portals. It looks really cool already Shadmar smile.png

 

And btw, you can simply submit this for the game week tournament if you wish. Prototypes , level designs etc are just as welcome as small games.

Share this post


Link to post

Thanks for the tip on the 2 player entity idea, it sounds like it could work.

I'll upload my project when I'm back from my trip (wednesday)

 

Thanks.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...