Item Creation in D1
#12
Some comments. Yes, I used a program to calculate the probabilities for unique items. It can also calculate the probability for any magical item. The reason there is no such info though si that there exist so many different types of magical items and I didn't want to pick out a few specific. However, have still have some data files for it I can post here (don't have access to my homepage to upload it from here though).

The program (which I seem to also have) will use the data for monster occurance as found in my guide (also calculated by another program) and normalize the probability of monsters for the desired level (so it sums up to 100%) and then divide the total number of monsters on the level according to that. Basically calculating for an "average" level. I might be wrong here thoug since I have not looked at the code for the program now. It will also factor in the bosses that can occur when the base monster occur.

In addition, it factors in an average number of chests, decapitaded bodies, barels and sarcophagus on the level. It does not handle racks or items directly on the floor since I never got arround to find that part of dungeon generation so can't tell how often one finds racks on specific levels. Here is a snipet of the code that handle such non monsters sources.

The program is an old one written in Turbo Pascal. For magical items it can geerate probabilities for a specific item but also for the probability of perfect such items.

Here is the sample code for calculating the number of items (note it multiply by the chance for the item to actually be an equipable items and hence to be magical/unique). This infromation is not to be found in my Guide in any way.

Code:
procedure doother(dlvl:word; var xprob:real);
var
 itemsonlevel : real;
begin
 itemsonlevel:=0;
 if dlvl in [1..15] then begin
   itemsonlevel:=itemsonlevel+0.5*7/8*1/4*7;        { small chest  5-9     }
   itemsonlevel:=itemsonlevel+1.0*7/8*1/4*4;        { medium chest 3-5     }
   itemsonlevel:=itemsonlevel+1.5*7/8*1/4*2.5;      { large chest  1-4     }
 end;
 if dlvl in [1..15,17..24] then
   itemsonlevel:=itemsonlevel+4/5*2/10*2/3*1/4*5*6; { barrel  (3-7)*6      }
 if dlvl in [1..4,21..24] then
     itemsonlevel:=itemsonlevel+3/10*1/4*14.5;      { sarchophagus 10 - 19 }
 if dlvl in [13..15] then
   itemsonlevel:=itemsonlevel+1/4*3.5;              { decapitated 2-5      }

 if itemsonlevel>0 then
   xprob:=xprob*pot(1-oneoprob(dlvl),round(itemsonlevel+0.5));
end;  { doother }

Here is a small snipet of codes that handle the actual calculations for a single monster/boss/other item. Just for your comparison. Unfortunately there is no comments and there is some calls to custom functions to determine certain properties like if an affix is cursed and so on. Since all calcs is for a specific item (and the program then loop for all desired items) there is a few global variables used to keep track of the items levels, such as the quality levels (of base item, qlvli, preffix, qlvlp and suffix, qlvls). It also access the data tables of the game directly in some cases, such as "mdata^[mslot,86]", this might not be obvious (and hard coded with no obvious way to understand) but for example extract the mlvl of the monster at position "mslot" (the current monster looked at) and at position 86 in that table, the agem stores the level of that monster type. I hope it is not too hard to dechifer. The program was never meant for distribution and tossed togetther in a sort of ad-hoc maner for various tasks I wanted. If you have questions about any other function call, please tell, I can eventually upload the whole program shoudl anyonwa want it.

Code:
function onemprob(dlvl,mslot:word):real;
var
 lvl   : word;
 tprob : real;
begin
 lvl:=mdata^[mslot,86];
 tprob:=0;
&nbsp;if ((lvl+diff*15)>=qlvli) and (lvl>=qlvlp) and ((lvl div 2)<=qlvlp) and (lvl>=qlvls) and ((lvl div 2)<=qlvls) then begin
&nbsp; &nbsp;tprob:=41/100*26/100*1/ipossiblemonster(lvl+diff*15)*4/24*1/ppossible(lvl,islot,true)*1/spossible(lvl,islot,true);
&nbsp; &nbsp;case idata^[islot,56] of
&nbsp; &nbsp; &nbsp; &nbsp; 23 : tprob:=tprob*1/4;
&nbsp; &nbsp; &nbsp;25,26 : tprob:=tprob*jpossible(lvl+diff*15,islot);
&nbsp; &nbsp;else
&nbsp; &nbsp; &nbsp;tprob:=tprob*(11+0.89*(lvl+1))/100;
&nbsp; &nbsp;end;
&nbsp; &nbsp;if perfect then
&nbsp; &nbsp; &nbsp;tprob:=tprob*1/irange(islot)*1/prange(pslot)*1/srange(sslot);
&nbsp;end;
&nbsp;onemprob:=tprob;
end; &nbsp;{ onemprob }


