Page 1 of 1

Leftover Experience

Posted: Mon Oct 06, 2014 6:58 am
by Epiales
Okay, I have created an experience bar that shows the progress of the users experience. I have given the database userexp and a maxexp fields. How can I roll over the remaining experience if they go over their max experience? Right now I have it setting their user experience back to 0 and increasing their max eperience based on their level. That way the experience bar goes back down and shows how much exp they need to level up again.

So if the max experience is 600 and they are sitting at 590 and do a quest for 50.... how can I add the 40 extra experience to the next level?

Any ideas?

Re: Leftover Experience

Posted: Mon Oct 06, 2014 7:02 am
by Epiales
Okay, I think I may have already figured it out... something like

Their user experience goes over the max experience in the database. So I will deduct the max from the user to get the remainder.. then set the userexp to that new number.... I think that will work. Nuts how you can start writing it out and come up with ideas. Will see if I can't figure that out now.

Re: Leftover Experience

Posted: Mon Oct 06, 2014 7:07 am
by Epiales
Epiales wrote:Okay, I think I may have already figured it out... something like

Their user experience goes over the max experience in the database. So I will deduct the max from the user to get the remainder.. then set the userexp to that new number.... I think that will work. Nuts how you can start writing it out and come up with ideas. Will see if I can't figure that out now.
I'm talking to myself :lol: :lol: :lol: :lol:

This worked... Thanks :) lol

Re: Leftover Experience

Posted: Mon Oct 06, 2014 7:16 am
by MikuzA
What about having a 'overall experience', that just calculates all the gained.
Then have a separate logic that splits it to levels (a whole different table for example)

Level_Table -
Level 1 - ExperienceFrom: 0, ExperienceTo: 299
Level 2 - ExperienceFrom: 300, ExperienceTo: 849
Level 3 - ExperienceFrom: 850, ExperienceTo: 1499

Player1 - Experience:1200
Join Level_Table on Experience between ExperienceFrom AND ExperienceTo -> Level 3

Or something like that,
Then if your player receives... a huge amunt of experience by defeating something with a 1 hour struggle, and the player gets so much experience he gains 2 levels for it, It would be much easier to handle.

You catch the point? :)