Durability
#9
hi hi, i talked about this with you earlier but never gave you an answer!

in the end i prefer building the table if i know that there is going to be some maximum number of entries because, although picking a random dword is pretty fast (using the PRNG algorithm which d2 uses), doing a non-power of 2 division at each point is very slow (to get a number 1-n). so looping through the list once to get the total and (on average) half a time (actually usually much less than half, see below) to get the actual pick without calling rand(n) is better in many cases than looping through just once but doing a mod each time.

actually the half a time is often less than that as well, for on the first loop you are often culling out many of the entries. the main drawback being that you have to know ahead of time the maximum number of entries or have very fast memory allocation if you are being streamed the items from a remote source.

{edit} oh and regarding your post about durability: i think you must have done your research pre 1.08? I think the probabilities for durability loss changed with the expansion. re: smite, i put a breakpoint in, and it is indeed reducing the dur for your weapon (not your shield) when you smite.
Reply


Messages In This Thread
Durability - by Archon_Wing - 03-14-2003, 03:58 AM
Durability - by Isolde - 03-15-2003, 07:01 PM
Durability - by Archon_Wing - 03-15-2003, 08:04 PM
Durability - by Conner Macleod - 03-15-2003, 10:07 PM
Durability - by Isolde - 03-16-2003, 12:05 AM
Durability - by Elric of Grans - 03-16-2003, 06:13 AM
Durability - by Jarulf - 03-16-2003, 01:03 PM
Durability - by Jarulf - 03-16-2003, 02:49 PM
Durability - by Isolde - 03-16-2003, 06:03 PM
Durability - by Jarulf - 03-16-2003, 06:14 PM
Durability - by Isolde - 03-16-2003, 07:02 PM
Durability - by Jarulf - 03-16-2003, 10:26 PM
Durability - by Loschonorg - 03-17-2003, 03:10 AM
Durability - by myrdinn - 03-18-2003, 01:42 PM
Durability - by Archon_Wing - 03-18-2003, 10:49 PM
Durability - by dectgap - 03-23-2003, 09:13 PM
Durability - by Archon_Wing - 03-23-2003, 10:02 PM
Durability - by Bolty - 03-23-2003, 10:07 PM
Durability - by dectgap - 03-23-2003, 10:31 PM
Durability - by Sheep - 03-24-2003, 04:00 AM
Durability - by Isolde - 03-24-2003, 04:14 AM
Durability - by Conner Macleod - 03-24-2003, 05:01 AM

Forum Jump:


Users browsing this thread: 5 Guest(s)