4 Replies - 407 Views - Last Post: 08 February 2012 - 04:08 AM Rate Topic: -----

Topic Sponsor:

#1 grn_dog_72  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 39
  • Joined: 31-August 11

[Question] portals, not web portals, portals like in portal

Posted 05 February 2012 - 09:15 AM

This is for a game I'm currently in the process of developing. It's really just a platformer, but I want to make worlds as impossible as I can.

I have tried searching for this, but I've only ever found one good example and that was years ago when I was still new at programming and was too ambitious to succeed.

There are examples below of what I would like to achieve with these.
I really just want to know how its done. If you could provide well-commented example code, that would be nice. (emphasis on well-commented)
Even some psuedo-code or a detailed explanation is useful.

Here's a video briefly showing what I would like:
http://www.youtube.c...h?v=xKU28WErq2U

Also, I'd like to do things like these:
#      #
########  # = hallway
#      #  <-> = connection with a portal
####<->#
#      #  I want the ends of all the horizontal hallways to be connected to the vertical hallway
###<-->#  I've seen it in a demo of something before, but I can't find it again
#      #


+----------+
|      ==<-------------------|
|      ==  |      ___________v
|     -----+    ==           ==
|  ==      |    ==___________==
|  ==      |    ^
+---^------+    |
    |___________|

|----------|    |-------------|
This is a room  This is a hallway

==
==  These are doors

again <-> are connections with portals



Is This A Good Question/Topic? 0
  • +

Replies To: [Question] portals, not web portals, portals like in portal

#2 sparkart  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 103
  • View blog
  • Posts: 678
  • Joined: 16-February 09

Re: [Question] portals, not web portals, portals like in portal

Posted 05 February 2012 - 10:24 AM

I think that a simple technique for this type of feature is using another camera and rendering to a texture. Then you could move your main camera or the player to the destination point (the second camera).
Was This Post Helpful? 0
  • +
  • -

#3 grn_dog_72  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 39
  • Joined: 31-August 11

Re: [Question] portals, not web portals, portals like in portal

Posted 05 February 2012 - 12:33 PM

thank you, I'll try that out and report back
Was This Post Helpful? 0
  • +
  • -

#4 ButchDean  Icon User is offline

  • Pro Games Programmer
  • member icon


Reputation: 689
  • View blog
  • Posts: 2,504
  • Joined: 26-November 10

Re: [Question] portals, not web portals, portals like in portal

Posted 06 February 2012 - 10:01 AM

It's a hell of a lot more than hat, and is non-trivial! I recall Portal originally being a student/indie game dev project where Google has just reminded me that it was called Narbacular Drop. Have a look at what they have on their site.
Was This Post Helpful? 0
  • +
  • -

#5 sparkart  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 103
  • View blog
  • Posts: 678
  • Joined: 16-February 09

Re: [Question] portals, not web portals, portals like in portal

Posted 08 February 2012 - 04:08 AM

Rendering the portal is pretty trivial with my suggestion and sure the physics part may be more complicated.

But even in that link what they've suggested seems like a fairly trivial process (i.e. apply physics based on object's center of mass in relation to the portal). So once the object's center of mass passes the portal, reposition the object and apply physics on the object along the normal of the second.

This post has been edited by sparkart: 08 February 2012 - 04:10 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1