Page 1 of 4 123 ... LastLast
Results 1 to 20 of 65
  1. #1

    Portals Demonstration

    Hello all (my first post, so I'll say that)...

    I've implemented working and visually-correct Portals in BGE. As far as I can tell, they look like and work like Portals in Valve's awesome game of that name. Any object will transport (smoothly) through them automatically, preserving (but re-orienting) linear and angular momentum. The Portals themselves can be moved and reoriented as you please.

    Basically the implementation uses VideoTexture.ImageMirror and a little maths. I'm no mathematician, so it took a few hours to get right, so I thought I'd save you all the trouble.

    The script is in the attached blend file. You can use it in your own projects under this license:

    Arrow-key around and enjoy "thinking in portals".

    Attached Images Attached Images
    Attached Files Attached Files
    Last edited by warwickallison; 18-Aug-09 at 22:12. Reason: CC licensing



  2. #2
    Member
    Join Date
    Aug 2006
    Posts
    2,010
    Sweet! you should post this in resources. And maybe my thread of bge demos (se sig). Awesome work!



  3. #3
    Member Mentalturkey's Avatar
    Join Date
    Jan 2009
    Location
    Perth, Australia
    Posts
    331
    Looks awesome, but doesnt work for me



  4. #4
    Member vitorbalbio's Avatar
    Join Date
    Nov 2008
    Location
    Rio de Janeio - Brasil
    Posts
    778
    Amazing Work!!!
    Fantastic! xD
    Cogumelo Softworks
    www.cogumelosoftworks.com



  5. #5
    Member
    Join Date
    Feb 2008
    Location
    Saskatchewan
    Posts
    750
    OH MAN!! That's just plain awesome.
    Pre-procrastinating. Put it off now so you don't have to put it off later.



  6. #6
    Your first post is much more interesting/valuable than my 3,000!
    Great work, bravo!!



  7. #7
    Member Captain Oblivion's Avatar
    Join Date
    Jan 2006
    Location
    MA (USA)
    Posts
    2,308
    Very nice!

    now if only the physics engine were more exposed to python, the portals could be placed in walls and solid objects...
    You can see some of my art on my site, and some more on my blog or my tumblr!

    Right now I am working on this project.

    Balsa man and sulfur girl make a perfect match.



  8. #8
    Originally Posted by Mentalturkey View Post
    Looks awesome, but doesnt work for me
    Check:

    Blender version 2.49a. Portals require ImageMirror from VideoTexture module. Another "interesting" thing I do is call scene.addObject on an object in the current scene (to create the temporary copy so objects are half in two places at once while transitioning through portals). As I understand it, that wasn't always permitted.

    GLSL. Does any GLSL work for ou? That's probably required (I only tested with it on - I'm interested in game creation).

    Otherwise, what sort of problem do you get? I might be able to guess the cause with more info. Any error in the console window?



  9. #9
    Originally Posted by Captain Oblivion View Post
    if only the physics engine were more exposed to python, the portals could be placed in walls and solid objects...
    In Valve's game, portal placement is quite restricted (for gameplay reasons I suspect, more than engine constraints).

    But given similar constraints, I think it would be possible to implement "portalable-wall" objects just using the current APIs:

    1. Make all portalable walls just be Ghost boxes.
    2. At startup, use a script to generate a matrix of small Invisible solid static "blocker" objects coincident with the portalable walls
    3. When a blocker object touches a portal, hide (or just disableRigidBody) it until the portal goes away

    The effectiveness would depend on the resolution of the blocker objects, which you would need to trade-off against performance.

    Portals could be forced to only occur at the grid positions of the blocker objects, so there would be no "gaps".

    The blocker objects would also double as portalgun impact detectors. Unlike the portals in Valve's game, portal projectiles could then even travel through portals (a game mechanic I always thought was sadly missing from Valve's game).

    Hm... this doesn't really sound all that hard to implement. I'm working on something else of which portals are just a minor part (and more restricted than those in Valve's game), otherwise I would have just talked myself into doing it!
    Last edited by warwickallison; 16-Aug-09 at 19:56.



  10. #10
    Member mcguinnessdr's Avatar
    Join Date
    Mar 2008
    Location
    right here
    Posts
    1,034
    I found out about portal just a few weeks ago, and have been thinking of ways to do it in blender. Looks like you have the same problem that I couldn't figure out, it doesn't work to well if the camera goes through the portal. Other than that, great job!
    - One day they woke me up so I could live forever
    - Youtube: VFX shorts, check it out!
    - Minebook: Facebook for Minecraft



  11. #11
    Member Minifig's Avatar
    Join Date
    Sep 2008
    Location
    America, Central time.
    Posts
    3,095
    Awesome!
    This is so much better than a silly teleportation system.
    Feel free to use my texture repository: http://www.cdupload.com/browse/Minifig/3913_FKSa1
    I have a facebook page!



  12. #12
    Member Captain Oblivion's Avatar
    Join Date
    Jan 2006
    Location
    MA (USA)
    Posts
    2,308
    The blocked up walls solution will work in a pinch, but it's tough on resources and the collision for portals would be wonky (not round, and wouldn't fit perfectly around the portal)
    As long as these portals are used like the ones in Prey (fixed to objects or positions, not dynamically created) they will be fantastic.

    In terms of collision, it might be feasible to use a boolean modifier once the realtime-collision updating is implemented (in 2.49b, if I'm not mistaken) However you would need a boolean modifier on each portalable wall for each portal that could be in the scene. Still pretty damn resource heavy.
    You can see some of my art on my site, and some more on my blog or my tumblr!

    Right now I am working on this project.

    Balsa man and sulfur girl make a perfect match.



  13. #13
    Originally Posted by mcguinnessdr View Post
    it doesn't work to well if the camera goes through the portal
    My use of it doesn't have a first-person camera, so I've not looked into that problem.

    But I imagine it would particularly be a problem of resolution - you'd need to have a very high resolution on the VideoTexture. Maybe you could hide that with an excuse for a filter ("light get's blurred by quantum effects when passing through a portal"). ;-)



  14. #14
    Originally Posted by Captain Oblivion View Post
    The blocked up walls solution ... collision for portals would be wonky (not round, and wouldn't fit perfectly around the portal)
    Computer games are all about faking it. Add blockers around the portal, scaled to fill gaps to the wall blocks, plus whatever extra mesh for the portal (if you want them round). This would solve both the wonkiness near the portal and the resource costs (the blocks could be much lower resolution in this case).

    The more I think about it, the more this "blocked up walls" solution corresponds to the constraints in Valve's Portal game. Makes me wonder if their game constraints are not perhaps similar engine constraints.



  15. #15
    Member Captain Oblivion's Avatar
    Join Date
    Jan 2006
    Location
    MA (USA)
    Posts
    2,308
    I believe their portals are hard-coded, using direct access to the physics engine- they cut a section into the wall wherever the Portal is placed (at least, that's what the design documents for the game Portal was based on said, and it's the same people who made Portal)
    I think they might have actually used a method to split up the objects between portals, too, so if the portal was on a shallow wall objects wouldn't bump into the other side. (for example, portals can be placed on very thin panels, and long objects can still pass through them without issue)
    You can see some of my art on my site, and some more on my blog or my tumblr!

    Right now I am working on this project.

    Balsa man and sulfur girl make a perfect match.



  16. #16
    Member otto riis's Avatar
    Join Date
    Jan 2007
    Location
    Long Island
    Posts
    658
    Very cool setup you've got going here, it even handles the infinite depth very well (when you're looking down the tunnel). However one thing I noticed was when you set up two portals face to face, and start making the ball go faster and faster through them, the ball eventually starts to hop, I think it is cause by collision with the bottom of the box portals, still a very nice demo



  17. #17
    Member Minifig's Avatar
    Join Date
    Sep 2008
    Location
    America, Central time.
    Posts
    3,095
    May I use this in a game that I'm making?
    I can reference you however you like...

    It's called Space Laser Battles (Name WIP)
    It is similar to asteroids, and the portals work very well for the sides of the screen!
    Attached Images Attached Images
    Attached Files Attached Files
    Last edited by Minifig; 20-Aug-09 at 09:14.
    Feel free to use my texture repository: http://www.cdupload.com/browse/Minifig/3913_FKSa1
    I have a facebook page!



  18. #18
    Member
    Join Date
    Aug 2006
    Posts
    2,010
    I still expected much more excitement, like 2-3 pages of "yeaahhh!!!!", portals have been wished for a lot here.



  19. #19
    Member cray's Avatar
    Join Date
    Dec 2008
    Location
    France
    Posts
    566
    You are right, Sim88.
    That release is amazing.

    Warwickallison, congratulations
    My contribution : Third person Template



  20. #20
    Member Captain Oblivion's Avatar
    Join Date
    Jan 2006
    Location
    MA (USA)
    Posts
    2,308
    Minifig- if you use the portals for your game, I recommend wither showing them (it would be cool to see the game repeating infinitely in all directions) or dramatically simplify the math (since I'd imagine the sides of the screen can't rotate, you don't need to account for that)
    You can see some of my art on my site, and some more on my blog or my tumblr!

    Right now I am working on this project.

    Balsa man and sulfur girl make a perfect match.



Page 1 of 4 123 ... LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •