How to Save User Preferences in Godot 4 - Godot Fundamentals

แชร์
ฝัง
  • เผยแพร่เมื่อ 2 พ.ย. 2024

ความคิดเห็น • 61

  • @riccardobrunelli9286
    @riccardobrunelli9286 6 หลายเดือนก่อน +3

    Ive watched a few save/load tutorials for godot,but my doodoo brain couldnt really understand,yours was the only one that managed to help me learn exactly how it works,thanks a lot

    • @GameDevArtisan
      @GameDevArtisan  4 หลายเดือนก่อน

      Haha, so glad this one helped make it click!

  • @user-nc9on4bp2o
    @user-nc9on4bp2o ปีที่แล้ว +4

    Wow so informative, crystal clear, you would absorb the entire lesson. Your vocal cords emit melodies. It's like listening to a beautiful orchestra while learning something. Excellent, Excellent video.

    • @GameDevArtisan
      @GameDevArtisan  ปีที่แล้ว

      Wow, thank you! I'm glad you enjoyed it!

  • @ChaunceS
    @ChaunceS ปีที่แล้ว +2

    It is very clean, concise and to the point. Great job man!

  • @zemeio1184
    @zemeio1184 6 หลายเดือนก่อน +5

    Very informative, but I should warn you there is a security issue with the way you handle the saving.
    Resources can have built in scripts, which means you can run arbitrary code without your knowledge whenever you load your resources. This means people could share their settings on the internet with malicious intent, pretending to be helpful, and run basically anything in your computer.
    Usually the way to solve this is to use a safe serialization, like JSON or something like that, but it can increase the code a lot. There are some new ways now of doing it, like the binary serialization api, which now can store with the object id to avoid this issue. I haven't tested them out, and they won't serialize everything, so it may be a little more troublesome to use, but I think it's worth checking them out.

    • @JoeBloggs-4096
      @JoeBloggs-4096 4 หลายเดือนก่อน +1

      Would this be an issue for mobile (Android+IOS)?

  • @Snafuey
    @Snafuey 11 หลายเดือนก่อน +1

    I hope the time between videos is cause your working on something cool. Your the best tutorial maker for Godot!

    • @GameDevArtisan
      @GameDevArtisan  11 หลายเดือนก่อน

      Thanks for the encouragement. New video just dropped, so let me know if it was cool enough!

    • @Snafuey
      @Snafuey 11 หลายเดือนก่อน

      @@GameDevArtisanIt was well worth the wait.

  • @mohamedfayaz3601
    @mohamedfayaz3601 ปีที่แล้ว +1

    Waiting for next one. Don't stop the series 🔥🔥🔥🔥🔥🔥🔥🔥

    • @GameDevArtisan
      @GameDevArtisan  ปีที่แล้ว

      Plenty more to cover, taking a break from the series for the next video, but we'll be continuing for sure!

    • @mohamedfayaz3601
      @mohamedfayaz3601 ปีที่แล้ว +1

      Thanks for the reply! Also, It would be so helpful if we could get simple game development from scratch to finish for Godot 4. That will show me, as a beginner, where to work and organise things.@@GameDevArtisan

    • @GameDevArtisan
      @GameDevArtisan  ปีที่แล้ว

      Yeah that's a good idea. Like a learning cosing from scratch using Godot and Gdscript

  • @f1x_my_power
    @f1x_my_power ปีที่แล้ว +1

    Wonderful tuts, all of them very useful! Still waiting for new one)

    • @GameDevArtisan
      @GameDevArtisan  ปีที่แล้ว

      Very soon! Got one in the works now!

  • @connorjade5460
    @connorjade5460 9 หลายเดือนก่อน +1

    dude u r a life saver u saved my sanity

    • @GameDevArtisan
      @GameDevArtisan  8 หลายเดือนก่อน +1

      You bet! Glad it was helpful.

    • @connorjade5460
      @connorjade5460 8 หลายเดือนก่อน

      @@GameDevArtisan thanks bud

    • @connorjade5460
      @connorjade5460 7 หลายเดือนก่อน

      @@GameDevArtisanHi how can you save inventory data through resources???

    • @Neqator
      @Neqator 3 หลายเดือนก่อน

      @@connorjade5460 About the same...
      You create a list or array listing your inventory and save it to a file.

  • @fkeyzuwu
    @fkeyzuwu ปีที่แล้ว +1

    really clean! nice video

  • @nopeno9130
    @nopeno9130 ปีที่แล้ว +1

    Hello, this series has been helpful and I'd like to thank you for creating it. If I may make a small suggestion, if the videos are a series it would help if you added a number to the names. This would help when people want to look at the previous lesson for whatever reason(maybe when you miss some detail, for example); I've run into a number of times where I wasn't sure which video came before the one I was watching because they're only named and not numbered, and so I'd have to go back and look at the posting order or rely on the order of my tabs. Maybe I've missed something and they're numbered somewhere, but it would be most helpful to have it in the title. Once again, thanks for everything and I don't want to sound unappreciative.

    • @GameDevArtisan
      @GameDevArtisan  ปีที่แล้ว +1

      Thanks, this is a great point, currently there isn't a direct understanding of which video follows which in the series, unless you follow it directly from the playlist. I'll consider making the change and see if that helps out!

  • @Alkhemi
    @Alkhemi 5 หลายเดือนก่อน +1

    Nice video about Resources. But i think Godot's ConfigFile is more suitable for User Preferences. The problem with Custom Resource, it can embed executable scripts that would create security issue.

    • @GameDevArtisan
      @GameDevArtisan  5 หลายเดือนก่อน

      Yea, I would tend to agree. Different types of data may require different methods of saving, for a simple approach, saving with ResourceLoader is nice. I would love to do a deeper dive video covering the variety of saving methods.

    • @Alkhemi
      @Alkhemi 5 หลายเดือนก่อน

      ​@@GameDevArtisanYes, PackedDataContainer is another option that appears to be underutilized.

  • @jaxterity
    @jaxterity 9 หลายเดือนก่อน

    I guess this is a series of videos?
    Didn't realize until I talked to the Godot Discord, as well as read the comments below.
    I was typing Game. and was confused why I was getting error.
    I was kind of guessing it was a Godot class.
    But apparently it is a class created in another video from this channel.
    (just note/reference for others)
    I'll have to go through and watch from the start to make sure I'm not missing anything.

    • @GameDevArtisan
      @GameDevArtisan  8 หลายเดือนก่อน

      Yea, sorry I try and mention it at the beginning of the episodes, hopefully you find the full series valuable.

  • @oneplayerparty9716
    @oneplayerparty9716 ปีที่แล้ว +1

    hello sir. i like your tutorials, they are very helpful and easy to understand.
    just a question, are you planning on making a dialog system tutorial?
    thanks for the videos.

    • @GameDevArtisan
      @GameDevArtisan  ปีที่แล้ว

      I have a few ideas on Dialog systems, not sure when, but I would imagine a video will come at some point in the future. I've got quite the backlog of topics I'd like to cover.

  • @Pro_max5
    @Pro_max5 3 หลายเดือนก่อน +1

    Thank you ❤

    • @GameDevArtisan
      @GameDevArtisan  3 หลายเดือนก่อน

      You're welcome 😊

    • @Pro_max5
      @Pro_max5 3 หลายเดือนก่อน

      @@GameDevArtisan 😁❤

  • @fading-sun-studios
    @fading-sun-studios 6 หลายเดือนก่อน

    Thx reading will always be better> :)

    • @GameDevArtisan
      @GameDevArtisan  6 หลายเดือนก่อน

      You’re welcome 😊

  • @BFVybeDev
    @BFVybeDev ปีที่แล้ว +1

    okay, this video is awesome. i was wondering if you would know how to save a instance. so my game allows the player to create the map around s/he. but i cant figure out how to save the scenes. ive tried configs, json, packedscenes etc. i just think i need an extra pair of eyes. awesome vid. and thanks!

    • @GameDevArtisan
      @GameDevArtisan  ปีที่แล้ว +1

      If you take an existing node and use the ResourceSaver to save it as a PackedScene, it should retain the values of things like position and other variables you've defined. When you reload the scene from the PackedScene resource, you must make sure that things like your ready function do not override these values. Another method is creating a save and load function that handles the saving off of specific values to files and reading them when the load function is called. If you want to jump into our discord (link in the video descriptions) you can start a thread in our #help-and-support channel and we can look at source code and discuss ideas!

  • @Pleasantnoob64
    @Pleasantnoob64 2 หลายเดือนก่อน

    Hello, using this method how would go about setting up a check button that enables fullscreen

    • @Pleasantnoob64
      @Pleasantnoob64 2 หลายเดือนก่อน

      I mean saving the setting

  • @connorjade5460
    @connorjade5460 6 หลายเดือนก่อน

    Hi. How can we save the user preferences if the ui node we used is option button (enum one) in place of alider??? Please help....

    • @GameDevArtisan
      @GameDevArtisan  6 หลายเดือนก่อน

      Hopefully we get you sorted with your post on Discord!

  • @supergames6696
    @supergames6696 10 หลายเดือนก่อน

    Now how do I save a checkbox state for vsync, fullscreen and borderless modes?

    • @GameDevArtisan
      @GameDevArtisan  8 หลายเดือนก่อน

      You could add each checkbox into the settings page, attach the signals to your script, then on your save resource add the additional values as exports like the other settings.
      For VSYNC use DisplayServer.window_set_vsync_mode
      Fullscreen use get_tree().root.set_mode(Window.MODE_FULLSCREEN)
      For examples in more detail check out this godot demo:
      github.com/godotengine/godot-demo-projects/tree/master/3d/graphics_settings

  • @Gambit-YT
    @Gambit-YT 5 หลายเดือนก่อน

    I just spent about an hour wondering what I did wrong when making a similar resource and realized I wasnt saving my preferences.... 🤣🤣

    • @GameDevArtisan
      @GameDevArtisan  4 หลายเดือนก่อน +1

      Woops, we've all been there before!

  • @ominoblu6656
    @ominoblu6656 ปีที่แล้ว +2

    What is Game.INPUT_SCHEMES? You are not showing the script Game, so I don't know what is it and I have no way to know it. I read in your blog, same issue.

    • @GameDevArtisan
      @GameDevArtisan  ปีที่แล้ว

      The first few minutes within the previous video where we cover Gamepad input, we setup the ENUM within our Game script. Should around the 3 min mark.

    • @UocLv
      @UocLv 10 หลายเดือนก่อน

      @@GameDevArtisan How the fk you suppose to know you have to watch other video first? Put in title Part 4 or something.

    • @alexanderzaugg4484
      @alexanderzaugg4484 9 หลายเดือนก่อน +2

      @@UocLv This is the 12th video lol. Maybe take some context clues and deduce that this isn't a stand alone video? Then glance to the video side bar where the playlist of the whole series is. You don't need your hand to be held for every little thing

    • @UocLv
      @UocLv 9 หลายเดือนก่อน

      @@alexanderzaugg4484 Oh, you silly goose! Just imagine that there are other people around the world with different devices. They may or may not have different interfaces, which may or may not include a playlist in the sidebar. But even if we imagine that we are on the same platform, let's take a look. Oh no! If you opened a video from Google, it does not show the playlist in the sidebar. How comes? Maybe, just maybe, TH-cam provides a different interface for different situations to feed the algorithm. Good luck, mate.

    • @alexanderzaugg4484
      @alexanderzaugg4484 9 หลายเดือนก่อน +1

      @@UocLv Someone is in a condescending mood today. Alright sure, let's say you're on your phone and don't have the Playlist in your recommended videos as you scroll down. Are you really going to die on the hill that it is so confusing that you're incapable of figuring out that a tutorial is part of a larger series? The project being worked on in the video clearly has a lot of content not covered in this one video. From there, you can easily click on the channel and see that, aside from one other video, all the videos on the channel are part of this series.

  • @mahmoudsameh9470
    @mahmoudsameh9470 10 หลายเดือนก่อน

    how i can do it for resolution setting

    • @GameDevArtisan
      @GameDevArtisan  8 หลายเดือนก่อน

      Check out this official demo with examples for more graphics settings via GDScript. github.com/godotengine/godot-demo-projects/tree/master/3d/graphics_settings

  • @fading-sun-studios
    @fading-sun-studios 6 หลายเดือนก่อน

    Where is the file saved on the computer

    • @GameDevArtisan
      @GameDevArtisan  6 หลายเดือนก่อน +1

      It varies based on your OS, but the user's folder can be found using the "Project > Open User Data Folder" option on your top bar! If you need more help, feel free to jump into the discord server!