[CF-Devel] does expmul work correctly with the 'skills command?

crossfire-devel at archives.real-time.com crossfire-devel at archives.real-time.com
Sat Jun 19 05:38:41 CDT 2004


hello all,

Following on from the 'drop the death penalty' thread on the metalforge 
messageboard I started playing around with the expmul value in the archetypes 
for the lockpicking skill. Then I got pointed here.

The aim is to make it give some modicum of xp without being the preferred way 
to level up a character. 

By changing exp to 100 and expmul to 0.1 I was able to make it so that 
lockpicking gives 200 xp per lock in lockpicking and 20 xp overall. However 
it appears that this breaks the level breaks or the skills command. 

Leveling up in lockpicking is made to occur at 200, 400, 800 xp instead of 
2000, 4000 etc. The skills command displays the level breaks as normal 
meaning that the output can read things like:

lockpicking.............................lvl: 3 (xp:400/8000) 

I found the definition of expmul in crossfire/doc/Developers/skills and it 
doesn't seem to suggest it should act this way, saying nothing about level 
breaks.

However the comment for expmul in include/object.h says 
/* needed experience = (calc_exp*expmul) - means some */
/* races/classes can need less/more exp to gain levels */

So it looks like there are two conflicting definitions of this value, one 
altering rate at which xp goes to skill vs overall, and one where it 
determines the xp for level breaks. 

If both are correct behavior (as they are currently) then expmul is currently 
acting like expmul squared and the skills command is misbehaving. 

If it is incorrect behaviour then the rest of this post probably doesn't 
apply...

From grepping the code it seems like level_exp returns expmul * the level 
break xp, which suggests it is probably the value passed to it that is odd.

This is AFAICT 

level_exp(pl->level+1, pl->expmul) in server/c_misc.c 
to do the skills command

and

level_exp(tmp->level+1, op->expmul) in server/skill_util.c
doing something else.

There is also 

ADD_EXP(op->stats.exp, (float) exp_to_add * (skill_obj? skill_obj->expmul:1))
in common/living.c which /looks/ like it is the bit doing the experience 
adding, if so will mangling the other two lines to read 

level_exp(pl->level+1, pl->expmul*(skill_obj? skill_obj->expmul:1))

make it consistant?

I have tried compiling a server with those changes and it complains about 
undeclared skill_obj. Unfortunately I can't find a .h file with any mentions 
of it to #include only a give_skill_by_name() in common/living.c and I don't 
know how to use this.

I have tried following this through the source code further, but there is only 
so far I can get with grep and I don't really know how to use doxygen 
properly.

_______________________________________________
crossfire-devel mailing list
     
     crossfire-devel at lists.real-time.com
     
     
     https://mailman.real-time.com/mailman/listinfo/crossfire-devel
     
     
    


More information about the crossfire mailing list