Thanks for showing examples of their use at the end. The Event tracking was an interesting use case I hadn't thought of. Very nice.
@thegamedevcave Жыл бұрын
Glad it was helpful! I'm not sure if I mentioned this in the video itself, but it's worth noting that data assets seemingly can't be directly stored in savegame objects (probably since they are considered assets) . so if you want to save data like that you'll have to make a struct or something with the same data that's in your data assets and make an array of those in your save object.
@Sk4Le3 Жыл бұрын
Useful video! That's 100% information that I need. Information about the existence and use cases of some features of UE. Sometimes I feel a lack of knowledge about the existence of some things and how to use them properly. Then I need a tutorial because I have no idea how to do something because I don't know about the existence and use of existing instruments. But with this type of content, I can avoid tutorial hell and solve my problems without tutorials. Perfect!
@thegamedevcave Жыл бұрын
Glad it was helpful!
@YourJudgement-ms7kv2 ай бұрын
You don't know what you don't know!
@TheMenOfMma Жыл бұрын
When i right click on content browser my input tab doesnt show please help, i cant move forward without it
@WeirdGoat Жыл бұрын
Great video! Can I use a data asset to store my character data, like level, HP, MP, gold etc. I don't need to put my character data into Save & Load process, because that it changes the actual value in the character data asset?
@thegamedevcave Жыл бұрын
no, you can't replace saving and loading savegames with this. the data you write to a data asset doesn't stick around between play sessions. you can do this to have the data persist between levels though, but it's not a great way of doing that either.
@WeirdGoat Жыл бұрын
@@thegamedevcave Thanks for the replay. I just store the data in GameInstance as always. I feel like that Data Asset is a little bit like Scriptable Object in Unity
@thegamedevcave Жыл бұрын
@@WeirdGoat Data assets pretty much are unreal's version of scriptable objects indeed!
@LOL1423derp9210 ай бұрын
I have a question. I am trying to get a SINGLE data asset, how would I go about doing that? It seems like the only way you can get a specific data asset is by using the get assets by path or by class, and then doing a for each loop, to see if its the specific asset you need. For example, I would like to add a specific weapon item, but to get the data asset, I would have to loop through all assets to find it. Is this a good method? I feel like using a data table will be more efficient as it can find a row by name? Whereas using assets, you loop through all of them and compare names till you find it.
@LOL1423derp9210 ай бұрын
Do you think having a data table of soft object references of data assets is a better approach to this problem? I could use the name row as an ID, and then when I find the particular asset I need, I can then get that row, the soft object reference, and load it into memory.
@thegamedevcave10 ай бұрын
if you simply make a variable of the type of your data asset you should be able to give that a value, it's dropdown menu will only give you the options to choose from all of that type of data asset and nothing else. if you need to do this on runtime instead of just assigning a value in your blueprint a data table might be the easiest way to go yeah. Another method would be to put them all in an array somewhere and make a function to get them from the array based on an object reference input like I do in this video : kzbin.info/www/bejne/g5LWdJyDbL2Vl5Y it's a pretty roundabout way of getting the data asset but it is probably still easier to work with that using the asset by path and certainly more performant then getting them by class. I'd probably go with your data table idea though.
@thegamedevcave10 ай бұрын
yup data table with soft reference is what i'd go with probably! (if you do use the method from the other video I linked, also do use soft references instead of the hard references from that video of course)
@alexrybin37987 ай бұрын
this is so awesome! Thank you for sharing. Do you think this will be best way to set Player status in the game like Driving/NotDriving? And i guess i can use this for changing interface Driving vs Walking as well?
@thegamedevcave7 ай бұрын
Hm probably not, you are better off just making that a variable on your player and setting/getting it with a blueprint interface
@juggernautx177911 ай бұрын
Thanks for sharing! I have a question. 3 weapons and 2 types of ammo How would I approach that with Data Assets? I'm currently holding the Ammo and AmmoType in the Game Instance since I want it persistent throughout the whole game. Is it a good idea to make a DA for AmmoType containing the Type and the Value? Or keeping it in the GameInstance is fine?
@thegamedevcave11 ай бұрын
i dont think that you really need data assets with this for the most part. Possibly if you plan to have multiple kinds of ammo, it could make sense to make a data asset for all your ammo types but for the most part what I would recommend is just making blueprint classes for each weapon that share a general weapon class as parent. same with the ammo. keeping track of which weapon and ammo is currently in use you can do in the game instance if you want.
@juggernautx177911 ай бұрын
@@thegamedevcave I have a base weapon class that holds all weapons info, but I held the ammo and ammotype in the game instance since whenever I am switching weapons, the ammo zeros out.
@anaboliczyakrobata1909 Жыл бұрын
I have a question! Is this possible to put the table of attributes in the gameplay? Maybe as widgets? My idea is to bulid the level of database of mesh models, and thanks to table of content manipulate it.. For example hide all models from one type or show only models show only those models that meet certain characteristics
@thegamedevcave Жыл бұрын
that sounds like a big project. it surely is possible, although, if the end user doesn't need to be able to add anything to that table, and it's only a database of all the items in the game with their respective info, using a datatable would be much better for that. Downside to dataTables though is that they're only for reading data, you can't programmatically add new data into them on runtime.
@anaboliczyakrobata1909 Жыл бұрын
Thank you for that quick answer! I had a idea for a project conected to my studies.. Would you be interested in me describing it to you in an email? I have a few questions about it
@decoyminoy Жыл бұрын
Incredibly useful tutorial! I'm switching over from Unity and was looking to see if UE had something similar to ScriptableObjects. I have a question though.. At what point would it be too much logic to run in a Data Asset and i should instead be creating a blueprint (like parkour actions that directly effect player state?)
@thegamedevcave Жыл бұрын
When its an object in the world that needs to interact witg the world, it should be an actor. Logic on a data asset should usualy be limited to manipulating the info on the asset itself, the moment you need to start casting, you probably are better off putting that code somewhere else. As a general guideline anyway
@abcezigi6655 Жыл бұрын
you did not explain how and where to load these primary data assets. you have to load them manually using asset manager.
@thegamedevcave Жыл бұрын
I believe it's not required to do that. For my event flag system made in blueprint I never explicitly load them in anywhere, and that works perfectly fine. That said, for my combat system I load them in ASynch on the fly and that has resulted in some issues so it still is best practice to look into this probably yeah.
@thegamedevcave Жыл бұрын
@@ionalpha every so often when i try to load them in and use them right after, some parts of the asset seem like they're not yet loaded in. which makes sense, it's being done Asynch, so just assuming the loading is done like 3 lines of code down isn't a great thing to do... that's my bad... but that does end up with some thigns like a particle ssytem or a sound effect ends up refering to a nullptr and crashing the game. from testing it tends to only happen once every so often, seemingly more on lower end hardware (CPU). So making sure everything is loaded in before you start to sue thigns is very important. but that was all through c++, i am still pretty sure blueprint just kind of deals with that. but i'm not 100% confident there
@thegamedevcave Жыл бұрын
@@ionalpha make sure you test it in a packaged game too. I didn’t run into it until other people had this issue because I do all my testing in the editor where the data assets seemingly are already loaded in
@bighit201007 ай бұрын
Why not just create an actor BP and say it like BP_Sword and have all the variables in there? What is the true benefit of Data Assets vs Actors for items?
@thegamedevcave7 ай бұрын
The main thing to remember is that data assets are just that, assets. they exist as files on disk, not objects inside a level. a data asset has more in common with a 3D mesh or a material than it does an actor. So yeah, for a swrod, espcially if you dont have a whole item system in yoru game, making it an actor makes more sense. But take or instance making an inventory system (something which I recently did a whole series on) The items in your inventory doesn't exist in the world, so you can't use actors to keep all that information, instead every item is a data asset with it's corropsonding values (what mesh it displays when it IS spawned into the world as an actor, what image it displays in the inventory, what value it has in a shop and so on)
@bighit201007 ай бұрын
@@thegamedevcave Hmmm but how is a data asset any different from a struct for inventory purposes? Currently I am building my own inventory system for my prototype game, and I just use a struct for items, and then include that struct in the inventory array and also as a variable in the Item actor. So when I spawn an item in the world, and pick it up, my functionality will take the details from the actor, store it in the inventory array in the item struct, then destroy the actor. If I want to drop the item I can just spawn the actor I want from the details in the inventory struct. I have searched a lot on different forums, but no-one can conclusively explain why Data Asset is preferred over Struct. Besides the obvious "in DA you can perform functions", is there any other benefit??
@thegamedevcave7 ай бұрын
structs are still variables that you write onto another object that exists in memory, data assets (for all intents and purposes) are objects by themselves that exist on disk. if you have minecraft as exmaple : wooden sword has a certain durability, a certain attack damage , attack speed and all that. you would store those things in a data asset so that you can just easily reference that instead of having to indevidually worry about setting all those values anytime something happens to be a wooden sword. then stone sword has different values, iron/diamond and so on all have their own values. Now, do you really want to have to write all those seperate values to a struct every time you make or move an item? probably not, it's prone to making mistakes, and you're needlessly throwing oppertaions to read and write values on the cpu (i will admit, that's probably not going to be an actual problem but still, when it's not needed, you probably should avoid it). with a data asset, the data for that one item exists as a file on disk, so instead of copying over all those values every time, you just refernce that one asset that holds that data, all your wooden swords will look at the wooden sword data asset when they need to know something about their info. stone swords look at the stone sword asset, iron swords and that asset. This also means that if you want to change something about a value on one type of item, you simply change it in your data asset instead of having to dive into your code and find where you set all that stuff in the first place. if nothign else, it will help keep things organized once a game grows past only a handful of items, because going through and finding that in code will be an increasingly massive headache comapred to just a data asset (or even a data table, depending on the needs of the game)
@bighit201007 ай бұрын
@@thegamedevcave I see... thank you for the explanation. The downside of data assets is that you cant use it for data that changes. For example, a sword that loses durability, cant be changed in the data asset, else everyone with that sword will also have the changed durability. So if I understand it right, a data asset is best used for the common values of an object. So in this case, a sword, with its MAX durability, Base Damage, Weight etc, but all other values like current durability, quantity, upgrades etc are better stored in an array using struts?
@thegamedevcave7 ай бұрын
@@bighit20100 yup that’s pretty much correct!
@ethanwasme4307 Жыл бұрын
3:44 damn had a whole skill component in my mind xD
@AmorVim Жыл бұрын
interesting, this is a more streamlined version of using objects instead of structs
@thegamedevcave Жыл бұрын
pretty much, that's a good way to see it!
@F0r3v3rT0m0rr0w9 ай бұрын
So i have an issue, i am useing data assets for my skill system. but my data assets keep resetting to default every time i close unreal and open it again.
@thegamedevcave9 ай бұрын
Data assets will do that, they are not save data. They will retain changes made on runtime during a session, but restarting the engine (or packaged game) sets them back to defaults
@YourJudgement-ms7kv2 ай бұрын
@@thegamedevcave Can we set a save function in the data assets so they don't default again? Also thanks for the video! Very Helpful!
@thegamedevcave2 ай бұрын
@@YourJudgement-ms7kv no, data assets aren’t save files, they will recent back to default when the game is closed and reopened. You can of course put the data in a savegame and update all your assets when you load said savefile:)
@PaulV3D8 ай бұрын
Day-ta Ass-At!
@thecrusader16739 ай бұрын
Assat...
@Athurito9 күн бұрын
Just use gameplaytags instead of an array of dataassets xD
@thegamedevcave9 күн бұрын
they both serve way different purposes. a gameplay tag is just a fancy bool. a data asset is an asset with any information and ability to add functions to it as well. They really dont have much in common honestly. for the event flag system there are certainly other ways to do it (gameplay tags are not a way i would use for this still). and in my project i have mutliple different kinds of ways to keep track of thigns having happened. I dont make a data asset for each minor item pickup that needs to be remembered. those are stored in a list of names instead for example. This data asset based approach i only use for major milestones that I need to keep track of between levels easily (key picked up in level X means door opens up in level Y), Keeping track on if a certain boss has been defeated which causes changes in levels far removed from it and so on.