So right now Im making my first UE5 game as a hobby in my spare times, and I need some advice
But uh, im like 10% done at a good estimate and my code starts to look very…messy?
Ofc, if I was using a script heavy game engine it would be insanely messy, UE5 is really neat compared to that but still it feels like I am doing a lot of things wrong.
Wanted to ask if everyones code look similar or if there is a better way to do these below:
I setup global variables on an actor I spawned in a world. Like:
Gold, hp, collected items, information about which actors are destroyed, if an event triggered already or not for other actors to know, statuses and difficulty settings.
I setup save game BP, where I copied half the things in global variables to be saved in.
I have 2 different buttons to save and load the game, they are starting to look very packed, like this:
Saving looks something like this:
Loading looks something like this:
I am just starting to code my game, and I can imagine when its done just saving and loading will have at least 5 to 10 times more variables I will need to save and load.
Not even counting the global variables I will have at the end, will probably be easly over 100 of them.
I can imagine I will miss adding stuff or add it wrong eventually and will be really hard to figure out what went wrong in the future. Does anyone have any advice how I can make global varibels/save/load system better so its less likely to bug out later in a project?
How similar is this situation when others code save/load/global variables systems?