Correct projectsetup, Interface/casting.

Hello out there!
I’m new to UE5, and just done a couple of gameprojects. In my latest gametest i have som “statbars”, like stamina, health, hunger, and i can pick up some objects lying on the ground, which will then refresh the bars and those regular survivalstuff all have seen everywere. My question is, before i get to long in the project, what is the “correct” way of setting up objects. I know it’s a big question to ask, but i havn’t seen any good examples on it. I’m trying to look on youtube, and other forums, but i just can’t find the right topic.

What i mean is like… If you are a character, when should it be a good way of using interfaces for other objects, and when should i use casting? And also, let’s say there will be 3 pickable objects, all do different things, and you could maybe eat one object, and the other 2 you can not eat, but perhaps use for firestarting. How would you do then with variables for those items? Should all 3 items have the same kind of variables, like a structure or how to bigger games look like? All i have found on the internet is that it’s hard to tell when you should use what. But there must be some kind of basic rules? Let’s say you have a character that can pick up different items, and those items give the caracter different “things”, just like in many games. How are bigger games build?
A very fuzzy question, i know. But it would be really nice to see how a big game works with variables, connections etc in a drawing or something. Then it would be easier to understand. Anyone have any basic rules they wanna share?

Thanks

hi,
i can not tell you one specific way, but for objects it depends on what they are doing.

but for example… you have your 3 objects you explained and all seem to be some sort of interactable. you could make a base class like interaction_object and set it to abstract. then let all objects inherit from it, so you have your base object with different variations and variables as you need, but all have the same base class. you could then wrap them all in a main base class like item. it would be easier to implement them in your inventory as all objects are main class item and then you could have different branches, like consumable, interaction, weapons,…

hope that helps you :slight_smile:

cheers :vulcan_salute: