[CF-Devel] PROPOSAL: Luck

Tim Rightnour root at garbled.net
Sun Sep 16 02:06:31 CDT 2001


So.. being a worshipper of Lythander, I was curious as to what exactly luck was
buying me, and quite horrified to find that it provided me nothing.

Luck is an intangible benefit.  You can't simply say that "a luck of +1 means
you hit for 1 extra HP of damage"  because what that essentially translates
into is either luck == armour, or luck == damage.

Instead, luck needs to affect all aspects of play.  When I make a saving roll,
luck should play a role in it.  When I have a random effect on a spell, it
should move it towards the good end of the spectrum.  It should occasionally
assist me in recharging wands, or when praying.

To make an change this extensive, would be hours of work (adding luck to every
calculation in the server).  Instead, I propose modifying the way random die
rolls are made.  Currently CF uses RANDOM()%foo to generate a random number. 
This could be replaced by a generator function, like random_roll(min, max, op); 
Wherein, the luck would be taken into account.

Not all uses of RANDOM should be changed, some of them are internal
functionality, and should not be modified by luck.  The initial code could go
in, and functions could be evaluated on a per-function basis for modification.

Now for what the code would actually do:

We have a baseline for luck of 20.  When I make a random roll, of say
1-10, the following would occur:

1) The players luck is compared to a random roll of 1-20.  A luck of 2 would
mean I have a 2/20 chance of having a luck effect.  Player luck would max out
at 10 in this function.

2) If the player wins the luck roll, the roll of 1-10 is modified by +1 (and
only +1, never more) to 2-10.  This shifts the average slightly upwards for the
player.

3) Bad luck would work the opposite.. where the roll would be 0-10, and then be
modified back to the minimum (it's a 1-10 roll, so it must return at least 1)

Why I chose this scheme:

In this way, a player with a luck of two, is literally twice as lucky as a
player with a luck of 1. He gets slightly better rolls 1/10th of the time.

The luck never becomes overbearing.  A luck of 10 doesn't translate into me
hitting 50% of the time, at best, things just get slightly better for the
player, more luck means they are slightly better more often.

On smaller die rolls (like 1-4) the effect is more tangible, whereas more
common rolls such as combat, the effect is diminished more.  This means luck
could translate into a tangible benefit for recharging wands, without
unbalancing the whole combat system, or chance to learn a spell.

I don't want to see luck become a +N to all stats.


It might be necc. to add an additional argument to the function, that being if
a high roll or a low roll is preferred.  That way things where you want low
rolls you aren't penalized by luck.

If this is a generally acceptable idea, I can post a patch where I implement
the function, and change a few benign instances of RANDOM to use it.  Over
time, more things can be modified to use this.

Thoughts?  flames?  Violent rage?  :)  (boy this new guy sure is annoying)

---
Tim Rightnour <
     
     root at garbled.net
     
     >
NetBSD: Free multi-architecture OS 
     
     http://www.netbsd.org/
     
     
NetBSD supported hardware database: 
     
     http://mail-index.netbsd.org/cgi-bin/hw.cgi
     
     
    


More information about the crossfire mailing list