Re: Remember the Saving Throw table formulas?

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


On Thu, 5 Nov 1998 shirak@canada.com wrote:

>My testing at home when I first did it seemed much closer than the results I
>got with that download.  Hmm..., perhaps GNU C and MS VC++ do math differently...

I surely hope not. :)

>1)  Since you hard-coded top-level in there anyways, you can take out all the
>top level calculations, and hard-code it to be 30, imms don't need saving throws.

Right, that's why I threw out the level stuff.

>2)  Change the formula to this:
>
>return (int)((-(high_val - low_val) / ((float)(top_level-1))) * (level - 1)
>+ high_val);
>
>Perhaps a bit more tweaking, and I can get it perfect.
>
>(to save you the test, results with this are 860 total, and 353 wc thing)
>
>Also..., if that function would round to nearest int instead of just dropping
>the decimal (I have no help files, and can't remember function name), most of
>the results of -1 (probably 100 or so) would be perfect.

Rounding (to tens) goes like:
        (result + 5) / 10
Rounding to 1:
        (result + .5)
(Since .5 + .5 = 1 and >.5 + .5 = 1+ and <.5 + .5 < 1)

Not sure what your function would be, I'll leave it up to you to figure
out. :)

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