[MUD-Dev] [TECH] algorithm request

Malcolm Tester II malcolm.tester at planetcad.com
Fri Dec 21 09:53:26 New Zealand Daylight Time 2001


First, thanks to everyone else who responded.  I'm just going to
reply to each in here as best I can.  <snips> where needed :) I'm
also leaving on vacation today for a couple of weeks, so I'll have
to wait until jan. to test out all the examples.  Thanks so much
though!

> -----Original Message-----
> From: Travis Casey [mailto:efindel at earthlink.net]

> What do you want the curve to look like?  Is there a certain
> number of kills of a particular monster that should lower the XP
> payout to the minimum?  Do you want a linear fall, like:

> or do you want a curved one:

I want a curved one.  I don't want the player to just know how many
times they can kill something before moving on to the next one.

> Another sort of possibility would be to do what some of the older
> RPGs that had killing-based XP did -- scale it by level.  If
> you're higher level than the monster you kill, the XP you get is
> multiplied by:
 
>   monster_level / your_level
 
> This helps encourage high-level characters not to bother with
> low-level monsters -- the payout starts becoming very small
> quickly.

I also like this idea Travis.  I had thought of this before thinking
of my current idea, and still may be a good idea to implement
simultaneously.  Reason being, I'm not sold on the traditional idea
of allowing wizards to set/change exp in monsters.  If there were a
grand constant everything was calulated for, every monster could
potentially give out different experience every time they were
fought.  Players wouldn't be "Ok, tonight, it's wylt, wyrm, queen of
riva, frost giant, then repeat".

> -----Original Message-----
> From: Eli Stevens [mailto:listsub at wickedgrey.com]

> I am not particularly familiar with LPMuds, but I don't see it
> having much of an impact on what I have below.  Sorry if this is
> incorrect.  :) Why does it do that?  Why not just lower every
> mob's expereice worth by a factor of 50?  Or is not really a
> _constant_?  Just curious.  ;)

I'm not sure at what point it was introduced.  I think the original
2.4.5 lib actually added experience directly without using functions
to manipulate it.  I've generally coded from an extremely old
version of TubMud from 1992 or so, and looked other libs over over
the years.  I think it was used as a central way to help balance the
mud.  If you decided the experience everyone was receiving was too
little or too big, you could adjust the constant in living.c and the
whole mud changes.  No need to adjust every NPC manually.  So I may
have been a bit incorrect to suggest every old LP did it this way :)

> -----Original Message-----
> From: David Bennett [mailto:ddt at discworld.atuin.net]

> If you are using mudos with mysql links, don't use the built in
> mysql stuff, it is all blocking and can cause you significant
> problems if your queries take any time to execute.  For a better
> method, take the mysql_handler out of the Discworld mudlib
> distribution (http://www.lost.nu).

Fortunately, I am using a much better driver.  (Hides from MudOS
geeks) It's called LDmud, derived from Amylaar's.  And the MySQL
stuff works like a charm, so far.  I haven't had the chance to pile
in a ton of data to run against, but I haven't had any problems thus
far.

> -----Original Message-----
> From: Lars Duening [mailto:lars at bearnip.com]

> Btw, to implement a generic exponentation 'a to the power of b' in
> LDMud you can use exp(b * log(a)), ...I should really implement a
> power-of efun...

Way ahead of you :) This is where I actually started.  This is what
my original stuff looked like:

  #define MIN_EXPERIENCE_GIVEN
    ((this_player()->query_level()*this_player()->query_wis()) / 
    (total_kills+1))*this_player()->query_wis()

  #define K -0.0693147
  #define CALCULATE_CHANGE(x,i)  
    x*exp(K*i)-((this_player()->query_level()/5)*i)

  ...

  float change_exp(string prey, int x) {
    float i;
    if(!prey || !x)
       return 0;
    if(!member(killed, prey)) //Give full amount
      return to_float(x);
    increase_kills(prey);
    i = killed[prey];
    i = CALCULATE_CHANGE(x, i);
    if(i < MIN_EXPERIENCE_GIVEN)
      return to_float(MIN_EXPERIENCE_GIVEN);
    else
      return i;
  }

Now, this is full of flaws in my own opinion.  First, it was a stupid idea
to use something like a stat (query_wis()) in part of this formula,
especially since I've come up with a good use for wisdom since then *grin*.
At the time, wisdom was a useless stat.

Second, whether K is negative or positive, I've discovered cases where a
player could potentially receive even more experience than the monster is
worth to begin with.  It seems to either be negative heading to positive, or
positive heading towards negative, and if you use abs() on it, somewhere you
start getting bigger values.  Of course, I haven't added maximum bounds
checking, so that is one reason.  But it does it rather quickly, like even
less than 100 kills.  So I don't think this is a good formula overall.

So, thanks everyone who responded.  I'll try out each of those formulas.
I'm not familiar with MERC or Discworld so I'll look into those too, but I
think the stuff given on this list will be quite helpful.

Have a good holiday everyone!
Malc

Malcolm W. Tester II
Information Technology Manager
PlanetCAD, Inc.
2520 55th Street, Suite 200
Boulder, CO  80301
Tel.  303.209.9220
Fax.  303.209.9200
_______________________________________________
MUD-Dev mailing list
MUD-Dev at kanga.nu
https://www.kanga.nu/lists/listinfo/mud-dev



More information about the MUD-Dev mailing list