View Single Post
Old December 20, 2012, 23:59   #9
Derakon
Prophet
 
Derakon's Avatar
 
Join Date: Dec 2009
Posts: 8,946
Derakon is on a distinguished road
Quote:
Originally Posted by fizzix View Post
The second method is based off of the idea that the artifact is a more powerful version of a specific weapon type. Therefore, it makes intuitive sense to tie the artifact generation chance to the generation chance of that object type. The first method separates artifacts altogether.
This isn't actually how the "lump artifacts into the table with everything else" method (the "second method" you refer to, I believe) would work. Pseudocode time.
Code:
Method 1: explicit artifact check.

if 1 in (artifact chance): 
    generate artifact table
    try to select item from artifact table
    if selection succeeds:
        return artifact
    otherwise continue as normal
generate table of all non-artifact items
select item from table
Code:
Method 2: artifacts in with everything else

generate table of all items (including not-yet-generated artifacts)
select item from table
In the second method, you'd get tables that look something like the following:
Code:
Entries        item
0-40           Dagger
40-80          Potion of Cure Light Wounds
...
1000-1010      Blade of Chaos
1010-1020      Potion of Strength
...
10000-10000.1  Narthanc
...
50000-50000.0001  The One Ring
I don't understand your "from a tweaking perspective" comment. Isn't it easiest from a tweaking perspective to be able to regulate the relative rarity of any item to any other item? The easiest way to accomplish that is to shove everything into the same table.
Derakon is offline   Reply With Quote