I RECREATED Portal in Godot!

Поділитися
Вставка
  • Опубліковано 24 гру 2024

КОМЕНТАРІ • 85

  • @TheName_J
    @TheName_J 2 дні тому +1

    Yo! I just found ur channel! I gotta say (as someone who wants to make a Portal fangame with godot) You REALLY nailed the mechanic!

    • @minapecheux
      @minapecheux  2 дні тому +1

      Thank you so much! I'm glad you liked the video and found it interesting - this mechanic was definitely hard to reproduce, and I think there are a lot of things I could improve... but I'm really happy with this first step! 😉

  • @mrlucky974
    @mrlucky974 5 місяців тому +6

    Awesome! It was cool to see you tackle this game dev challenge.

    • @minapecheux
      @minapecheux  5 місяців тому

      Thanks, I'm really glad you liked it! (and very happy I managed to get something half-decent ^^)

  • @luckyknot
    @luckyknot 5 місяців тому +1

    You are levelling up Mina, another amazing one!!!

  • @Champs3443
    @Champs3443 5 місяців тому +2

    great explanation ! Your devlogs are one of my favorites :)

    • @minapecheux
      @minapecheux  5 місяців тому

      Yay, thank you so much for the nice comment! I'm glad you find these videos interesting :)

  • @generrosity
    @generrosity 5 місяців тому

    Well done! I have a game design that involves (simple) portals, so keen to see where you take this 👌

    • @minapecheux
      @minapecheux  5 місяців тому

      Thanks, glad you liked it! And good luck on your project ;)

  • @kooky74
    @kooky74 5 місяців тому

    Excellent. As any softawre enginerr fan of portal I also did it using a cusom engine. I had same problems but there was no tutorial in the past. The rule was to use the computation between the entrance speed and camera orientation with the entrance normal and use this to modify the speed vector and the camera orientation using the exit normal. I don't know if you used this method but as I remember that worked for me 😂. But it was a long time ago lol. Thx for the video

    • @minapecheux
      @minapecheux  5 місяців тому +1

      Thanks for the kind comment, glad you liked the video!
      Yup I did something similar all in all, with perhaps some shortcuts from Godot... ^^

  • @lukabrasi001
    @lukabrasi001 5 місяців тому

    you can fix the portals by not applying the tonemapper to the portal surface. you see, when you use viewports, the sight you see already has tonemapping on it, and applying it again causes this weird issue where the sight you see through the portal has this extra brightness added to it. omiting it makes all the difference

    • @minapecheux
      @minapecheux  5 місяців тому

      Heya, thanks a lot for the advice! That's definitely one of the key things I'd like to fix for a v2, as soon as I get a chance :)
      Cheers!

  • @JohngoLumpo
    @JohngoLumpo 5 місяців тому

    This is a really really good explanation. I tried to do a similar thing some time ago and I now realize why it did not work😅.
    Thanks for this content!

    • @minapecheux
      @minapecheux  5 місяців тому

      You're very welcome, thanks so much for the kind comment! :)

  • @ACrazyMonk
    @ACrazyMonk 5 місяців тому

    This was great! Definitely this type of video

    • @minapecheux
      @minapecheux  5 місяців тому +1

      Thank you so much, I'm glad you liked it! And I'm definitely searching for other ideas of devlogs as we speak... :)

  • @Z_Z.t
    @Z_Z.t 5 місяців тому

    I just applied portal transformantions to a player's transform and velocity, everything was simple (it even worked with portals that has different sizes). I left code below. The main part of it is:
    func _physics_process(delta):
    if !otherside:
    process_mode = Node.PROCESS_MODE_DISABLED
    return
    for i in len(tp_check_list):
    var b = tp_check_list[i]
    if (b.global_position - global_position).dot(basis * Vector3(0,0,1)) < 0.0:
    var endpoint := otherside.global_transform
    endpoint.basis *= Basis(Vector3(-1,0,0),Vector3(0,1,0),Vector3(0,0,-1))
    b.global_transform = endpoint * global_transform.inverse() * b.global_transform
    b.velocity = endpoint.basis * global_transform.basis.inverse() * b.velocity
    tp_check_list.remove_at(i)

    • @Z_Z.t
      @Z_Z.t 5 місяців тому

      #@tool
      extends Area3D
      class_name Portal
      @onready var cam := $SubViewport/Camera3D
      @onready var woj : PGWorld
      @onready var pcam : Camera3D
      @export var otherside : Portal #may be lookin directly at other portal
      var aps : bool = true
      var tp_check_list := []
      @export var hsize : Vector2 = Vector2(1,1) :
      set(value):
      hsize = value
      $visual.mesh.size = hsize
      $visual2.mesh.size = hsize
      $teleport.shape.size = Vector3(hsize.x,hsize.y,1)
      if otherside:
      if aps:
      otherside.aps = false
      otherside.hsize = hsize
      else:
      aps = true
      func _ready():
      pcam = get_viewport().get_camera_3d()#woj.client.cam
      #$SubViewport.size = floor(get_tree().get_root().get_viewport().size*0.5)
      $visual.mesh.size = hsize
      $visual2.mesh.size = hsize
      $teleport.shape.size = Vector3(hsize.x,hsize.y,1)
      pass # Replace with function body.
      #disable processing on locations should optimize em
      func _physics_process(delta):
      if !otherside:
      process_mode = Node.PROCESS_MODE_DISABLED
      return
      for i in len(tp_check_list):
      var b = tp_check_list[i]
      if (b.global_position - global_position).dot(basis * Vector3(0,0,1)) < 0.0:
      var endpoint := otherside.global_transform
      endpoint.basis *= Basis(Vector3(-1,0,0),Vector3(0,1,0),Vector3(0,0,-1))
      b.global_transform = endpoint * global_transform.inverse() * b.global_transform
      #b.scale = -b.scale
      b.velocity = endpoint.basis * global_transform.basis.inverse() * b.velocity
      tp_check_list.remove_at(i)
      func _process(delta):
      #camera effects and adjustments goes here
      if !otherside:
      #if !(Engine.editor_hint):
      process_mode = Node.PROCESS_MODE_DISABLED
      return
      #$visual.visible = (pcam.global_position - global_position).dot(basis * Vector3(0,0,1)) > 0.0
      if !($visual.visible):
      $SubViewport.render_target_update_mode = SubViewport.UPDATE_DISABLED
      return
      else:
      $SubViewport.render_target_update_mode = SubViewport.UPDATE_WHEN_VISIBLE
      scale = Vector3(1,1,1)
      var endpoint := otherside.global_transform
      endpoint.basis *= Basis(Vector3(-1,0,0),Vector3(0,1,0),Vector3(0,0,-1))
      cam.global_transform = endpoint * global_transform.inverse() * pcam.global_transform
      cam.fov = pcam.fov
      var relcp : Vector3 = pcam.global_position - global_position
      #TODO: plane discard shader
      #cam.near = clamp(relcp.distance_to(relcp.clamp($visual.get_aabb().position,$visual.get_aabb().end)),pcam.near,pcam.far)
      pass
      func _on_body_entered(body):
      if body is PhysicsBody3D:
      tp_check_list.append(body)
      func _on_body_exited(body):
      var b = tp_check_list.find(body)
      if b != -1:
      tp_check_list.remove_at(b)

  • @dimadoesdev
    @dimadoesdev 5 місяців тому

    That’s pretty nice, good job and nice video!

    • @minapecheux
      @minapecheux  5 місяців тому +1

      Thanks! I'm glad you liked it :)

  • @thedarknessinu3151
    @thedarknessinu3151 5 місяців тому

    As a behinner that just started to experiment with the Engine I really liked that video ^^
    And what really catched me at the end was David Tennant as the Doctor ❤

    • @minapecheux
      @minapecheux  5 місяців тому

      I'm so glad you liked it, thanks for the nice comment! And yup - I thought if I could sneak in a Whovian reference... I had to :D

  • @Pashaportino
    @Pashaportino 5 місяців тому

    i enjoyed the devlog and would be up to watch more. i think this video is a perfect example of how literally anything that one might want to create themselves will think "oh this should be pretty easy ill just do this" and it works but then the realization hits that the thing is jank af and 90% of the time will go to polishing the thing so that it works properly. the gamedev struggle 😂

    • @minapecheux
      @minapecheux  5 місяців тому +1

      Haha, so true! Thanks for the nice comment, I'm glad you liked the video, and I'm definitely listing a few other ideas for projects, demos, devlogs, features, etc :)

  • @Savan__ru
    @Savan__ru 5 місяців тому

    The perfect channel For Beginners 💔🙂

    • @minapecheux
      @minapecheux  5 місяців тому +1

      Thank you so much!! :)

  • @JdThe65th
    @JdThe65th 5 місяців тому

    Haven't gotten to look at your source code yet, but I notived that your portals are likely rendering the tonemapping twice, which leads to the colors being brighter in the portal then suddenly jumping back when you go through it.
    To fix this, you can override the world environment of the Portal camera to have its tone-mapping set to Linear. Overall, neat project though! I'm definitely gonna check out the source code.

    • @minapecheux
      @minapecheux  5 місяців тому +2

      Thanks for the nice and interesting comment! I completely agree, the luminosity change upon teleportation is one of the things I really want to fix when I get the time to work on a v2 - and thank you for your advice, I'll definitely look in that direction :)
      Cheers!

  • @thisblade9053
    @thisblade9053 4 місяці тому

    Спасибо! Твое видео очень помогло мне теперь я знаю как реализовать портал из портал!❤

  • @ScrapyDo0
    @ScrapyDo0 5 місяців тому

    this is really cool

  • @gouuu6046
    @gouuu6046 5 місяців тому

    Nice video

  • @louis1001
    @louis1001 5 місяців тому

    I think it would be useful to remove the current player controller, work on it as if there was no gravity (like a flight simulator) and then make a new player controller that could have a custom gravity vector. Then if the gravity vectors don't match when crossing, you can interpolate between them to point the character downwards smoothly.

    • @minapecheux
      @minapecheux  5 місяців тому

      That's a really interesting idea! I don't know how easy the interpolating-to-normal state switch would be, but that's definitely something worth exploring... for now, my FPS character is sort of "cancelled" for a while after coming out of a portal, until I collide with something, but I'm not sure that's the best approach, so I'm absolutely writing down your idea in the back of my head for (hopefully!) future reworks :)
      Thanks!

  • @tzbq
    @tzbq 5 місяців тому +1

    nicee i also have been trying to make portal in godot for some time, and my issue was clipping the camera's view so that it only renders things that are behind the portal, and not be "blocked" by the wall or things behind it, how did you fix that?

    • @minapecheux
      @minapecheux  5 місяців тому +1

      Thanks! Honestly I think that's where the "good level design" comes in - and mine is still a bit flawed in some places... I believe that my using planes (that are usually rendered only one-sided, and so are invisible when seen from behind) you can get around that issue, but I don't know if that's the best way to do it ^^
      Here I've made 3D models in Blender that are flattened cubes with one face removed, so that it doesn't block the camera from inside the portal ;)
      Hope it helps,
      cheers!

    • @tzbq
      @tzbq 5 місяців тому

      @@minapecheux oh your walls are just not rendered from the other side?

    • @minapecheux
      @minapecheux  5 місяців тому

      @@tzbq Yup! I've basically made a level that "looks solid" from the inside, but where I have white walls I have no face on the other side to allow cameras to look through ;)

    • @tzbq
      @tzbq 5 місяців тому

      @minapecheux oh nice, level design will be a bit tricky though because if anything is behind the portal from the perspective you're looking at it it can block the camera

    • @minapecheux
      @minapecheux  5 місяців тому

      @@tzbq yep, that's why I'm not sure that's the best way to do it... for now it works but I may need to do something a bit sneakier with culling masks or custom shaders in the future ;)

  • @thedracon4318
    @thedracon4318 5 місяців тому

    You should tweak your shader settings or the portal camera settings to make the portals look more seemless

    • @minapecheux
      @minapecheux  5 місяців тому

      There's definitely a lot of ways I could improve/change the portals visuals to match various styles... I'm pretty happy with how I managed to recreate Portal's effect so far, but I could totally make it better ;)

    • @woumGameDev
      @woumGameDev 5 місяців тому

      @@minapecheux Soon the video "how to upgrade the portal of my top tiers portal video"? :D

    • @minapecheux
      @minapecheux  5 місяців тому

      @@woumGameDev Haha, I wish! :)

  • @jefreestyles
    @jefreestyles 5 місяців тому +2

    Maybe they have an identical room copy somewhere and rotate that room accordingly when the portal is created and then orientate it upright slowly. Then the original room becomes the 2nd room. Just spit balling crazy ideas. Anywayz, Portal 3 when?

    • @jefreestyles
      @jefreestyles 5 місяців тому

      Hm my idea is kinda bad. Just realized there are items not stuck on the walls. And items can also get thrown into the portal.

    • @minapecheux
      @minapecheux  5 місяців тому +1

      Haha no worries - Portal's physics is... well pretty mind-reversing ^^ And think there are definitely some features that work with a copy (for example pushing objects through the portals, so that you can get the "mirrored" copy on the other side)!
      For the rooms though I think it wouldn't work...
      But I'm glad you're interested in the project, and thanks for the comment! :)

  • @collinvisser7108
    @collinvisser7108 5 місяців тому

    Neat well done

  • @Animatician
    @Animatician 5 місяців тому

    You know what's hilarious? for the past couple of weeks, i've had the same idea of making portal 3. I *also* wanted to put it on UA-cam, and i *also* wanted to do it in Godot! I know french, which im not sure if you do or not, im just assuming because of the french last name (doesnt have to do with game dev but its another similarity). THE COINCIDENCE.

    • @minapecheux
      @minapecheux  5 місяців тому

      Haha, indeed, what a coincidence! And yup, I'm French ;)
      Good luck on your project(s) then :)

  • @Tiagofr3
    @Tiagofr3 4 місяці тому

    Great!!!!

  • @dawnreaver
    @dawnreaver 5 місяців тому

    So Mina is working on Portal 3 confirmed :D

    • @minapecheux
      @minapecheux  5 місяців тому +2

      Haha, I wish! I think I'm nowhere near the real thing, but that would be so sick if Valve made a 3rd episode... (or perhaps "Portal Alyx" in VR? :D)

  • @Elzewyr
    @Elzewyr 3 місяці тому

    What transformation did you use to solve the problem of horizontal exit portals projecting incorrect view that you show at 4:06?

    • @minapecheux
      @minapecheux  3 місяці тому

      Heya! Basically, I ended up chopping the process in really granular steps and, in particular, I first apply a basic transform that still has the problem shown at 04:06, but then I reapply some reverse operations to "tilt the head back up" and put my entire character in the right direction.
      If you're curious about the details of this tutorial and other game remakes or tutorials, you can check out my Patreon memberships over here: www.patreon.com/minapecheux ;)
      Hope it helps a bit,
      cheers!

    • @Elzewyr
      @Elzewyr 3 місяці тому

      @@minapecheux I have not tried the character rotation yet, but to rotate the portal camera in sync with the player's camera relative to the rotation of both portals it is possible to use:
      transform = this_portal.transform * other_portal.transform.affine_inverse() * player_camera.global_transform
      I wonder if anyone else found this concise solution

  • @lowdribby2944
    @lowdribby2944 5 місяців тому

    love you

  • @squach90
    @squach90 5 місяців тому

    Super vidéo

  • @minadune
    @minadune 5 місяців тому

    Wow! ❤

  • @timmygilbert4102
    @timmygilbert4102 5 місяців тому

    Speaking of which, is there an equivalent to replacement shader from unity in Godot? Ie render a whole scene with a single shader instead of per material, for effect like night goggles 🥽?

    • @minapecheux
      @minapecheux  5 місяців тому

      Mmh, as far as I know, there is a replacement shader system yet in Godot. Though if you want to make a global full-screen effect like that, you can use the custom post-processing feature (docs.godotengine.org/en/stable/tutorials/shaders/custom_postprocessing.html) :)
      I worked with it when I made Godot shaders for my Patreons, and it's pretty easy to work with: you just put a ColorRect above your scene with a custom material, and then you get the screen texture, and you're all set :)
      But yep, not exactly the same,
      so I don't know if that will solve your problem!
      Cheers :)

    • @timmygilbert4102
      @timmygilbert4102 5 місяців тому

      @@minapecheux oh thanks, sad, I rely on that so much...
      really I wanted to capture UV data in a viewport to get a custom cheap GI effect (uv mean any point of a custom lightmap buffer can reference another in the same lightmap)

    • @minapecheux
      @minapecheux  5 місяців тому +1

      Wow, looks like a cool plan/project! Note that I might not know everything about Godot shaders - perhaps you could leave a message in a Github thread? Somebody in the community may know more! :)

  • @Ben360x
    @Ben360x Місяць тому

    How would you alter the code to allow other objects like rigid bodies go through it

    • @minapecheux
      @minapecheux  Місяць тому

      Heya! Honestly I haven't had the time to do too much tests yet, but I think you might need to give some scripts to the objects you want to be able to pass through the portals, so that they act a bit like the player and auto-re-orient themselves properly.
      Moreover, you may need to create a temporary copy of the object while you're nearing the portal, so that it appears on the other side as well...
      I hope it helps! Cheers :)

  • @alex.g7317
    @alex.g7317 5 місяців тому

    Did you use generative AI for some of your thumbnails?

    • @minapecheux
      @minapecheux  5 місяців тому +1

      Heya! Yup - I used it for some recent Godot tutorials + the 1 minute tutorials :)
      (Although I don't necessarily agree with the philosophy and how all the data is fed to the algorithms... I have to admit it does save me a lot of time...)

    • @alex.g7317
      @alex.g7317 5 місяців тому

      @@minapecheux ah, I see. Thanks for your honesty.

  • @Xergan
    @Xergan 5 місяців тому

    Très très forte

  •  Місяць тому

    Je préfère tellement vos vidéos en français 🎉 merci pour tout ce travail

    • @minapecheux
      @minapecheux  Місяць тому +1

      Merci pour le gentil commentaire ! Malheureusement pour le moment faire les vidéos en français prend trop de temps par rapport à la proportion de mon public francophone... ^^

    •  Місяць тому

      @@minapecheux argh !!! I could have bet it. I am reducing the speed. I like your topics. Thanks

  • @ezicyt
    @ezicyt Місяць тому

    make that 336 likes this is so cool

    • @minapecheux
      @minapecheux  Місяць тому

      Haha thank you very much for the kind comment and the support! :)

  • @darkgeem
    @darkgeem 5 місяців тому

    Nice job! :D
    For further reference, this video also explains the inner workings of portal's portals in depths, if you're interested in other implementations
    ua-cam.com/video/_SmPR5mvH7w/v-deo.html

    • @minapecheux
      @minapecheux  5 місяців тому

      Thanks, glad you liked it :)
      And thank you very much for the additional ref, too - I came across it but it wasn't as much a work basis as the others... still, totally worth mentioning! ;)

  • @sysfab
    @sysfab 5 місяців тому

    teleportation is horribly wrong.. just because you just teleporting player, but not passing trought it.

    • @minapecheux
      @minapecheux  5 місяців тому +1

      Heya - I agree that this is far from perfect! It was a pretty big project and honestly I'm glad I got this far within my few allotted days, but I'd definitely love to revisit and improve on all that :)
      Hopefully a future version will fix some of the issues for you! ;)