From: whale@leland.Stanford.EDU (Stephen Schmidt)
Subject: Re: reality vs. speed
Keywords: (note, skill is skill with weapon used and combat skill)
Organization: DSG, Stanford University, CA 94305, USA
Date: Sat, 12 Dec 92 08:03:19 GMT

In article <1gc2i7INNg0v@coral.bucknell.edu> skelly@capella.cs.bucknell.edu (sean kelly `94) writes:
>	-rand# vs. (victim's skill & agility vs. attacker's skill)
>	 to determine if the attacker 'got through the defender's
>	 defenses'
>	*if so*
>	-rand # vs. defender's ac to see if attack penetrates, if fail
>	 see *else*.
>	*if so*
>	-hit, divide dam by ac% (ac is 1-100).
>	*else*
>	-if rand# was within, say, 20 points of ac, then reduce
>	 endurance by (dam / ac%).  If endurance reaches 0, then 
>	 do, say, 1 point of hp damage for every 2  remaining.

You can make this faster this way:

  figure out the percentage chance of each possible outcome
  take 1 random from 1-100 and switch on it.

Any combat system can be reduced to 1 large roll in this way, just by
figuring the probability of doing N damage for all N, particularly if
you group the Ns into ranges like 5-8 damage.
Often it's clearer to actually use two rolls, one for hit and one for
damage, since the extra call to random and if-then aren't that much.
You have to hand-calculate and hardcode all these probabilities in
advance, which is the cost you pay for speeding up the code.

A second point: For every complex non-linear method of figuring out the
result, there is a simple, linear system which is faster to calculate
and which will produce results indistinguishably close to the complex one
from the player's perspective (which is all that matters anyway.)
>
>I want to use endurance (constitution & strength with some modifier)
>as a target for these bruises, so using a weapon would also wear
>someone out to some degree (it's easier to get your ass kicked 
>if your tired).  What I would like to know is if you think adding 
>the 'bruise' option will affect speed significantly.  I was considering an 
>alternate system that just left that out, if so.

I think you can add this in without adding significantly to the speed.
>
>On a unrelated note, what does everyone think about 'unnecessary
>stats' like charisma.  Although it helps in dealing w/NPC's, I think
>it would be better left out, and let player interaction handle the
>situation (player shopkeepers).  Following, in an ideal MU* (mine
>anyway), real players would constitute the majority of the population,
>with NPC's just added to fill very boring positions that have little
>interaction (like a farmer in most scenarios ) or to 'fill out' 
>the game to make it seem more real.

I agree with this totally. The optimal number of stats/skills is always
fewer than you have :) When was the last time you logged onto a MUD, played
for a while, quit and said "Gee, I liked that MUD a lot but I'll never play
it again because I just didn't have that charisma stat?"
  On the other hand, when was the last time you logged onto a MUD and left
in frustration because you couldn't figure out how the skill system worked?
>
>Any and all opinions would be appreciated.

I agree with the substantiative opinions, just think the math can be sped
up a touch :) 
-- 
Steve Schmidt			<><		   whale@leland.stanford.edu
I can no longer sit back and allow Communist infiltration, Communist
indoctrination, Communist subversion, and the international Communist
conspiracy to sap and impurify all of our precious bodily fluids!
Newsgroups: rec.games.mud.admin