Best way to do character stats?

I am looking for the best way to do house stats for the character in my game…
Right now, I just have integers stored in a structure. Which is fine, but I want a decent way to calculate XP for each stat. What I had pictured is individual blueprints for each stat that does the calculations of gained experience and advancing levels. I would then make a structure of those stat blueprints and put them on my player character and then display that information using UMG. Does that sound right? What are others dong to accomplish this?

Any input would be great!
Matt

I think the “integers in a struct” method is the best personally. Just have 2 values for each stat (ex. STR and STR_XP) and have the code to display all that live inside the UMG.

Nothing wrong with your proposal mind you. It just seems “neater” to have all calculations done in one place. Easier to debug too.

Yeah that’s what I’m trying right now, I’m just trying to figure out to store the data for all the “XP to advance level”. What I am guessing is that lets say I get a total of 120XP from killing something, or from skilling. Every “strike” you add XP to the “Current SKILL XP”, and check to see if Current = Required to level up. I’m guessing once that is true, you change the “required XP to level up” to the next “Target XP for next level”. Or do a series of checks…
(example)
If xp > level 1 xp < level 2 xp - set level to 1
If xp > level 2 xp < level 3 xp - set level to 2
If xp > level 3 xp < level 4 xp - set level to 3
and it continues to level 100

But how would I do so many checks per skill/stat? I’ll try testing some stuff and update my findings.

Anyone have input on this feel free to shine in!
Matt

Structs with data tables and curves are certainly going to be useful. Check out episode 8 + 9 of the UE game-ready AI stream for a process of implementing a basis of that sort of system.

Defaults and references stored in a struct’s DT, with the current values stored and modified on the character. They shouldn’t need to be in a separate actor BP, but if they were to be in a component you could drop the logic onto things other than the player char.

I understand now why xp curves on most games follow a mathematical (typically exponential) progression. Its easier to code xD

For example: xpToNextLvl = baseAmount^currentLvl * scalingFactor

So itll be a single check every xp gain event that compares current xp to the “xpToNextLvl” variable (which then only gets set whenever a level is gained).