function onebprob(dlvl,bslot:word):real;
var
&nbsp;lvl1,lvl2 : word;
&nbsp;tprob &nbsp; &nbsp; : real;
begin
&nbsp;if pcursed(pslot) or scursed(sslot) then
&nbsp; &nbsp;onebprob:=0
&nbsp;else begin
&nbsp; &nbsp;if bdata^[bslot,12]=0 then
&nbsp; &nbsp; &nbsp;lvl1:=mdata^[bdata^[bslot,0],86]+5+2*diff*15
&nbsp; &nbsp;else
&nbsp; &nbsp; &nbsp;lvl1:=2*dlvl+diff*15;
&nbsp; &nbsp;lvl2:=mdata^[bdata^[bslot,0],86]+4;
&nbsp; &nbsp;if (not dgame) and (bslot=10) then begin
&nbsp; &nbsp; &nbsp;lvl1:=26;
&nbsp; &nbsp; &nbsp;lvl2:=26;
&nbsp; &nbsp;end;
&nbsp; &nbsp;tprob:=0;
&nbsp; &nbsp;if ((lvl1)>=qlvli) and (lvl2>=qlvlp) and ((lvl2 div 2)<=qlvlp) and (lvl2>=qlvls) and ((lvl2 div 2)<=qlvls) then begin
&nbsp; &nbsp; &nbsp;tprob:=4/24*1/ppossible(lvl2,islot,false)*1/spossible(lvl2,islot,false);
&nbsp; &nbsp; &nbsp;case idata^[islot,56] of
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 23 : tprob:=tprob*1/4;
&nbsp; &nbsp; &nbsp; &nbsp;25,26 : tprob:=tprob*jpossible(lvl1,islot);
&nbsp; &nbsp; &nbsp;end;
&nbsp; &nbsp; &nbsp;if (not dgame) and (bslot in [10..12]) then
&nbsp; &nbsp; &nbsp; &nbsp;tprob:=tprob*1/ipossiblemonster(lvl1)
&nbsp; &nbsp; &nbsp;else
&nbsp; &nbsp; &nbsp; &nbsp;tprob:=tprob*1/ipossibleboss(lvl1);
&nbsp; &nbsp; &nbsp;if perfect then
&nbsp; &nbsp; &nbsp; &nbsp;tprob:=tprob*1/irange(islot)*1/prange(pslot)*1/srange(sslot);
&nbsp; &nbsp;end;
&nbsp; &nbsp;onebprob:=tprob;
&nbsp;end;
end; &nbsp;{ onebprob }


function oneoprob(dlvl:word):real;
var
&nbsp;lvl &nbsp; &nbsp; &nbsp; : word;
&nbsp;tprob &nbsp;: real;
begin
&nbsp;lvl:=2*dlvl;
&nbsp;tprob:=0;
&nbsp;if (lvl>=qlvli) and (lvl>=qlvlp) and ((lvl div 2)<=qlvlp) and (lvl>=qlvls) and ((lvl div 2)<=qlvls) &nbsp;then begin
&nbsp; &nbsp;tprob:=41/100*26/100*1/ipossibleother(lvl+diff*15)*4/24*1/ppossible(lvl,islot,true)*1/spossible(lvl,islot,true);
&nbsp; &nbsp;case idata^[islot,56] of
&nbsp; &nbsp; &nbsp; &nbsp; 23 : tprob:=tprob*1/4;
&nbsp; &nbsp; &nbsp;25,26 : tprob:=tprob*jpossible(lvl+diff*15,islot);
&nbsp; &nbsp;else
&nbsp; &nbsp; &nbsp;tprob:=tprob*(11+0.89*(lvl+1))/100;
&nbsp; &nbsp;end;
&nbsp; &nbsp;if perfect then
&nbsp; &nbsp; &nbsp;tprob:=tprob*1/irange(islot)*1/prange(pslot)*1/srange(sslot);
&nbsp;end;
&nbsp;oneoprob:=tprob;
end; &nbsp;{ oneoprob }
There are three types of people in the world. Those who can count and those who can't.
Reply


Messages In This Thread
Item Creation in D1 - by Toverkol - 05-23-2005, 02:23 PM
Item Creation in D1 - by [vL]Kp - 05-23-2005, 03:09 PM
Item Creation in D1 - by Toverkol - 05-24-2005, 01:50 PM
Item Creation in D1 - by [vL]Kp - 05-24-2005, 02:13 PM
Item Creation in D1 - by Yogi_Baar - 05-24-2005, 02:17 PM
Item Creation in D1 - by Toverkol - 05-24-2005, 07:25 PM
Item Creation in D1 - by Fragbait - 05-24-2005, 09:57 PM
Item Creation in D1 - by Nystul - 05-25-2005, 01:44 AM
Item Creation in D1 - by Cytrex - 05-25-2005, 04:57 PM
Item Creation in D1 - by Toverkol - 05-26-2005, 01:59 AM
Item Creation in D1 - by Nystul - 05-26-2005, 09:38 AM
Item Creation in D1 - by Jarulf - 05-26-2005, 10:48 AM
Item Creation in D1 - by Toverkol - 05-26-2005, 01:29 PM
Item Creation in D1 - by the Langolier - 05-26-2005, 06:40 PM
Item Creation in D1 - by Selby - 05-27-2005, 03:48 AM
Item Creation in D1 - by Jarulf - 05-27-2005, 07:36 AM
Item Creation in D1 - by Toverkol - 05-28-2005, 03:38 AM
Item Creation in D1 - by [vL]Kp - 05-28-2005, 03:47 PM
Item Creation in D1 - by Toverkol - 05-29-2005, 09:40 PM

Forum Jump:


Users browsing this thread: 2 Guest(s)