<!-- MHonArc v2.4.4 --> <!--X-Subject: The laws of probability --> <!--X-From-R13: pbqreNvoz.arg --> <!--X-Date: from major.globecomm.net [207.51.48.5] by in4.ibm.net id 865664220.45184-1 Sat Jun 7 06:17:00 1997 CUT --> <!--X-Message-Id: 199706070616.GAA56998#out1,ibm.net --> <!--X-Content-Type: text/plain --> <!--X-Head-End--> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"> <html> <head> <title>MUD-Dev message, The laws of probability</title> <!-- meta name="robots" content="noindex,nofollow" --> <link rev="made" href="mailto:coder#ibm,net"> </head> <body background="/backgrounds/paperback.gif" bgcolor="#ffffff" text="#000000" link="#0000FF" alink="#FF0000" vlink="#006000"> <font size="+4" color="#804040"> <strong><em>MUD-Dev<br>mailing list archive</em></strong> </font> <br> [ <a href="../">Other Periods</a> | <a href="../../">Other mailing lists</a> | <a href="/search.php3">Search</a> ] <br clear=all><hr> <!--X-Body-Begin--> <!--X-User-Header--> <!--X-User-Header-End--> <!--X-TopPNI--> Date: [ <a href="msg01245.html">Previous</a> | <a href="msg01247.html">Next</a> ] Thread: [ <a href="msg01343.html">Previous</a> | <a href="msg01282.html">Next</a> ] Index: [ <A HREF="author.html#01246">Author</A> | <A HREF="#01246">Date</A> | <A HREF="thread.html#01246">Thread</A> ] <!--X-TopPNI-End--> <!--X-MsgBody--> <!--X-Subject-Header-Begin--> <H1>The laws of probability</H1> <HR> <!--X-Subject-Header-End--> <!--X-Head-of-Message--> <UL> <LI><em>To</em>: <A HREF="mailto:mud-dev#null,net">mud-dev#null,net</A></LI> <LI><em>Subject</em>: The laws of probability</LI> <LI><em>From</em>: <A HREF="mailto:coder#ibm,net">coder#ibm,net</A></LI> <LI><em>Date</em>: Fri, 06 Jun 97 20:00:40 -0700</LI> </UL> <!--X-Head-of-Message-End--> <!--X-Head-Body-Sep-Begin--> <HR> <!--X-Head-Body-Sep-End--> <!--X-Body-of-Message--> <PRE> As promised. This is partially written as a speach I'm now not going to give, so forgive the pompousness. One thing I've been looking at is causitively controlling probability within the game. Thus, at the crude level, a Ring Of Luck could say make all probability choices come out in the player's favour, or a Ring Of Bad Luck could make them all come out against him. It gets more interesting if you merely warp the probability field instead of forcing it to 0 or 1 however. Then you could have a curse of Minorly Bad Luck, which would just mean that probability choices for that player would start to fall against him more often. To do this two things need to be done: 1) All probability choices have to go thru a central clearing house where they are "shifted" by the appropriate weight factor, +ve or -ve. Without a central clearing house for probability decisions (or at least a consistant and shared structure), you can't have broad ranging probability shifts. 2) The _direction_ of probability values has to be the same. One (1) must always be success as defined by "what the player wanted", or "to the player's advantage", and zero (0) must always be failure. ie no negative logic. Without this pattern a good luck weighting will force the probability calculations to return sometime return more successes (ie what you want) and sometimes return more failures (ie exactly what you don't want). Next the probability fields need to be split into areas. It would be neat for instance to have a device which increases luck during magic, or another which increases luck during combat, theivery, and such. You don't want to have different probability engines for every different *type* of probability action: for one your programmers would go bonkers, and you'd not be able to easily have a device which affected several probability fields at once (eg a ring which increases luck at magic, but confers very bad luck in combat). The thing you can't do is to invert the entire probability field. You can't have something like, "Wear this ring and all the old certain things become nearly impossible, and all the old incredibly rare things become possible". Follow that far enough and your character is going to asphyxiate because the probabilities underlieing brownian motion and the motion of all the air molecules/atoms near him just accidentally conspired together so that your character is now in a pure vacuum, only to find that 3 seconds before he expires all the air has returned to form a small black hole just below his navel. Inverted probability fields are things of nightmareish unpredictability -- literally anything can happen, and more frequently than what should happen. Can't do that. Even if you could go that far, your players couldn't and would leave before they arrived. My solution: To make probability calculations a little finer, the actual scale fills an unsigned 32bit integer. 0 is failure, MAX_UINT is success. The probability call works on the form: ChanceCalc (base_probability, type_list, char_weight_map, env_weight_maps} base_probability is a computed value. This is your normal predictive calculation; various stats rolled together or whatever. It is a deterministic value on the character's chances of doing whatever presuming that no other external circumstances intervene. eg If Bubba is attempting to decapitate an Orc with an axe, and he has enough strength, and the Orc is largely immobile, etc you could reckon that 75% of the time he'd do it. 75% of MAX_UINT would be the base_probability. type_list is a list of the probability fields that will affect this probability call. Is magic involved? Is combat involved? Is physical dexterity involved? Whatever. The general probability field has been sub-divided into more specific probability fields, each of which has been assigned a name. type_list is a list of the probability field names which affect the action being attempted. The weight_maps are lists of pairs, probability field names and weights, The char_weight_map is a list of the probability field weights assigned to that specific character. The env_weight_map is a list of probability weights assigned to where ever the character is. The calculation is: X is a random number from 0 - MAX_UINT. Y is the sum of all the char_weight_map entries which match type entries in type_list. Z is the sum of all the env_weight_map entries which match type entries in type_list. if (base_probability + Y + Z < X) then return 1 else return 0 endif Gotta ring that makes the bearer more successful in sword-play? Just have it add an entry to the character's SWORD char_weight_map and everything else takes care of itself. Got another ring which makes the fellow clumsy? Just add a matching entry. Got a spell which makes an area unlucky? Add an entry to the area's env_weight_map. Etc. Next up, magic structures. -- J C Lawrence Internet: claw#null,net ----------(*) Internet: coder#ibm,net ...Honourary Member of Clan McFud -- Teamer's Avenging Monolith... </PRE> <!--X-Body-of-Message-End--> <!--X-MsgBody-End--> <!--X-Follow-Ups--> <HR> <ul compact><li><strong>Follow-Ups</strong>: <ul> <li><strong><A NAME="01284" HREF="msg01284.html">Re: [MUD-Dev] The laws of probability</A></strong> <ul compact><li><em>From:</em> Adam Wiggins <nightfall#user1,inficad.com></li></ul> <li><strong><A NAME="01282" HREF="msg01282.html">Re: [MUD-Dev] The laws of probability</A></strong> <ul compact><li><em>From:</em> clawrenc#cup,hp.com</li></ul> </UL></LI></UL> <!--X-Follow-Ups-End--> <!--X-References--> <!--X-References-End--> <!--X-BotPNI--> <UL> <LI>Prev by Date: <STRONG><A HREF="msg01245.html">"short" Introductory Message (fwd)</A></STRONG> </LI> <LI>Next by Date: <STRONG><A HREF="msg01247.html">Re: [MUD-Dev] "short" Introductory Message (fwd)</A></STRONG> </LI> <LI>Prev by thread: <STRONG><A HREF="msg01343.html">Re: [MUD-Dev] "short" Introductory Message (fwd)</A></STRONG> </LI> <LI>Next by thread: <STRONG><A HREF="msg01282.html">Re: [MUD-Dev] The laws of probability</A></STRONG> </LI> <LI>Index(es): <UL> <LI><A HREF="index.html#01246"><STRONG>Date</STRONG></A></LI> <LI><A HREF="thread.html#01246"><STRONG>Thread</STRONG></A></LI> </UL> </LI> </UL> <!--X-BotPNI-End--> <!--X-User-Footer--> <!--X-User-Footer-End--> <ul><li>Thread context: <BLOCKQUOTE><UL> <LI><strong><A NAME="01247" HREF="msg01247.html">Re: [MUD-Dev] "short" Introductory Message (fwd)</A></strong>, Chris Gray <a href="mailto:cg#ami-cg,GraySage.Edmonton.AB.CA">cg#ami-cg,GraySage.Edmonton.AB.CA</a>, Sun 08 Jun 1997, 00:17 GMT <UL> <LI><strong><A NAME="01257" HREF="msg01257.html">Text output [was "short" Introductory Message (fwd)]</A></strong>, Matt Chatterley <a href="mailto:root#mpc,dyn.ml.org">root#mpc,dyn.ml.org</a>, Sun 08 Jun 1997, 16:02 GMT </LI> <LI><strong><A NAME="01385" HREF="msg01385.html">Re: [MUD-Dev] "short" Introductory Message (fwd)</A></strong>, Martin Keegan <a href="mailto:martin#cam,sri.com">martin#cam,sri.com</a>, Fri 20 Jun 1997, 20:07 GMT </LI> </UL> <UL> <li><Possible follow-up(s)><br> <LI><strong><A NAME="01343" HREF="msg01343.html">Re: [MUD-Dev] "short" Introductory Message (fwd)</A></strong>, Chris Gray <a href="mailto:cg#ami-cg,GraySage.Edmonton.AB.CA">cg#ami-cg,GraySage.Edmonton.AB.CA</a>, Wed 18 Jun 1997, 21:48 GMT </LI> </UL> </LI> <LI><strong><A NAME="01246" HREF="msg01246.html">The laws of probability</A></strong>, coder <a href="mailto:coder#ibm,net">coder#ibm,net</a>, Sat 07 Jun 1997, 13:17 GMT <UL> <LI><strong><A NAME="01282" HREF="msg01282.html">Re: [MUD-Dev] The laws of probability</A></strong>, clawrenc <a href="mailto:clawrenc#cup,hp.com">clawrenc#cup,hp.com</a>, Wed 11 Jun 1997, 05:57 GMT </LI> <LI><strong><A NAME="01284" HREF="msg01284.html">Re: [MUD-Dev] The laws of probability</A></strong>, Adam Wiggins <a href="mailto:nightfall#user1,inficad.com">nightfall#user1,inficad.com</a>, Wed 11 Jun 1997, 08:47 GMT <UL> <LI><strong><A NAME="01297" HREF="msg01297.html">Re: [MUD-Dev] The laws of probability</A></strong>, clawrenc <a href="mailto:clawrenc#cup,hp.com">clawrenc#cup,hp.com</a>, Thu 12 Jun 1997, 03:00 GMT <UL> <LI><strong><A NAME="01309" HREF="msg01309.html">Re: [MUD-Dev] The laws of probability</A></strong>, clawrenc <a href="mailto:clawrenc#cup,hp.com">clawrenc#cup,hp.com</a>, Fri 13 Jun 1997, 01:04 GMT </LI> </UL> </LI> </UL> </LI> </UL> </LI> </UL></BLOCKQUOTE> </ul> <hr> <center> [ <a href="../">Other Periods</a> | <a href="../../">Other mailing lists</a> | <a href="/search.php3">Search</a> ] </center> <hr> </body> </html>