Godot Recipe: Minimap UI

Поділитися
Вставка
  • Опубліковано 16 січ 2025

КОМЕНТАРІ • 59

  • @GameEndeavor
    @GameEndeavor 5 років тому +19

    I love how you handled the resizing of the UI. It almost seems like magic.

    • @Kidscancode
      @Kidscancode  5 років тому +7

      Godot's UI Containers are magic. Well, first they drive you crazy, but once you get used to how they work, they're great. :P

  • @TackerTacker
    @TackerTacker 5 років тому +10

    Thank you for all your Godot recipes and videos, they help a lot.

  • @Pspisripoff
    @Pspisripoff 5 років тому +2

    I LOVE YOUR VIDEOS MAN! Even tho i dont learn to make games anymore. Your input on Godot tutorials is one of the most important ones out there! Good luck with these videos, long time fan! 10/10

  • @RetrovoiD
    @RetrovoiD 4 роки тому +7

    I'm so excited to try to implement this into my game! You're an inspiration 😍

  • @alexanderglassgames4170
    @alexanderglassgames4170 2 роки тому

    Awesome tutorial! I think that concrete examples like this are the best way of learning Godot. Not sure if I'll be implementing a minimap in my game yet, but this video made me more confident about the prospect of doing it. Thanks for this great channel.

  • @ivanonlyone7160
    @ivanonlyone7160 3 роки тому +11

    I made some helpful tips for beginners (this will work if you followed the entire video tutorial first):
    1. To remove the minimap icon, send this signal when the object is destroyed, along with a link to itself so the map can identify it:
    emit_signal ("removed", self)
    2. To add an icon to the minimap, create this method in the minimap script:
    func new_marker (item):
    var new_marker = icons [item.minimap_icon] .duplicate ()
    grid.add_child (new_marker)
    new_marker.show ()
    markers [item] = new_marker
    item.connect ("removed", self, "_on_object_removed")
    and call it when the object is spawned and set the object itself as a parameter.
    For example: My final part of the weapon drop script:
    func drop_weapon ():
    var pickup = Global.instantiate_node (weapon_pickup, $DropPoint.global_transform.origin)
    find_parent ("Stage1"). get_node ("Interface / MiniMap").new_marker (pickup)
    Please pin this at the top, I hope this helps beginners a lot)

    • @TheFuturisticIdiot
      @TheFuturisticIdiot 3 роки тому +1

      thanks

    • @draugadrotti7155
      @draugadrotti7155 3 роки тому

      Hey Ivan, a little confused on removing the minimap icons. Would the emit_signal be on the mob script or is an Events autoload script needed?
      Also, would you need to remove the instance from the array and the sprite?
      I could very well be overthinking it.

    • @draugadrotti7155
      @draugadrotti7155 3 роки тому

      After spending much of the day and evening working on this, I did manage to figure it out. I'll post what I came up with to show others if they are having similar issues. Any feedback would be greatly appreciated as I am still very new to this and have much to learn. :D
      Mob.gd
      Events.emit_signal("object_destroyed", self)
      queue_free()
      Events.gd:
      signal object_destroyed(target)
      Minimap.gd
      func _ready() -> void:
      Events.connect("object_destroyed", self, "_remove_object")
      func _remove_object(target):
      var object_destroyed = markers.keys().find(target)
      var object_sprite = markers.get(target)
      background.remove_child(object_sprite)
      markers.erase(target)
      I would also like to thank @KidsCanCode for this tutorial. your videos help me a lot with the game that I am working on. :D

    • @diegocorvalan5435
      @diegocorvalan5435 2 роки тому

      i have issues adding icons , do you have a github with the minimap?

  • @royjohns7519
    @royjohns7519 4 роки тому +2

    Such an unappreciated channel. Give a thumb up for the knowledge and sharing experience at least!

  • @Crisisdarkness
    @Crisisdarkness 5 років тому

    Your video modules titled "Godot Recipe", are so useful, thank you estimated instructor, I have always considered you the best, thanks for giving you the time to make these videos, you are a great human being

  • @noohalavi3870
    @noohalavi3870 5 років тому +1

    TYSM, Great Video as always! Keep it up! This will really help me in my game! I've been wanting a vid like this forever!

  • @Nobody-fm6ch
    @Nobody-fm6ch 5 років тому +5

    Finally.. . minimap

  • @TheFuturisticIdiot
    @TheFuturisticIdiot 3 роки тому +1

    when an object is removed, even when i call removed from the object before queue_free(), i get the error "Invalid get index 'position' (on base: 'null instance')"

    • @felipezymor9970
      @felipezymor9970 20 днів тому

      Try to validade if is_instance_valid(object_to_remove) before trying to access position of the object

    • @TheFuturisticIdiot
      @TheFuturisticIdiot 20 днів тому

      @ just a little late on that reply there

  • @gremlinmischief732
    @gremlinmischief732 4 роки тому +2

    Could you make a video on how to do an inventory system with possibly a character screen?

  • @Ludwig1625
    @Ludwig1625 4 роки тому +2

    3:42 this was all 48 for me. I don't know why it took me so long to figure out. 64 didn't work, it like quadrupled the whole thing.

  • @chanellyem
    @chanellyem 4 роки тому +2

    Can we get a tutorial on how to remove the objects from minimap

  • @ewong6685
    @ewong6685 3 роки тому +1

    Really cool. For some reason, though, my markers don't stay inside the outline... and I can't figure out where to fix it... lol, thanks though! I'll probably figure it out sooner or later.

  • @NeilRoy
    @NeilRoy 5 років тому +1

    Very well done!

  • @randomaf947
    @randomaf947 4 роки тому

    This guy a legend!

  • @igorigor3960
    @igorigor3960 5 років тому +5

    17:42

  • @arturcorreia6615
    @arturcorreia6615 5 років тому

    Thanks for all the good content. A suggestion: Can you do a fighting game in Godot?

  • @atalkingcat73
    @atalkingcat73 4 роки тому +1

    Thank you! This was very helpful. However, since all this logic is calculated at every tick in the process function, do you see this hindering performance if there are a lot of units?

    • @Kidscancode
      @Kidscancode  4 роки тому +3

      Lots of things happen every frame.
      As with any performance issue, it's meaningless to guess. *If* the game has a performance issue, and *if* profiling leads to the conclusion that this code is contributing to it, *then* I'd think about changing something.

  • @sriram97
    @sriram97 5 років тому

    Can you make a video on how to make a visual novel themed game on godot like a new layer of screen pop up when the player try to interact with objects or NPCs. I heard that Godot is better with UI than game-maker studio, but i don't see much videos on how to make it.

  • @wash99
    @wash99 4 роки тому

    Can you make tutorial on
    Minimap like metroidvania games has
    For example Castlevania and bloodstaind

  • @axelrandom8944
    @axelrandom8944 Рік тому

    how can i make it circular?

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

    this could be a preference thing, but how would I go about using a texture of the map as the background of the minimap but zoomed in, I think maybe using a shader could work, but I am not a shader pro so I am not sure how to do this, have any ideas?

  • @Talamander
    @Talamander 4 роки тому +2

    I've been struggling with this for several hours, if I am spawning in my enemies after the game starts it creates a slew of markers on the minimap, giving it a streak effect of generated markers. I can't have the update map code in _ready because the enemies don't exist yet, and I've tried using signals but cannot for the life of me get in working. Any advice?

  • @Edel99
    @Edel99 5 років тому

    Hi Chris, thank you for your tutorials. Can you make a series about helping new programmers better 'visualize' vectors? Perhaps a series of exercises that visually create the vectors on the screen. So that we can see how they actually work?

    • @Kidscancode
      @Kidscancode  5 років тому +1

      Great suggestion, thanks!

    • @Edel99
      @Edel99 5 років тому

      @@Kidscancode It would also be great to implement an overlay with the vector variables in action.

  • @KibanyaG
    @KibanyaG Рік тому

    Anybody have some tips on how to implement a map outline that resizes along with the icons? I've implemented a dirty way to show it, but I lose the zoom functionality, because it resizes from the wrong pivot point

  • @LuizAntonio_Gameplay
    @LuizAntonio_Gameplay 4 роки тому +2

    I could create this tutorial and the others you did in C#.
    And a series of FPS.

  • @yakpsipahi2599
    @yakpsipahi2599 5 років тому

    thank you

  • @Johnny-tw5pr
    @Johnny-tw5pr 3 роки тому

    how do I delete the icon if it's outside the grid?

    • @KibanyaG
      @KibanyaG Рік тому

      How about resize it to Vector2(0, 0) so that if the item re-enters the screen it'll not need to be instantiated afresh and can just scale back up into a visible icon?

  • @D0vahkiinGames
    @D0vahkiinGames 4 роки тому

    Sorry, I'm a little late XD, but, could you teach us how to fix that little bug in the end of the video? about nodes that disappear during the gameplay, it could be through messege, plz! Thanks for it in advance, and for all your videos!!

    • @D0vahkiinGames
      @D0vahkiinGames 4 роки тому +1

      I solved XD, here's the code (it is only in the minimap script):
      if !is_instance_valid(item): # it checks if it is valid(not queued free)
      markers.erase(item) # it erases the marker from the script
      else: # < -----you have to use this identation level!
      var obj_pos = (item.position - get_node(player).position) * grid_scale + grid.rect_size/2
      if grid.get_rect().has_point(obj_pos + grid.rect_position):
      markers[item].scale = Vector2(0.5,0.5)
      else:
      markers[item].scale = Vector2(0.2,0.2)
      obj_pos.x = clamp(obj_pos.x,0,grid.rect_size.x)
      obj_pos.y = clamp(obj_pos.y,0,grid.rect_size.y)
      markers[item].position = obj_pos
      Thx a lot for your videos bro!

    • @Kidscancode
      @Kidscancode  4 роки тому +1

      I'm pretty sure I spoke about how to do it. Emit a signal from your nodes that connects to the minimap and removes that item from the "markers" dictionary.

    • @D0vahkiinGames
      @D0vahkiinGames 4 роки тому +1

      @@Kidscancode really? which video? and about adding new markers?

  • @gilbraltar8857
    @gilbraltar8857 4 роки тому

    can this be used for 3D games?? i want to use it for my maze 3d game :)

    • @Kidscancode
      @Kidscancode  4 роки тому

      Certainly. Use the x/z coordinates of the objects to position them on the minimap.

  • @jarodaffygaming276
    @jarodaffygaming276 5 років тому

    does this same code work with a 3d game?

    • @Kidscancode
      @Kidscancode  5 років тому

      Certainly. You can project their positions onto the 3D grid (using their x & z coordinates).

  • @antonsimkin
    @antonsimkin 2 роки тому

    Can you make your voice even more fake scratchy?

  • @classicguy7813
    @classicguy7813 4 роки тому

    Bonjour merhaba please make a game released and we want to play your game

  • @playpro5476
    @playpro5476 5 років тому

    Hello

  • @Giovaniniii
    @Giovaniniii 5 років тому

    dialogue pliss

    • @Kidscancode
      @Kidscancode  5 років тому

      I don't understand.

    • @Giovaniniii
      @Giovaniniii 5 років тому

      @@Kidscancode Sorry,could you practice making dialogues

    • @avgchoobafan
      @avgchoobafan 5 років тому

      @@Giovaniniii there is actually some Assets in the asset library that handle dialogue systems.