So I’ve looked at a few other posts regarding where to store some stats, but after looking at all the answers I don’t know I know enough to store my variables. This is probably because most answers are fairly general-purpose and I am not sure how to translate it to an RPG type of game.
I am working on an action RPG and want to store different variables like CurrentHealth, MaxHealth, BaseFireDamage, FireDamageModifier, FireResist, TotalXP, PlayerIsDead, EnemyCanSpawn, PlayerName
I have many, many more variables similar to these but i’m wondering where each of the above would go. Player State? Player Character? Game State? Game Instance?
This would be multiplayer, so I want to be able to keep most of these things safe (relatively) from player interference/cheating. What types of variables would you replicate/where would you replicate them? What types of these variables would be made Public?
Also, my players/enemies/NPC characters all share some basic attributes (such as CurrentHealth, MaxHealth, FireResist, CanSpawn, etc). I understand that blueprints can be parented so that I don't have to re-create 50+ variables for every single enemy/NPC in the game. Is it practical to have all my characters share a same parent that contains some common shared variables, or is this going to come back and bite me later on?
And lastly, I am planning of having save-games. I know of the existence of some save slot functions in UE4 but never really got anything working. Thats a whole topic for another post, but the variables that I keep in other places, like PlayerState, do these ALSO need to be stored in a SaveGame (or only in a SaveGame?)
Are things like PlayerState, SaveGame, GameInstance, and GameState things that need to have a blueprint created in my Content, or need to have a Pawn placed in a (or every) level? Or are these transient things that should be created by a blueprint without any sort of persistence (like a blueprint creates a SaveGame, then sets some variables)
Overall I am a bit confused where my variables and blueprint-logic are supposed to go, specifically where to store combat rules (how damage is calculated), where to store my AI (would this be like an enemy’s PlayerState?), and where to store general information, like what is in my player’s inventory or what level they are.
Lots of questions, I know, maybe not all of which belong in one post (I tried to keep them all related to things that have to do with blueprint variables), but i’m hoping there is someone who has a bit of all-around blueprinting experience who has maybe worked with an RPG before who can make everything make sense.
I am still slowly consuming some of these UE4 tutorials on YouTube, and have seen some on networking/savegames/variables/blueprint classes, but I think most of the general-purpose stuff doesnt quite make sense until you work it into something.