Unreal Engine 4 Tutorial - Saving Level States

  Рет қаралды 27,112

Ryan Laley

Ryan Laley

Күн бұрын

In video voted for by my Patrons and KZbin Members we go through the process of saving the state of a level and player data between level changes. This is intended to show you the thinking behind how to accomplish this, along with a working example.
Support me on Patreon and get access to videos early, join our developer community on Discord, get exclusive behind the scenes videos on my projects and much more over at / ryanlaley .
Subscribe now to catch each video as they are released each week.
Follow me on Twitter: / ryanlaley
Like my page on Facebook: / ryanlaleygames

Пікірлер: 62
@RobertVari
@RobertVari 2 жыл бұрын
For those having problem with actors (pickups and like) not being destroyed after reloading a level/game here is the problem/and solution. The Problem: You store a hard reference in CollectedPickups to a particular actor which had ben destroyed (you picked it up/killed it). Next time you save the level these references will be overridden by a null. Solution: Store a soft reference in CollectedPickups and resolve them in the for each loop. This way there won't be a direct link to a destroyed actor in the level when you save next time.
@AeonSaturnal
@AeonSaturnal 2 жыл бұрын
Awesome. Thanks so much.
@ryutenchi
@ryutenchi Жыл бұрын
Does this remove the need to add Unique IDs and find the actors based on that... that is to say, will this keep the reference even after closing the editor and re-opening it?
@RobertVari
@RobertVari Жыл бұрын
​@@ryutenchi I use this method for saving level states in my game. Works perfectly even when you restart your editor.
@DankSoss
@DankSoss Жыл бұрын
soft reference? like a name? I've been trying all day and still struggling Lol
@MichaelofthehouseFalcone
@MichaelofthehouseFalcone Жыл бұрын
indeed, what do you mean by soft reference? still learning haha
@benfala9984
@benfala9984 3 жыл бұрын
this is super cool. its like those games you switch between spirit world and normal world!
@Alaet_
@Alaet_ 3 жыл бұрын
Great tutorials as always, thanks Masta Laley for this quite clear and quick explanation of saving level states. Will be of use
@xTwistedmarionettex
@xTwistedmarionettex Жыл бұрын
Can you make a tutorial on how to save locations of classes of actors?
@valkyra5167
@valkyra5167 2 жыл бұрын
Hi, I tested it a lot, after a while the reference are changing and are not valid anymore. Maybe it would be better to create an own ID, so make a base class and add an ID and get all actors of you base class and destroy all items with the same ID.
@EmarStudios
@EmarStudios 3 ай бұрын
if i already had a SaveGameObject type thing and the initial checking and loading of save game data was being done through the game instance ... couldnt i put all this gamemode stuff through the gameinstance and use the original SaveGameObject instead of making a LevelDataObject?
@davidtaylor8195
@davidtaylor8195 Жыл бұрын
you did this very differently in your other save game tutorial. Is this a better way in most cases?
@radleypillay7096
@radleypillay7096 2 жыл бұрын
Thanks for all your vids Ryan, really learning a lot from you. I was having an issue with my save game where at times it would not destroy the objects that I save in it. My method was very similar to yours. I tried your method exactly and I'm finding the same issue. If you collect a few pickups, switch levels a few times, run around etc. and switch back eventually the objects don't get destroyed anymore and the 'Is Not Valid' pin is fired from the 'Load Collected Pickups' in the LevelDataObject. Any ideas on how to fix this so that it always without a doubt destroys the objects in the list?
@ЕвгенийЧумашов
@ЕвгенийЧумашов 2 жыл бұрын
If someone is looking for an answer. The problem is because after destroy. After 1 minute, the link ceases to exist and when you re-save, you save an empty array.
@ЕвгенийЧумашов
@ЕвгенийЧумашов 2 жыл бұрын
In my case. I made the storage outside the level and did not use destroy, I move all the objects there so as not to destroy the links.
@Toxort
@Toxort 2 жыл бұрын
@@ЕвгенийЧумашов Thank you for leaving this comment, this helped me a lot
@nightdragon4611
@nightdragon4611 3 жыл бұрын
Hey Ryan, I really enjoy your work, I am wondering how this would work when using multiple save files? I am currently running into this problem in my game, I have 3 save slots, but the level state is saved to the map name so if I have Save1 Data the level state saves as map1, then a different player starts a new game and saves to Save2 Data and the level state saves again as map1, so now player 1 and 2 are both using the same level state and it obviously doesn't work out well. What would you recommend for this?
@christophermcninch1386
@christophermcninch1386 2 жыл бұрын
Did you ever get a fix for this? I would think the easiest fix would be using an append node in blueprints attaching the level name to the slot name.
@RiffSharkMusic
@RiffSharkMusic 2 жыл бұрын
just save all your data in one slot (like all games do), eg playerdata struct and levels dictionary in save1, then just read corresponding data, no need for separate save objects per level like in the video
@MaxStudioCG2023
@MaxStudioCG2023 Жыл бұрын
you lost me at level1 and level 2 ....i only have 1 level and i want save game where my character will be on that map ...i hate when people on tutorials skip steps ....and as starters lost watching hafe video and then stop because video incomplette (as for example the points part how you created the Hud and the update points and all that stuff
@alexrusu2905
@alexrusu2905 3 жыл бұрын
saving cofuses me
@michaelcasseus2497
@michaelcasseus2497 10 ай бұрын
hey great episode did you travel to a duplicate level while saving the world location of the character instead of starting at the player start of the next level in this one ????
@Kno_696
@Kno_696 Күн бұрын
How can I make this work with a Save/Load system? I want the player to be able to load the level after closing the game. Will this work?
@asumjessen2013
@asumjessen2013 Жыл бұрын
How do you combine this with multiple save slots? Having trouble tying the level saves with a profile.
@jol0973
@jol0973 3 жыл бұрын
How can I store the player location in a level, but then still use the door (open level) player starts?
@ФедорСимонов-я4т
@ФедорСимонов-я4т Жыл бұрын
Thank you!!!
@charsonist9841
@charsonist9841 2 жыл бұрын
Would you have any idea where to find the saved data in the directory when it's not in the saved folder? The code works, I just can't get any of my items to respawn lol
@kevinl5219
@kevinl5219 3 жыл бұрын
Thanks !
@beastmodejelly8654
@beastmodejelly8654 3 жыл бұрын
I want to go to college for game development,, every time that I think about it and check the website of the college that I want to go to I feel like light in my chest,like a peaceful calm... I must search for the light
@Potato_Hole
@Potato_Hole 3 жыл бұрын
You're honestly better off following game development series on KZbin. You can learn the same information following KZbin series if not more so than going to a college and putting yourself in debt. If your parents are going to pay for your college, then I suppose you can take advantage of that. If you were planning on paying for it, I'd suggest putting that money into something more worthwhile and continue watching these types of videos. Many people in the game industry didn't actually go to college, you know. A lot of them didn't have KZbin back then when they were first starting out either. KZbin is basically college.
@diliupg
@diliupg 2 жыл бұрын
There's a light at the end of the tunnel. Go for that..
@artdrawing6682
@artdrawing6682 Жыл бұрын
haw to save wopen collec and other thing the gun is not destroyed
@stealthgamesaremyjam145
@stealthgamesaremyjam145 Жыл бұрын
If your project has one of the maps you want to transition from as a "Editor Startup Map" and/or "Game Default Map" in the project settings, It doesn't save the data of that map. at least it isn't for me.
@stealthgamesaremyjam145
@stealthgamesaremyjam145 Жыл бұрын
I changed my start up map, but it does seem to save the start up map as well, something about one of my maps just doesn't work with the save functions, but my other maps do work.
@stealthgamesaremyjam145
@stealthgamesaremyjam145 Жыл бұрын
I found out why It wasn't saving the data in one of my levels, it was because I had an Override game mode set in the Settings, world settings, to a different one on that particular level.
@nowherebrain
@nowherebrain 2 жыл бұрын
I really wish they would put the scripting back in...you added like 12 nodes in what you can do in two lines of scripting...not your fault..I'm just saying...it's the only thing that keeps me away from UE...the OLNY thing. I would love to use it.
@SandyM1993
@SandyM1993 Жыл бұрын
If he just did the whole thing the right way from the start we wouldn't be watching a 26 minute long video. Why did he keep changing the blueprint and correcting mistakes he purposely made. That isn't a teaching. Get to the point, it's a video, we can pause and playback.
@GaryParkin
@GaryParkin 2 жыл бұрын
Thanks Ryan. This was just what I needed.
@alexrusu2905
@alexrusu2905 3 жыл бұрын
what did you do in that Update Hud function? I can't figure it out.
@tjrizvi251
@tjrizvi251 3 жыл бұрын
Im assuming you'd make the widget, then get a reference to the count on the player blueprint and bind that to a number on the widget
@1AnimeFinder
@1AnimeFinder 3 жыл бұрын
Can you make one 4 world composition ?
@notfabiantapia8942
@notfabiantapia8942 3 жыл бұрын
I'm making a simple game, and im struggling a lot
@AleksanderFimreite
@AleksanderFimreite 3 жыл бұрын
Story of my life ^^
@bluethumbbuttoneek9465
@bluethumbbuttoneek9465 2 жыл бұрын
11 months have pass ed hopefully ur not struggling much now
@rathore3991
@rathore3991 2 жыл бұрын
@@bluethumbbuttoneek9465 1 year
@victorhuchet1677
@victorhuchet1677 Жыл бұрын
@@rathore3991 2 years
@MuftaDjenter
@MuftaDjenter 3 жыл бұрын
If in a random moment of time, you have your array cleared - replace all the actor references to the soft references :)
@D.A.R.K_S.T.A.L.K.E.R
@D.A.R.K_S.T.A.L.K.E.R 2 жыл бұрын
What is soft references?
@yuancui4305
@yuancui4305 Жыл бұрын
@@D.A.R.K_S.T.A.L.K.E.R Have the same question
@mam9zyc
@mam9zyc Ай бұрын
what do you mean bro? i know it's old af but your reply would mean world👊🏻
@MuftaDjenter
@MuftaDjenter Ай бұрын
@@mam9zyc when you choose a type of your variable (f.e. let it be Actor), you can choose whether it's an 1) Object Reference 2) Class Reference 3) Soft Object Reference 4) Soft Class Reference So what i meant by that is you need to change your Object Reference to Soft Object Reference, or if it's a Class Reference you need to change it to a Soft Class Reference
@COACH_KARSTEN_OPPINIONS-xs3xn
@COACH_KARSTEN_OPPINIONS-xs3xn 2 ай бұрын
You lost me at 4:27. Where does that branch magically come from?
@mam9zyc
@mam9zyc Ай бұрын
this is basic knowledge mate, however he didn't actually SAY it in the video- he clicked left mouse button while holding B key for Branch node :)
@Abdou3131
@Abdou3131 22 күн бұрын
Learn the shortcuts
@juliakp8366
@juliakp8366 3 жыл бұрын
would it be possible to send the Level State to another Program using OSC?
@MrMurp35
@MrMurp35 Жыл бұрын
Incredible video. Thank you very much.
@Spadez.
@Spadez. 3 жыл бұрын
Fantastic! That was great🍾
@LeszczynskiDavid
@LeszczynskiDavid 3 жыл бұрын
I really cant hear lol
Unreal Engine 4 Tutorial - Saving & Loading Pt.1 Basics
26:46
Ryan Laley
Рет қаралды 70 М.
Save And Load If An Actor Is Destroyed - Unreal Engine 4 Tutorial
23:24
Inside Out 2: BABY JOY VS SHIN SONIC 3
00:19
AnythingAlexia
Рет қаралды 9 МЛН
OYUNCAK MİKROFON İLE TRAFİK LAMBASINI DEĞİŞTİRDİ 😱
00:17
Melih Taşçı
Рет қаралды 12 МЛН
А ВЫ ЛЮБИТЕ ШКОЛУ?? #shorts
00:20
Паша Осадчий
Рет қаралды 9 МЛН
💩Поу и Поулина ☠️МОЧАТ 😖Хмурых Тварей?!
00:34
Ной Анимация
Рет қаралды 1,9 МЛН
Unreal Engine: Understanding Maps, Levels, and Sublevels using the Levels Tab.
26:27
Unreal Engine Save Game Tutorial
11:37
Seredias
Рет қаралды 14 М.
Save/Load Player Stats - Unreal Engine 4 Tutorial
10:10
CodeViper
Рет қаралды 25 М.
Save and Load Tutorial - Unreal Engine 5.1+
20:32
Lisowi
Рет қаралды 7 М.
UE4 - Save and load BP Actors!
22:13
TST Productions
Рет қаралды 7 М.
An Easy Guide to Save and Load Your Character in UE4
24:29
Joe Von D
Рет қаралды 8 М.
Save And Load Player Stats - Unreal Engine Tutorial
12:46
Matt Aspland
Рет қаралды 40 М.
Unreal Engine 4 Tutorial - Level Streaming
13:12
Ryan Laley
Рет қаралды 62 М.
Saving and Loading | Live Training | Unreal Engine
1:01:05
Unreal Engine
Рет қаралды 36 М.
Inside Out 2: BABY JOY VS SHIN SONIC 3
00:19
AnythingAlexia
Рет қаралды 9 МЛН