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.

Leftover Experience

Postby Epiales » Mon Oct 06, 2014 1:58 am

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: Wed Aug 14, 2013 8:38 pm
Has thanked: 62 times
Been thanked: 6 times

Re: Leftover Experience

Postby Epiales » Mon Oct 06, 2014 2:02 am

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: Wed Aug 14, 2013 8:38 pm
Has thanked: 62 times
Been thanked: 6 times

Re: Leftover Experience

Postby Epiales » Mon Oct 06, 2014 2:07 am

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
Epiales
 
Posts: 1119
Joined: Wed Aug 14, 2013 8:38 pm
Has thanked: 62 times
Been thanked: 6 times

Re: Leftover Experience

Postby MikuzA » Mon Oct 06, 2014 2:16 am

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
User avatar
MikuzA
 
Posts: 395
Joined: Thu Aug 08, 2013 3:57 am
Location: Helsinki, Finland
Has thanked: 0 time
Been thanked: 21 times


Return to Beginner Help and Support

Who is online

Users browsing this forum: No registered users and 2 guests

cron

x