How to Create SAVE & LOAD in Godot 4

preview_player
Показать описание
In this video I go over how to implement a saving and loading system step by step in Godot 4. Saving and loading Data in your game is so important and so I explain exactly how it works so you have an understanding of what is going on when adding the system to your own Godot games. We will create a small example world and learn to save the players stats in a resource script, and then learn to reload them when we want to load the data back. Follow along with me and learn all there is to know about saving and loading in Godot 4.

Chapters:
0:00 Intro
0:33 Existing Project Info
2:38 Download Save & Load Demo
3:00 Save & Load Tutorial (step by step)
18:54 How Save & Load Works
20:17 Outro

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 subscribe to help out the channel. It means so much and I love your feedback in the comments. I’ll look forward to getting back to you soon! Again thanks so much and I would love to see you again!

These Tutorials take a lot of time to create and I’m working on becoming a better Teacher and learning how to explain Godot things in a better way, if you’d like to support this journey to expand knowledge and help other game dev’s learn to create their own games then please.. Become a Member! It would mean the world and you’ll help me out so much! Thank you!

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

- thanks DevWorm
Рекомендации по теме
Комментарии
Автор

Hmmm I'll be saving this for later

tiagogarcia
Автор

I came across your older save and load tutorial through the algorithm, then decided to look at your channel and saw you uploaded this 4 days ago! I recommend adding a pinned comment to your older tutorial linking to this one! Great job, and thank you!

firewolf
Автор

Hi DevWorm! Just want to thank you so much, I have had troubles saving persistent data and just could not get it to work but I have solved it with your help! Keep well and keep up the good work.

UU
Автор

I don't use godot yet, but I love to watch your videos about game dev, keep it up! Cheers!

lucasmence
Автор

Cool guide for small games! But somewhat falls apart at scale.

You'd need to create a centralized save/load structure with an inheritance paradigm instead of this coupled strategy.

Also, saving directly as a .tres leaves the save file really vulnerable to security risks (injecting code, changing values). You can use Safe Resource Loader from the asset library to load a Resource more securely.

debunkler
Автор

Thank you for this amazing video!
Personally, I wanted to load my Resource using the _ready() function, so I changed the load_data() function to add the following if statement:

if ( ResourceLoader.exists( save_file_path + save_file_name ) ):
playerData = ResourceLoader.load( save_file_path + save_file_name ):

This ensures it won't try to load a file that doesn't exist on the very first time running the line of code, allowing you to call the load function before you make a save.

alli-gator-forest
Автор

this really helped me with understanding this, thanks

strike
Автор

Thank you for the tutorial, super helpful :) !

SollyVlogs
Автор

Why changing the resource in every frame? Couldn't it be changed when saving, like calling UpdatePos inside save() before ResourcerSaver?

leandroverse
Автор

Great video. I really like the idea of using resources to save however there are a lot of people who are saying that if a player downloads files for your game it can breach their security. Is there a work-around for this? I also want to implement multiple saving slots so maybe I should just use JSON... even though it's a lot less intuitive.

reesekelly
Автор

Hey Dev! Since I’m early I want to use my newfound comment powers to request an inventory system!! I feel like you could explain one in a simple and replicable way! Much love and thank you for the dope tutorials!

cheapgrams
Автор

Thanks for the videos brother, could you bring a video explaining how to enter/use some type of vehicle? whether horse, car, etc.

WunderChilld
Автор

This exactly what I wanted/needed/was looking for. What is this timing? thanks

MultiLeandrini
Автор

Can you make a tutorial on how to make a character selection screen that also include a character creator and being able to save our character in a slot/list? (this definitely not for my game i swear😁)

On a serious note, it could benefits a ton of gamedev as it's very common in RPG to have a character creator+selection screen.

ROSACEPONY
Автор

Thank you so much for this tutorial, it was very simple and easy to understand. I have a question - if I want to add some additional parameters to the save file, such as on a RPG with a map with changes in scenes, I would just theoretically save the scene path that the player is in and load that scene path?

I want to make it an open exploring game and keep track of where the player is on the map, quest status, item spawn status, etc. and feels like it could get pretty confusing pretty fast. Thank you!

xmacherie
Автор

Hey!! Would you make a tutorial on how to make a good menu and UI?? It'll be really helpful!!

adrianvazquez
Автор

this is a great video thanks for making it. i was wondering are you gonna continue with the survival game series?

HippocritterXD
Автор

I'm making a 2d game using your all tutorials but I'm stuck with save and auto load when i exit and enter the game and i can't understand how the save and autoload works !
Can you make a simple auto save and load video for simple game please

uiet
Автор

What if instead of pressing a button to save we want to save the progress we’ve made in one scene before changing to the next one?

Like say you collected coins from scene 1, then you go to scene 2 to collect more before going back to scene 1, only to see the coins you had collected are back at their place again.

i_draw_whatever
Автор

In future video can you make this video for clear explanation for beginners like me

uiet