Leftover Experience

Place for questions and answers for all newcomers and new coders. This is a free for all forum, no question is too stupid and to noob.
Post Reply
User avatar
Epiales
Posts: 1119
Joined: Thu Aug 15, 2013 1:38 am

Leftover Experience

Post 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?
Nothing fancy, but a work in progress!

http://gameplaytoday.net
User avatar
Epiales
Posts: 1119
Joined: Thu Aug 15, 2013 1:38 am

Re: Leftover Experience

Post 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.
Nothing fancy, but a work in progress!

http://gameplaytoday.net
User avatar
Epiales
Posts: 1119
Joined: Thu Aug 15, 2013 1:38 am

Re: Leftover Experience

Post 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
Nothing fancy, but a work in progress!

http://gameplaytoday.net
User avatar
MikuzA
Posts: 395
Joined: Thu Aug 08, 2013 8:57 am

Re: Leftover Experience

Post 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? :)
Why so serious?

Business Intelligence, Data Engineering, Data Mining
PHP, HTML, JavaScript, Bash/KornShell, Python, C#, PL/SQL
MySQL, DB2, Oracle, Snowflake
Pentaho, DataStage, Matillion, Unity3D, Blender
Post Reply

Return to “Beginner Help and Support”