Is it better if i store required xp into the player as a local stat or do the multiplication every time i need to get required xp

image

for example when i want to display required xp on a ui should i do multiplication or use stored value inside of player (about displaying it with multiplication, i will have a variable stored in a module which will be used in scripts)

For me, I do not store the required XP. I just do the multiplication each time using a module – this way it’s easier to make any changes to the required XP formula if there’s a need to do so

can you specify the ‘changes’ to the xp formula

There’s another way though if you want to easily display the XP required on a UI without needing to expose your module to the client.

Basically, you do both of them. You can store the required XP in an IntValue like you did – but make sure to update it each time the players get XP to ensure they have the most up-to-date required EXP (just in case in the future you want to change the formula)

1 Like

image

It’s just a potential change that you may want to do in the future.

Example:
Your current formula rn is 100 * (1.2 ^ level)

But what if you want to change it to let’s say: 100 * (1.1 ^ level )

Now, you should know that 1.2^level and 1.1^level have a big difference. This is where you need ensure the player doesn’t get stuck with the old required XP

Sure, you can do that. But I recommend doing so every time the player gains XP (much easier to do than trying to level up when their level is already super high)

Oh yeah this only applies if you’re saving the required XP with data store. If not you can safely ignore doing this

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.