Talk about items.
#20
After going through the calculations I'm sure you can appreciate all the little pieces of information you must collect and keep in mind.

The rarity calculator project actually began with an idea of just posting the rarity of some of the most desirable items (obs/zod, aweseom/stars, etc). I was inspired by some Diablo 2 information I happened across about the source for the best drop probabilities for any unique item. I really thought it would be neat to do the same thing for diablo 1 items. As I started some sample calculations, I found it to be quite tedious. I decided it would be best to write a program that would sort it all out for me.

Before I even started coding, I figured that while I was making a program, I might as well make it calculate for any mlvl I specified. My original plan was for a small C program that would do all the calculations for a single item for all mlvls. That would of course require modifications for every item I wanted to post. Then, if it could do that, why not make a single program that could do the calculations for any item? And if for any item, why not from any enemy? Of course, I figured if I was going to make a program that could do it for any item, I could just publish the program instead of just using it to post the rarity of a few select items.

At that point I was beyond my knowledge of C, so I needed a new language and format to use. I did some research, considered whether or not I wanted it to run in a browser or be a downloadable executable, and eventually settled on using javascript. It was a bit of a lucky guess that allowed for a simple GUI using HTML. I spent a few weeks going through javascript tutorials to learn the language and how the code interacted with the web elements of the DOM.

The first part of the project was designing the form and using javascript to make the drop-down menus behave properly - basically everything that happens before you press 'calculate'. It was fairly easy and gave me the confidence that the whole thing was actually going to work. The next part I did was code the individual functions to calculate the rarity for any single source, starting with normal monsters. Logically the input would be mlvl and the output would be rarity. It took a lot of careful thinking to make sure that the function worked correctly not only for any mlvl, but for any item input. Then there is all the information about item generation in Jarulf's guide that I had to carefully go through several times to make sure I relfected in my code accurately. There's things like affixes with double chances of being chosen, cursed affixes, affix combinations that are not allowed even though they are otherwise valid, etc. Then there are all those little notes like the one I pointed out that make subtle differences.

Once the function for normal monsters was done, it just needed to be copied and slightly modified for the various other sources. The last part I needed to do was tie it all together by combining all of the sources together. Jarulf's guide has much of the information I needed except for one significant factor: monster distribution. He of course lists the probability of a particular monster to appear on a level, but I needed the distribution of them. For example, if a particular enemy spawned with only one other type on the level, it would make up half the level. But if the same enemy spawned with two other types, it would only be about 1/3 of the total number of monsters. What I needed was data for what a statistically average level looked like - basically if you played 10,000 games, added up all enemies of different types that spawned, then divided each by 10,000.

To get the information I needed, I went back to C and had to write a program that used the rules of monster generation. I first tried a systematic approach that would iterate through every possible way the game could generate monsters, count each enemy type, then divide through by the total number of combinations. At the same time I had it tally the probability for them to appear, and it unfortunately did not match Jarulf's guide. In the end, I just had it randomly generate levels thousands of times which worked.

I collected a lot of interesting data through this (unforseen) phase of the project about monster generation. In addition to the monster histogram data that I needed for the calculator, I have data for every dungeon level about how many ways the game can generate a combination of monsters (would include the same monsters generated for a level but picked in a different order), how many of those are unique combinations, and which of those combinations any particular enemy appears in. You'd probably be surprised at the results. For dlvl 1, while there is only one unique combination of enemies (all monsters that can spawn on dlvl 1 always do), there are 720 different ways to generate the level. In other words, the game can pick the same monsters, but in a different order. For dlvl 5, there are 3,505,008 possible ways the game can generate monsters for that level. In total, there are 6,801 unique combinations of spawned monsters! You could play the game for years and literally never see a particular spawn twice. In fact, I am missing data for one level because the total number of combinations is so large that I have yet been able to finish calculating it. My last attempt was over a year ago where I ran the program for 12 hours straight with no results - probably because I ran out of memory (2 GB of RAM). I planned at one point to post the information. Maybe soon I'll compute that final level and do just that...

Finally, the last part of the project was to consolidate the calculations from individual sources over an average game. It goes from item source to source, level by level, difficulty by difficulty, until they are combined for the entire game. Somewhere along the line I also decided to add options for "none" and "any" for a prefix or suffix to open up a lot of possibility for items.

The entire process took me about 3 1/2 months from toying with manual calculations to publishing the calculator, then another half month or so to iron out bugs and revamp the format of the output. I like that it can be used to determine if an item is valid as well as giving you an idea about where it might be found. A jade shield of brilliance is often the choice for arty mages trying to max their mana, but have you ever thought about how hard it would be or where you'd even find one?

Suppose you have a mid-level warrior in nightmare that is getting torn up due to lack of resistances. With your sub-par gear, you can give up the armor slot or a ring slot for an obsidian prefix, no matter the suffix. How hard would it be to find something like that? Well, just combine the probabilities for an obsidian ring or light, medium, heavy armor with our without a suffix - you get 20.5%, just under 1 in 5 games.
--Lang

Diabolic Psyche - the site with Diablo on the Brain!
Reply


Messages In This Thread
Talk about items. - by rc009 - 09-28-2008, 09:25 PM
Talk about items. - by --Pete - 09-28-2008, 10:46 PM
Talk about items. - by Nystul - 09-29-2008, 01:48 AM
Talk about items. - by LennyLen - 09-29-2008, 03:53 AM
Talk about items. - by FireIceTalon - 09-29-2008, 05:12 PM
Talk about items. - by Nystul - 09-29-2008, 06:33 PM
Talk about items. - by FireIceTalon - 09-29-2008, 08:56 PM
Talk about items. - by weakwarrior - 12-22-2008, 01:42 PM
Talk about items. - by LennyLen - 12-24-2008, 12:02 AM
Talk about items. - by the Langolier - 12-25-2008, 04:08 AM
Talk about items. - by Nystul - 12-25-2008, 10:53 PM
Talk about items. - by weakwarrior - 12-29-2008, 04:31 PM
Talk about items. - by the Langolier - 12-30-2008, 02:19 AM
Talk about items. - by weakwarrior - 12-30-2008, 02:27 PM
Talk about items. - by weakwarrior - 02-05-2009, 12:24 AM
Talk about items. - by Nystul - 02-05-2009, 01:59 AM
Talk about items. - by weakwarrior - 05-29-2009, 08:15 PM
Talk about items. - by the Langolier - 05-29-2009, 11:07 PM
Talk about items. - by weakwarrior - 05-29-2009, 11:51 PM
Talk about items. - by the Langolier - 05-30-2009, 11:33 AM
Talk about items. - by LennyLen - 05-30-2009, 12:32 PM
Talk about items. - by weakwarrior - 05-30-2009, 02:29 PM

Forum Jump:


Users browsing this thread: 2 Guest(s)