Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Portal game in Unity 3D

Discussion in 'Made With Unity' started by ggappleid, Jul 18, 2011.

  1. ggappleid

    ggappleid

    Joined:
    Nov 2, 2010
    Posts:
    82
    Sup guys.
    I have made portal game in Unity.

    GAME. You can play with portals in browser

     
    Last edited: Jan 9, 2013
  2. TheCowMan

    TheCowMan

    Joined:
    Aug 24, 2010
    Posts:
    387
    Wow, that is really good! I'm not sure about investors, mostly because of the copyright factor of the game. If you could find a way to make this game unique from Portal, than I'm sure you could.
     
  3. ggappleid

    ggappleid

    Joined:
    Nov 2, 2010
    Posts:
    82
    Thx. As far as i know, gameplay could not be copyrighted. For example socker, bascketball, or any FPS. I can not use their models, sounds, textures and so on.
     
  4. Chub

    Chub

    Joined:
    Mar 14, 2010
    Posts:
    247
    I am not sure on your ambitions of selling the game but you would make a packet if you put that on the asset store.
     
  5. FTheCloud

    FTheCloud

    Joined:
    Jul 5, 2011
    Posts:
    39
    Amazing, didn't know you could do that with the engine.

    But... where's companion cube?!?!:(

     
    Last edited: Jul 19, 2011
  6. HolBol

    HolBol

    Joined:
    Feb 9, 2010
    Posts:
    2,887
    wow, that's impressive. I'd love to know how it works, but then that would give it away ;). Nice job!
     
  7. TheCowMan

    TheCowMan

    Joined:
    Aug 24, 2010
    Posts:
    387
    Oops, sorry that was the wrong term... I ment, so far there is nothing unique about it, yea its cool, but to get investors you have to present something "new" or "unique". Hope that cleared it up :)
     
  8. ggappleid

    ggappleid

    Joined:
    Nov 2, 2010
    Posts:
    82
    I just want to create Portal game for browser and maybe for iPhone 5 or iPad 3 :)
     
  9. FTheCloud

    FTheCloud

    Joined:
    Jul 5, 2011
    Posts:
    39
    I'd buy it for iPhone any day.

    If you could give it a good story like the original it'd be a guaranteed hit.
     
  10. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,462
    totally badass.
     
  11. Chaoss

    Chaoss

    Joined:
    Jul 8, 2011
    Posts:
    327
    wow kool, I was just going to say I bet you can't make it so you can see through the Portals but then watched the video :D
     
  12. eTag96

    eTag96

    Joined:
    Oct 24, 2010
    Posts:
    110
    @Chaoss: It's easy to make the portals "see through" like this. But you need PRO. or some really awesome Script for Unity Free. the feature's called RenderToTexture.
     
  13. jeffro11

    jeffro11

    Joined:
    Jan 7, 2010
    Posts:
    185
    You can also render another camera to a depthmask shader. This is how portal does it.

    Very good work! Keep it up!
     
    Last edited: Jul 19, 2011
  14. ggappleid

    ggappleid

    Joined:
    Nov 2, 2010
    Posts:
    82
    Thanks. I dont know how to make it now. But i am going to create depthmask shader after i finish with basic portal's stuff, like going through the hole, or keep moment of inertia for object that get into the hole and so on...
     
  15. I am da bawss

    I am da bawss

    Joined:
    Jun 2, 2011
    Posts:
    2,574
    Didn't someone already do this ages ago? I remember I read somewhere Portal was "ported" to iPhone using Unity.
     
  16. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
  17. I am da bawss

    I am da bawss

    Joined:
    Jun 2, 2011
    Posts:
    2,574
    Yeh that's the one! :D
    I wonder who in the forum made it.
     
  18. ggappleid

    ggappleid

    Joined:
    Nov 2, 2010
    Posts:
    82
    It was writen maybe 1 or 2 years ago, and it was not me :)
     
  19. hizral

    hizral

    Joined:
    Apr 27, 2010
    Posts:
    568
    really like to learn how to do this.
     
  20. ggappleid

    ggappleid

    Joined:
    Nov 2, 2010
    Posts:
    82
    This is mathematic only. A lot of mathematic.

    I am not 3D designer, so i cant create it. But if you could make simple model i will add it into project, and next videos (new features) will be with that cube :)
     
  21. Caliber-Mengsk

    Caliber-Mengsk

    Joined:
    Mar 24, 2010
    Posts:
    689
    Well, minus the reflection, I don't see how it would be all that hard to duplicate the portal effect. You'd have to instantiate the object, and just apply all forces/properties to both, relative to the location of both portals.

    Of course. I say this not having tried it. I'm not trying to belittle your work, as with the physics it'd more then likely much harder then I am saying it is, but that's the basic principle. I don't see why it would take 3 weeks to duplicate (like the linked to video only a couple posts above said). Especially if you have pro to do render to texture.

    O-o then again, I think you can have almost any game done and fairly polished in a month, as long as story is done and you have someone to do the art for you while you code. ... A 2 person team = a month then I guess. But at full time, instead of just when you have extra time, then fully doable with that small of a team in a month.

    ... Please don't flame me for saying that all... I just have high expectations of myself and others. I don't see why it takes 3 years to come out with most games, especially with 20+ people working on it full time. Heck, I created a labyrinth game in 6.5 hours for android. Start to finish, only bug is that I didn't tell it to not turn off the screen, so it just shouldn't take that long to do stuff... O-o... No offense to anyone.

    (My issue is I just never sit down and just do it XD)

    O-o I think I've been rambling for a bit... Sorry XD
     
  22. NathanWarden

    NathanWarden

    Joined:
    Oct 4, 2005
    Posts:
    663
  23. hizral

    hizral

    Joined:
    Apr 27, 2010
    Posts:
    568
    Can I learned.
     
  24. c-Row

    c-Row

    Joined:
    Nov 10, 2009
    Posts:
    847
    IIRC from the audio commentary, they also duplicate parts of the level geometry when moving through portals so you can look out of one when the floor to stand on is located under the other.
     
  25. ggappleid

    ggappleid

    Joined:
    Nov 2, 2010
    Posts:
    82
    Good idea, but in Unity that's imposible to do in such way. I think the best solution will be do not copy all geometry, but only that geometry what you are touching now.

    @hizral84 All you see, was created using a bunch of "transformation matrix". All cameras rotation and object moving through portal was made with this technick. My portals can be rotated on any angles, and they still will be working right (i mean physics and image from other portal). It take me a month to make it work like in original portal. There is still many bugs, but in generally it work nice. The next step i am working on, is to going through portal.

    Finally i have created a companion cube :)

     
  26. isil

    isil

    Joined:
    Mar 20, 2009
    Posts:
    6
  27. macdude2

    macdude2

    Joined:
    Sep 22, 2010
    Posts:
    686
    So did you use render textures or a depth mask shader for this?
     
  28. Rush-Rage-Games

    Rush-Rage-Games

    Joined:
    Sep 9, 2010
    Posts:
    1,997
  29. ggappleid

    ggappleid

    Joined:
    Nov 2, 2010
    Posts:
    82
    Since last week i have rewrite portals collision code. Now portals working with moving colliders behind them. Speed of objects up to 25. Add opportunity to have more then 1 pair of portals. Also i have add slowmotion. Next step, is going through portal.

    If someone interested to support project, please visit this collaboration thread on forum.
     
    Last edited: Oct 21, 2011
  30. ggappleid

    ggappleid

    Joined:
    Nov 2, 2010
    Posts:
    82
    Ok Guys. Here is what i got now. I have finished going through portals
    It is still a little buggy, but looks nice. If you still want to collaborate, welcome
     
    Last edited: Oct 21, 2011
  31. Arab

    Arab

    Joined:
    Aug 12, 2011
    Posts:
    42
    Nice job :) Looks nice
     
  32. Rush-Rage-Games

    Rush-Rage-Games

    Joined:
    Sep 9, 2010
    Posts:
    1,997
  33. ggappleid

    ggappleid

    Joined:
    Nov 2, 2010
    Posts:
    82
    Thanks. I am trying to get more from this engine

     
  34. ggappleid

    ggappleid

    Joined:
    Nov 2, 2010
    Posts:
    82
    Here is first tests of new shaders that use ClipPlane to cut invisible parts of objects. I took shader from here. Also xxxDjdogxxx has gave me simple Portal gun.

    I am newbie in Shaders, so i can't modify shader now to make it for example "Self Illum/Specular Bump" or either. Now i just modify light, to get object more lighter

    So i need "shader guru", that can help me with this project. If you know someone, or you want to work with me, please contact me
     
    Last edited: Oct 21, 2011
  35. ggappleid

    ggappleid

    Joined:
    Nov 2, 2010
    Posts:
    82
  36. Rush-Rage-Games

    Rush-Rage-Games

    Joined:
    Sep 9, 2010
    Posts:
    1,997
    Works great!
     
  37. a1s2d3f4

    a1s2d3f4

    Joined:
    Mar 20, 2011
    Posts:
    415
    How do you make objects going through the portals be able to be like half through the portal like that?
     
  38. ggappleid

    ggappleid

    Joined:
    Nov 2, 2010
    Posts:
    82
    Thank you

    For visual part i have used this modified shader. To make it do not collide with other object behind the wall, i have used Physics.IgnoreCollision function.
     
  39. Artimese

    Artimese

    Joined:
    Nov 22, 2009
    Posts:
    794
    Wow this is like the same result as the legit portal game, im impressed....
     
  40. macdude2

    macdude2

    Joined:
    Sep 22, 2010
    Posts:
    686
    So do you use render textures, object duplication or a depth mask to make these portals?
     
  41. ggappleid

    ggappleid

    Joined:
    Nov 2, 2010
    Posts:
    82
    Demo has been updated. You can try to play with portals. It is not ready yet and can glitch a lot. Script that place portal in right point will be soon. Dont shoot to low, because you will fall through floor To grab object, hold E button
     
    Last edited: Oct 26, 2011
  42. CriTaG

    CriTaG

    Joined:
    Oct 4, 2011
    Posts:
    8
    Nice demo, my compliments!
    But I have some problems with the mouse.
    I prefer to have the cursor disappeared, so that I can completely focus on the crosshair.
    I use the Screen.lockCursor = true and it works fine for me.
    But, great job :)
     
  43. janpec

    janpec

    Joined:
    Jul 16, 2010
    Posts:
    3,520
    If Portal game wouldnt have already been made, your game would have amazing potential as seller:D
     
  44. ggappleid

    ggappleid

    Joined:
    Nov 2, 2010
    Posts:
    82
    My fault. Now it's use lockCursor

    lol
     
  45. ggappleid

    ggappleid

    Joined:
    Nov 2, 2010
    Posts:
    82
    I made new video:

     
  46. Warrior1424

    Warrior1424

    Joined:
    Sep 30, 2010
    Posts:
    984
    That music made me laugh :p
     
  47. ggappleid

    ggappleid

    Joined:
    Nov 2, 2010
    Posts:
    82
    Hehe :D This is random Jazz composition from YouTube music templates. I have chosen the shortest one
     
  48. Rush-Rage-Games

    Rush-Rage-Games

    Joined:
    Sep 9, 2010
    Posts:
    1,997
  49. Deleted User

    Deleted User

    Guest

    doing stuff like that is sure not an easy task.
    but it's a pity that people are investing time in things, that are senseless.
    The company VALVE has already exhausted all of the genre with portal2!
    pity about the time of talented scripters.

    the only thing you can do is to put it in the asset store, for others who also won't finish a game with it.
     
  50. foolish-frost

    foolish-frost

    Joined:
    Mar 18, 2009
    Posts:
    169
    I hate to ask, but I'm looking for the visual half of this effect for special effects like projecting a 3d view onto a wall. Would it be at all possible to get a clue about the relative math needed to get the view right?

    Keep in mind, I'm not asking about the more advanced physics of relative motion, I need the relative positioning of the second camera and how it's displayed on the receiving texture/plane.