FAQ Search Memberlist Usergroups
Jolt Country Forum Index
Register Profile Log in to check your private messages Log in
Log in Log in

Experience Points and Leveling Up

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Jolt Country Forum Index -> Hugo's House of Horrors
View previous topic :: View next topic  
Author Message
Ice Cream Jonsey



Joined: 27 Apr 2002
Posts: 20088
Location: Colorado

PostPosted: Thu May 02, 2013 11:25 pm    Post subject: Experience Points and Leveling Up Reply with quote

The code I am working on right now for Cyberganked is the one that check to see if a character gained a level.

I am going to think about what method would be most elegant in this thread, and maybe it will be an interesting discussion.

Here are the requirements and limitations:

- A character can have a maximum of 32,000 experience points. (Roody, I got your code about getting around Hugo's int limitation and I may go that route for this. Actually I almost definitely will.)

- A character gains levels based on tables for their class. A class is something like Commando, Magician, Mechanic, etc. So I can't just say if a player is at 22,222 experience points then their level is definitely 12 or whatever - it would depend on class.
_________________
the dark and gritty...Ice Cream Jonsey!
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Tdarcos



Joined: 16 May 2008
Posts: 4441
Location: University Park, Maryland

PostPosted: Fri May 03, 2013 1:40 am    Post subject: Re: Experience Points and Leveling Up Reply with quote

Ice Cream Jonsey wrote:
- A character can have a maximum of 32,000 experience points.
- A character gains levels based on tables for their class. A class is something like Commando, Magician, Mechanic, etc.


It sounds like you have plenty of room there. But, the question is, why do you need to do this? Do the attributes for a player class constitute separate attribute-type values for the class such that if you change enough of one attribute alone it changes the condition of the class or does it require more than one attribute to change, and if so, is the change cumulative for all of them or certain groups of attributes together are what determines what the change is? I'm not sure if I am clear but let me give an example.

In Free Pascal / Delphi, you can have an element on a form which is a button you can click on to do something, and you can also have an image; a picture, an icon, whatever. Image class objects don't have a click event but they do have a mousedown and a mouseup event. The mousedown event, if you enable it, fires when the user presses down on one of the buttons of the mouse - left, scroll wheel, or right - within the image. The mouseup event fires when the user releases that mouse button, whether the release is inside or outside of the image.

The mouseup event tells you which button was released and the x,y position relative to the top left corner of the image where the mouse is when the button is released. If either is negative or above the size of the image in that direction, it's out of range and outside the image, and in that case you can do nothing. But if you use the values when in range to do something when the mouse button used is the left button (as opposed to the scroll wheel button or the right button) and the left button release is within the image, well, you've just converted the element from an image into an image button.

Putting in code in the mouseup event of an image to act if the left mouse button release is within the image changes the class of the object from an image to an image button even if it's not in the button class explicitly.

So in your case, do raising or lowering certain properties of the character then change its class, and if so, what properties? If there is a property 'magic,' and 90-100 means a wizard, at what point is it not a wizard, e.g. if a warrior gets some potion and raises his magic from 10 to 90 is he now a wizard, or is he simply a warrior with high magic ability? I would think that certainly, if he reaches 90 he changes from class warrior to class wizard. But what about a wizard whose magic drops to 89, does this degrade a wizard to, say, sorcerer or mage or whatever the next level below wizard is, or does it just mean his magic is unreliabkle vis a vis Aunt Harriet in the TV show Bewitched?

If advancing above or dropping below a specific attribute automatically changes you to a new class is the case, then you'd need some sort of table to say that certain values automatically put someone in a particular class.

Otherwise you'd need some sort of code algorithm to say that, e.g. if you're above this attribute that puts you in one class, or if you're above attribute "a" to this amount and attribute "b" to this amount makes you this class, otherwise you're that class. Or it could be that all the attributes represent a certain value and the combined total determines your class.

What do you think? Does this help clarify your thoughts as to what you want to try to accomplish?
_________________
The lessons of history teach us - if they teach us anything - that no one learns the lessons of history.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Jizaboz



Joined: 31 Jan 2012
Posts: 567
Location: USA

PostPosted: Fri May 03, 2013 4:47 pm    Post subject: Re: Experience Points and Leveling Up Reply with quote

Ice Cream Jonsey wrote:
The code I am working on right now for Cyberganked is the one that check to see if a character gained a level.

- A character can have a maximum of 32,000 experience points. (Roody, I got your code about getting around Hugo's int limitation and I may go that route for this. Actually I almost definitely will.)

- A character gains levels based on tables for their class. A class is something like Commando, Magician, Mechanic, etc. So I can't just say if a player is at 22,222 experience points then their level is definitely 12 or whatever - it would depend on class.


I'd be interested to know how this would work in Hugo. Planning-wise though I think it would be a good idea to make an excel sheet that you can then spit graphs out of to visualize this.

|Class| |LVL1XPReq| |LVL2XPReq|
rogue 10 20

You've mentioned an xp cap, but not a level cap. Let's say that the level cap is 12. First, divide the xp cap by the level cap. Then use those #s to get an idea of how you can start plugging your values into each "LVLXPReq" now that the XP and level cap have been determined. I'd start at the bottom and top then work my way to the middle to eventually distribute the math depending on higher XP requirements for higher levels. In this process you also factor in which classes will be gaining higher. Classes with more skills or "multiclasses" of course always gain levels slower than their barbarian counterparts.

Then you'd have all the text you need for somehow throwing these tables into the Cyberganked code.. which I'm too much of a Hugo noob to speculate on at the moment.
Back to top
View user's profile Send private message Visit poster's website AIM Address MSN Messenger
Ice Cream Jonsey



Joined: 27 Apr 2002
Posts: 20088
Location: Colorado

PostPosted: Fri May 03, 2013 5:55 pm    Post subject: Reply with quote

OK, having digested these two posts and what Roody said in chat, I think I am going to go this route:

The game keeps track of the character's level.

You need a certain number of experience points to get to a new level.

New levels are always something the character asks for. (In fact, Jason Scott has agreed to play the NPC that acts as the "review board" or the person you "radio in to" for a new level, in Bard's Tale and Wasteland respectively.

When a character asks for a new level, I check to see if they acquired enough for the next level. If they did, then I zero out their experience points and change their level to the next one.

This lets me set up a thing where at max you need 32,000 experience points for each new level once you get up there.

HOWEVER, if I zero it, it also means that a player can only add one level at a time, which probably violates game/player trust.

Hmm.

I think I'm ready for Hugo 4 that supports 64 bit numbers. :)
_________________
the dark and gritty...Ice Cream Jonsey!
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Roody_Yogurt



Joined: 29 Apr 2002
Posts: 1993
Location: Milwaukee

PostPosted: Fri May 03, 2013 9:17 pm    Post subject: Reply with quote

I personally have not played many crpgs where it's possible to go up multiple levels from one battle. Just the same, yeah, if your design depends upon handling 33,000+ numbers, there's always that object-based thing you can do.

For those that haven't seen it, you split your numbers up to objects, like this:
Code:
property million alias n_to
property hundthou alias ne_to
property tenthou alias e_to
property thou alias se_to
property hundred alias s_to
property tens alias sw_to
property single alias w_to
property change alias noun

object gamescore
{
   million 0
   hundthou 0
   tenthou 0
   thou 0
   hundred 0
   tens 0
   single 0
   change 0
}


Then, your code can add to the digits of your choice, and another routine can print the result as one pretty number.
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Jolt Country Forum Index -> Hugo's House of Horrors All times are GMT - 7 Hours
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001 phpBB Group

Theme by Kage Musha - RPG Garden

Copyrights and trademarks are all of the belonging company. No copyright Infringement intended