How to SAVE & LOAD Game Data Easily in Godot 4

How to SAVE & LOAD Game Data Easily in Godot 4

DevWorm

8 месяцев назад

20,739 Просмотров

Saving and Loading game data is very important, I wanted to to walk you through the best and easiest way to save game data in Godot 4, godot has a ton of amazing features and they make saving games extremely simple.

0:00 - example of saving and loading
1:18 - project setup before save and load
2:02 - saving the data
3:00 - loading the data
4:10 - finished product & tips


----------------------------------------------------------

Thank you so much for watching I really hope this video helped.

if you did enjoy or this video was helpful then all i ask is if you could please go and click that subscribe button to help out the channel. It means so much and I love your feedback in the comments. If you are having any issues with the code talked about in the video then please let me know in the comments and I will be for sure to get back to you soon. Again thanks so much and I would love to see you again!

have a great rest of you day and of course be safe :)

- thanks DevWorm,

----------------------------------------------------------

Тэги:

#godot #save_and_load #how_to_save_games_in_godot #save_and_load_system #easy_way_to_save_and_load_game_data #how_to_save_a_game_file_in_godot #save_and_loading_game_files_in_godot #how_to_save_my_players_stats_in_godot #save #load #godot_4 #how_to_godot #godot_tutorial #save_and_load_games_in_godot_4 #godot_engine #game_development
Ссылки и html тэги не поддерживаются


Комментарии:

AnimatorZee
AnimatorZee - 21.11.2023 00:13

Thank you so much for this! I started learning Godot a few days ago and this is a huge help.

Quick question; would it be possible to save and load two different types of data separately? Many survival games save characters and maps separately, for instance. It seems like it would be possible, but I'm not entirely sure and don't want to dig myself into a hole.

Ответить
Original Baum
Original Baum - 08.11.2023 18:30

very helpful! thx <3

Ответить
Space Monkey
Space Monkey - 07.11.2023 11:49

I feel like a spoiled kid for even asking this, but I would have loved to be able to copy/paste from your code directly to my project. It's probably not very important for this tutorial, but maybe consider it for future tutorials? Anyway great work! Thank you so much

Ответить
Gods Autobiography
Gods Autobiography - 05.11.2023 03:54

I think something has changed in Godot since your tutorial came out. I get an error that file.get_var() only takes in a boolean value.

Ответить
Russy
Russy - 02.11.2023 15:55

Great tutorial but quick question. When I add new variables to be saved on an old save file I get an error and I have to delete my data to fix the error. Is there a way to not have to delete my data every update I make to my game? I don’t want people having to delete their data just to play a new version. I am using global variables if that’s an issue

Ответить
prismajane
prismajane - 30.10.2023 01:29

Apparently this method doesn't work with variables that are strings.

Ответить
Gustav Kollmeyer
Gustav Kollmeyer - 13.10.2023 09:18

does this avoid the problem that using the Resources node/type had that allowed people to run arbitrary code?

Ответить
Kyuboyo
Kyuboyo - 10.10.2023 14:26

Does godot create a file in the directory when saving data? or it the file created internally which technically won't be human readable? (need to know for a project)

Ответить
MattDaNerd
MattDaNerd - 30.09.2023 03:52

Thank you so much for this tutorial, it is way more helpful then the other ones which just blast me with code, and expects me to understand. I really appreciate it.

Ответить
NofoolStreams
NofoolStreams - 17.09.2023 10:11

hey THANKS HEAPS, im currently playing around with the FileAcess stuff , I am able to check weather a save file exists and use store_var and get_var to save and load, however when I altar the script and add new variables to save and load it causes an error on load cause those variables dont exist. im trying to find a way to check if the variable im trying to fetch with get_var() currently has data to retreive is this possible does anyone know?

Ответить
Ability Learner
Ability Learner - 05.09.2023 05:10

Thank you

Ответить
Ramona Visconti
Ramona Visconti - 02.09.2023 00:05

I have this setup to save the highscore of the player, it works fine when I run the game inside Godot, but when I export the game, it crashes when it tries to save, do you have any idea why that might happen? Your videos have been very helpful, thanks!

Ответить
lkadath
lkadath - 01.09.2023 00:33

great, really simple to apply. Is it possible to implement it for a browser game?

Ответить
Pierre Nagonio
Pierre Nagonio - 28.08.2023 23:23

Thank You Friend! Have a nice coding :)

Ответить
Arcturus Akerfeels
Arcturus Akerfeels - 28.08.2023 19:45

thanks man this video comes right on time for my project !! how could I apply that for a player's position upon changing scenes tho ?

Ответить
DEV  GRAY
DEV GRAY - 28.08.2023 19:34

Thank you so much broo ,i appreciate your efforts,i was waiting for this. it's very helpful ❤❤❤

Ответить
Jeremiaha Emile
Jeremiaha Emile - 28.08.2023 19:09

Can you make tutorial about local multiplayer in one computer like game fireboy and watergirl

Ответить
Pedro Joclar
Pedro Joclar - 28.08.2023 17:42

Very nice tutorial. Concerning the save path, it must always start by "user://..." ? Does this path will be correct for all players if my game is in production ?

Ответить
Art Director Giraffe
Art Director Giraffe - 28.08.2023 16:24

Always excited to see your next video!

Ответить
DrWine
DrWine - 28.08.2023 16:01

Please make a tutorial/tips for World Environment

Ответить
Bk
Bk - 28.08.2023 16:00

THANK YOU

Ответить
DrWine
DrWine - 28.08.2023 15:58

Thanks man, For me who is making only arcade games, Its important to know something new.

Ответить
HeathTheCoder
HeathTheCoder - 28.08.2023 15:38

I will definitely use this in the furture!

Ответить
FilenameNULL
FilenameNULL - 28.08.2023 15:07

That's what I wanted for a long time. Thanks!

Ответить
Jeremiaha Emile
Jeremiaha Emile - 28.08.2023 15:04

Finally you uploaded it. Iwas waited it from along along time❤❤❤

Ответить
Ante
Ante - 28.08.2023 15:04

Thanks man!Great video, really helped!

Ответить
Jeremiaha Emile
Jeremiaha Emile - 28.08.2023 15:04

Finally

Ответить