Re: Remember the Saving Throw table formulas?

From: George (greerga@CIRCLEMUD.ORG)
Date: 11/06/98


On Fri, 6 Nov 1998 shirak@canada.com wrote:

>Well...., I did a bunch of tweaking, and I think that this is as close as a
>straight line can come to matching the old values (if there is enuf demand,
>I might try and calculate out all the curved lines..., but I'm not gon worry
>about that yet, I think this is close enuf)  I've gotten the results down to
>740 total, 325 wc thing.  I had to tweak a lot of values, so the whole thing
>is pasted below...

The Warrior one gets 99.6% accuracy with exponential functions instead of
99.0% accuracy with the linear functions.

  if (class_num == CLASS_WARRIOR && type == 3)
    return (pow(.9425, level) * 99);

  if (class_num == CLASS_WARRIOR && type == 2)
    return (pow(.9474, level) * 88);

  if (class_num == CLASS_WARRIOR && type == 1)
    return (pow(.95368, level) * 90);

  if (class_num == CLASS_WARRIOR && type == 0)
    return (pow(.93996, level) * 86);

Not that I need pow() there, I could use a for() loop with *=, but I was
going to make it work first.  The only problem with that is every other
class has linear functions and to make them similiar I decided to just keep
the linear.

>I remember using a round() function before, but that is probably much more efficient,

Isn't that BASIC?

>and won't require anymore .h files etc.  Well..., after testing it, I discovered
>that not many of the -1's will round up to zero, but a LOT of zeros round up
>to 1 (I even tried little tests like adding .1)..., Another 1/2 or so work might
>strip off a couple more lines, but thats it I think.

Your previous formula worked better as:

{
  float x = 0;

  x += high_val;
  x -= low_val;
  x /= (LVL_IMPL - 1);
  x *= (level - 1);
  x *= -1;
  x += high_val;
  return x;
}

Than:
  return (int)((-(high_val - low_val) / ((float)(LVL_IMPL-1))) * (level - 1) + high_val);

>Once again..., I remind everyone how much I hate web-mail and wish I could get
>a proper e-mail client to work behind the firewall at work...

Ed's with special cases and Class #3 uses exponentials:
Class #0: 138   0:39    1:27    2:24    3:24    4:24
Class #1: 151   0:29    1:31    2:30    3:31    4:30
Class #2: 2     0:0     1:1     2:1     3:0     4:0
Class #3: 258   0:54    1:49    2:43    3:49    4:63
Total difference: 549

Ed's without special cases or exponentials:
Class #0: 138   0:39    1:27    2:24    3:24    4:24
Class #1: 176   0:54    1:31    2:30    3:31    4:30
Class #2: 2     0:0     1:1     2:1     3:0     4:0
Class #3: 408   0:77    1:77    2:77    3:114   4:63
Total difference: 724

Yours without special cases or exponentials:
Class #0: 122   0:54    1:32    2:12    3:12    4:12
Class #1: 227   0:104   1:35    2:29    3:30    4:29
Class #2: 1     0:0     1:0     2:1     3:0     4:0
Class #3: 392   0:69    1:58    2:69    3:136   4:60
Total difference: 742

I think if I pick and choose among them I can probably get the best of both
worlds.  I just need to figure out how to convert the numbers between
formulas.  I'm not going to try too hard for saving throws, they're
arbitrary.  Most work will be getting the experience tables correct. I have
another document from Ed on getting those to work.  Thanks for the work,
I'll see what should go where.  I've updated the 'st.tgz' package also.
Thanks for the work, both of you.

--
George Greer, greerga@circlemud.org | Genius may have its limitations, but
http://mouse.van.ml.org/   (mostly) | stupidity is not thus handicapped.
http://www.van.ml.org/CircleMUD/    |                  -- Elbert Hubbard


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/15/00 PST