[MUD-Dev] [TECH] algorithm request

Eli Stevens listsub at wickedgrey.com
Thu Dec 20 13:44:57 New Zealand Daylight Time 2001

----- Original Message -----
From: "Malcolm Tester II" <malcolm.tester at planetcad.com>

> I could use a little help with some math, if someone would be so
> inclined.  I need a good way to shell out experience for combat,
> and I'm having a little difficulty coming up with a good way.

> First, this is using LDMud, so it's LPC.

> Second, just for information's sake, combat experience isn't the
> only type of experience a player can gain.  There's also quest,
> trade, exploring, and maybe a couple of other things I haven't
> decided yet.  I really don't want a hack'n'slash mud.

> So, you set a monster's exp.  this amount is divided by a constant
> upon death.  I.e.  1000/50 as in the old lp mud style.

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.  ;)

> Let's say there is a monster named Bob.  Bob has 10,000
> experience.  Player kills him.  The experience daemon receives a
> notice that Player killed Bob for 200 exp.  The experience daemon
> notes that Player has killed Bob 0 times before.  So the
> experience daemon gives 200 exp to Player.

> Bob resets, Player kills him again.  200 exp is sent to the
> experience daemon again.  Now, the exp daemon notes that Player
> has killed Bob 1 time before.  So the exp daemon gives the player
> some exp amount less than 200.

> And so forth.  I've tried creating some algorithms myself, but
> they frankly stink.  My talents do not lie in math.  So if anyone
> could offer help, it would be appreciated.  I also want to set a
> "minimum" level of experience too.  So the player never gets to 0,
> they always get at least a little.

My frst incination would be to set a "half-life" for each of your
monsters.  After a plyaer has reached a number of kills equal to the
half-life for that monster, they get half the experience that they
did for the first kill.

    exp = baseExp * (halfLife / (killCount + halfLife))

If you also kept track of a time stamp for each monster killed by a
player, you could also lower the killCount in the above fn if they
don't press a monster type too hard.  Now, regenerating the
experience value of a monster is not really needed, but you have to
be careful, because without it, once an area has lost its value to a
plyaer, they can never use it again (for experience purposes).  That
will increase your content production needs considerably.

    killCount = 1 + killCount -
        floor( currentTime - lastKillTime / expRegenerateDelayTime )

    lastKillTime = currentTime

    exp = baseExp * (halfLife / (killCount + halfLife))

This leaves the question of the optimal rate to harvest a monster
at, given its half-life and regeneration delay.  Assuming instant
kills and a single monster, the best way (I think) to get exp would
be to kill once, then wait the delay, kill once again and repeat.
However, since those assumptions are more than likely false, I think
that to really answer the question would require a lot of
mud-specific information and analysis.

If you had N monsters with roughly the same difficulty and
experience; large half-lives and population; and a delay of N times
the time it takes to hunt and kill one; then a player could rotate
between them and not really notice the effects of the exp curve
(aside from being forced to rotate).

A long delay with a low half-life (even fractional) would make the
monster rare hunting - a dragon perhaps?

Another variation that might be interesting would be to increase a
player's headroom as they level, instead of regenerating the kill

    exp = baseExp * (halfLife * level / (killCount + halfLife *

This would reward players for NOT going after big kills at low
levels, as the monster would be worth close to the max for a larger
number of kills at higher levels.  It would promote bottom feeding
and over hunting the lowbie mobs.  Probably unfun, really.  :/

> A few issues you might be thinking of...eventually, if the player
> is a real killer, they may not be able to get enough experience at
> all.  I have two answers :) 1.  I don't want a hack'n'slash mud,
> so hopefully no one will kill that much.  I'm not concerned about
> those types of players.  Lots of other muds that can cater to
> them.  2.  There will be ways (in the form of spells, potions,
> whatever) to reduce the number of times they've killed monsters
> (most likely, on an overall basis, not individual monsters).  Then
> they can start receiving more experience again.

In-game killCount lowerings could be interesting too.  :)

Anyway, hope this was of some use, even if just as "Gawd, sure
wouldn't want to do it that way."  :)

MUD-Dev mailing list
MUD-Dev at kanga.nu

More information about the MUD-Dev mailing list