How To Create An Organised Save System In UE5.1 with structs - UMG/Casting/Dispatchers/Game Instance
Вставка
- Опубліковано 19 чер 2023
- Updated Discord invitation: / discord #UnrealEngine #blueprints #unrealengine5
► Join the Discord: / discord
► Description
I wanted to create a video doing a deep dive into how you can organize your player variables to easily create a save system using UE5.1, I go over, Structs, Event dispatchers, casting, UMG, and the game instance. There is quite a lot to go through so grab yourself a coffee.
-----------------------------------------------------------------------------------------------------------
► Patreon: / gamedevxr
► Twitter: / gamedevxr
► Instagram: / gamedevxr
-----------------------------------------------------------------------------------------------------------
If you're new to VR and want to get started with Oculus Quest development, I recommend watching these videos first.
1. Installing UE4 from Source code (contains more up to date Quest features)
• Installing UE4 4.25 fr...
2. Installing Android Studio (Required to create Oculus Quest projects in UE4.25+)
• Installing Android Stu...
3. My Oculus Quest 1 Settings (These are different to the Quest 2)
• My Oculus Quest 4.25 B...
4. My Oculus Quest 2 Settings
• Quest 2 Settings You S...
-----------------------------------------------------------------------------------------------------------
PC SPECS:
► RTX 2070 Super
► I9-9900K
► 32GB Ram
► 2TB SSD
Equipment
► Keyboard: HyperX Alloy Origins
► Mouse: Anker® Ergonomic Optical USB Wired Vertical Mouse
► Mic: Trust GXT 232
► WebCam: Jelly Comb
► Screen: AOC I2367fh 23-inch LED x 2
► Headset 1: Oculus Quest 128GB
► Headset 2: Oculus Rift + Motion Controllers
► Headset 2: Oculus Quest 2
► Graphics Tablet: Wacom Cintiq 13hd - Ігри
So I love the content, and this is great to be showing. I think a UGameInstanceSubsystem may serve better than the full GI for data, but that's not a big deal.
Save and Load is an eclectic subject in Unreal and it's awesome that you're making great videos about this!
The general language around "Cast to..." in most UE tutorials is misleading, and I saw it here as well. So I'd like to try to clarify this
The "Get Game Instance" node is doing all the heavy lifting of getting the reference to your Game Instance. It's doing the "communication" most people are looking for when they think about the "cast to" node.
That "Get Game Instance" function basically calls "Get Outer" recursively till it finds the game object that owns everything, then accesses it's saved reference to the game instance and returns that pointer to that output pin you drag off of to put into the "Object" input of the Cast To... node.
The "Cast to" node itself just checks what type of thing a reference is, "is this thing of this type". No communication is done by that node, it's just a check.
The origin of the word Cast is like "metal cast into a mold", not cast as in broadcast. "Does this Object fit this mold, aka was it "cast" in this mold when it was made"
So saying "Cast to your game instance" can sound like the cast node is doing the communication part, when it most certainly is not.
Put 10 copies of your "BP_Character" into a level, use get all actors of class to get an array of all of them, and then you can plug any single one of the results in that array into a "Cast To BP_Character" will succeed. This is because they are all "cast" from the BP_Character blueprint
I know that might be a lot of wording, and I again hope that the overall quality of the content is not in any doubt. This particular subject is just a very murky one for many, and I even have Jr. devs applying to the studio I work at that don't understand how cast works in Unreal. (In C++ or otherwise it's more of a conversion/interpretation, rather than a check)
Thanks again for taking the time to make this content!
Thanks for taking the time to clarify this!
I watched a video where a guy said it took him 2 years of unreal to understand this and interfaces lol
This is the only channel with saving and loading I've found that wasn't the copy pasted basic save/load function that every other channel has done. Thank you for going over all this information, what you were doing, and most importantly, why you were doing it.
Your very welcome. Im glad i could help.
congrats for the class! Helped me a lot!
Fantastic explanation, very easy to follow and the repeated breakdown as you go really keeps underpinning my understanding. I'd love to see a similar video from you talking about multiplayer and what to code where. e.g. game state, player state, game instance... replication can be an unnecessarily complex issue but coding everything in the right place from the beginning can be a real levelling up moment for many devs!
You are an excellent teacher!
Thanks for sharing
Awesome video! This channel is so helpful. You are able to teach and explain concepts and processes in such an easy and digestible way. Great work!
Great tutorial, It defintely has helped me understand structures a little better. Looking forward to seeing more content from you in the future.
Its amazing!!!! Its working great, thanks dude!!!
this was exactly the kinda intermediate tutorial for saving and loading i needed to progress a project so appreciate the video!
i honestly kinda hate this isnt the first thing people that do long 30+ long video playlist tutorials dont start with cause itd make iteration for people that understand the basics already to do more then pause alot trying to do exactly as the video does so everything works. As i am doing now so i know how this is all working in a clean project.
So I am curious cause it seems when closing the game it wont reload player info, how would that be fixed?
if your using the game instance there is a node called event init which stands for Initilize. you could use that so as soon as the game starts you load the save data and populate it out.
@@GDXR I was trying to get it to work but was at the end of a long session so I must have been forgetting to call a function
Hey man, nice vid as always!
Just a curiousity: can't you just save the whole character with all it's variables as a variable directly in the save game? Same for all the other actors?
Awesome tutorial! I appreciate you not going at lightning speed like in most other tutorials so i didn't have to play it half speed lol!
With that said, I'm not quite sure where i went wrong with this, but i just can't seem to save anything. I don't think my third-person setup has anything to do with it, so maybe my version? I'm on 5.3 and i:m getting no errors. A save file is generated as it should, but no data is updated upon restarting my game. I do have a hefty number of variables in my struct though, about 60, but it really shouldn't be a factor as so far I've only been testing with the name variable. Any advice?
Actually my initial assessment was incorrect.. data is saved but I'm having trouble loading it. It appears to be a similar issue to marie-pierneault1035, as it seems that i have to click twice on load to get the data to show.
so first of all this is awesome, been setting up a player lives system using it and it works well in game HOWEVER when I EXIT the game ( either PIE or Packaged) and open it back up again everything reverts to defaults... how do you save the actual game instance to save the variables in the structure? been going in circles!!!
Still driving me crazy been trying loads of methods to no avail
will it work on packaged project?
I'm new to UE5 so I'm not sure I followed when you mentioned you should use a border as opposed to a canvas panel. What are the differences and how would it be better?
canvas pannel updates with the dveices frame rate making it extremely expensive to calculate. So using a boarder allows it to update only when changes are made. Being more cost effective.
My dispatcher seems to work as my print name is updating but somehow I have to press the load button twice in order to make it work....any idea what could cause that?
Dispatchers need to be initialised. So your first press is activating it and the second press is actually listening for it. Fire it from begin play or another line of code which runs before hand and it should be ok.
First! Also, you can't read any of the text because the screen resolution is too low(360p).
First! You need to wait for UA-cam to sort out the 4k version. Just give it a minute.
First! you need to upgrade your internet lol before ever talking about a video resolution.
@@snowsteward8340my internet is 4k smooth, the video wasn't processed so the only resolution there was for video.