MUD-Dev
mailing list archive
[ Other Periods
| Other mailing lists
| Search
]
Date:
[ Previous
| Next
]
Thread:
[ Previous
| Next
]
Index:
[ Author
| Date
| Thread
]
Re: [MUD-Dev] The grass is always greener in the other field
Travis Casey wrote:
> > Sellers, Michael <MSellers#maxis,com> wrote:
>
> >> seed = location seed + (obj ID | activity ID) + your skill level
> >> randNum = rand(seed)
> >> if (your skill > randNum) success = TRUE;
>
> >> Is that essentially what you were talking about?
> It should be noted, though, that making the skill value be used as
> part of the random number seed can lead to an undesirable result --
> namely, that a character who is currently able to pick a certain lock
> may go up in skill and find that he/she is no longer able to pick that
> lock, even though nothing else has changed!
You're not the only person in the pedantic mood! The same thing goes for the
location. Move the lock one picometer and it has become impossible to pick!
:*)
You strictly don't need a pseudo random generator either, because you don't
need the "one large cycle" property, or rather, it is acceptable with many
disjoint cycles. So a silly hash is sufficient, but use xor to avoid
saturation of yer bits.
My suggestion:
hash(ulong LockID,ulong UserID) =
( (LockID<<(ULONG_BITS-MAX_OBJ_ID_BITS)) ^ UserID ) % SOME_PRIME
K.I.S.S.
--
Ola Fosheim Groestad,Norway http://www.notam.uio.no/~olagr/
_______________________________________________
MUD-Dev maillist - MUD-Dev#kanga,nu
http://www.kanga.nu/lists/listinfo/mud-dev
- Thread context:
- Re: [MUD-Dev] The grass is always greener in the other field, (continued)
- RE: [MUD-Dev] The grass is always greener in the other field,
Sellers, Michael MSellers#maxis,com, Fri 17 Dec 1999, 23:00 GMT
- RE: [MUD-Dev] The grass is always greener in the other field,
Sellers, Michael MSellers#maxis,com, Sat 18 Dec 1999, 04:26 GMT
- [MUD-Dev] (fwd) Re: Artificial Language for MUD programmers,
claw claw#kanga,nu, Fri 26 Nov 1999, 19:06 GMT
[ Other Periods
| Other mailing lists
| Search
]