# [MUD-Dev] [TECH] algorithm request

David Bennett ddt at discworld.imaginary.com
Thu Dec 20 11:07:35 New Zealand Daylight Time 2001

```On Wed, 19 Dec 2001, Malcolm Tester II wrote:

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

Depends on the type of curve you want...  You could use a hyperbola,
one of my favourite curves for this sort of thing :) It makes the
amount of xp drop off dramatically after the first try and then
flatten out towards a specific number.  This would be something
like:

xp = total_xp / num_kills + total_xp / 4

If you remove the constance it tends to zero.  You could also use a
parabola, which curves in the other direction.  It makes things stay
stable at the start and then drop off dramatically.  The best thing
to do with this is sit down with some graph paper and draw the curve
you want.  Then look around for an equation to fit it :)

Use some sort of graphing package to make your graphs, or try to
remember enough curve fitting theory to do it yourself.

As a side note, I think discworld uses a simple linear relationship
between frequency and automatic skill advances.

> For other curious people out there, I intend to accomplish this
> with MySQL.  I think the mappings structure within the lib would
> be too overloaded for this type of functionality.

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

Good luck!
David.

_______________________________________________
MUD-Dev mailing list
MUD-Dev at kanga.nu
https://www.kanga.nu/lists/listinfo/mud-dev

```