As a French person I feel like it's my duty to explain strikes to you. - AdrienIer

Create an account  

 
Magic items added in Treasure

(October 25th, 2013, 10:40)SpearmanD92R Wrote: Just to emphasize, I'm fairly certain that if these items could have appeared, they would have appeared. The bot ran a certain set of lairs 7500 times and produced Living Bow 61 times. The chances of a particular item NOT appearing in the remaining 7439 trials, given that it had the same odds as Living Bow, are 0.000000000000000000000000413108%.
Given cost 650 vs cost 1100, it probably doesn't have the same odds. I wonder if it's using different sections of the item list for different costs (despite the fact that costs in the item lists are fairly random).

Hm. Tempted to create a 'fixed' randart file that sets all the book requirements to 0.
Reply

Investigated some more and there is more.

Here's the table how the function that selects a prefab item is called.
Code:
Source                     Type     Spellbooks       Value

Event gift of the gods     2        Receiver         0
Merchant                   0        12-12-12-12-12   0
Lair v1.31    registered-item-value Receiver         0
Lair v1.40n                0        Receiver         registered-item-value
Lair failed special        0        Receiver         1200
AI casts enchant item      1        Receiver         1000
AI casts create artifact   2        Receiver         30000

The algorithm (v1.31) is:
Code:
find_item(type, spellbooks, value):

try 50 times or until found
    select randomly from the 250 prefab items
    if (item in game)                  try again
    if (not enough spellbooks)         try again
    if (type = 1 AND special item*)    try again
    if (type = 2 AND NOT special item) try again
    if (value != 0 AND (item cost < value / 2 OR item cost > value)) try again
if (no item found)
    generate an item with random powers

*The Unk37 column indicates if the item is a "special item".

The algorithm (v1.40n) is:
Code:
find_item(type, spellbooks, value):

try 50 times or until found
    select randomly from the 250 prefab items
    if (item in game)                        try again
    if (type >= 1 AND not enough spellbooks) try again
    if (type = 0 AND special item)           try again
    if (value != 0 AND (item cost < value / 2 OR item cost > value)) try again
if (no item found)
    generate an item with random powers

As you can see there are some subtle differences in Insecticide.

When generating an item with random powers, we get:
Code:
generate an item with random powers(type, value):

    if (value = 0) treat as random value 700 - 1700
    if (type = 1) generate 2 powers with max cost 200
    if (type = 0) generate 3 powers with max cost 20000
    if (type = 2) generate 4 powers with max cost 20000
--I like ILSe
Reply

Summarizing my analysis of the code:

In v1.31 you can find *any* item in a lair, but you do need to fulfull the spellbook requirements.
If there is no suitable item available, one (that is not in the prefab list) will be generated for you.

In v1.40n you'll only find *non-special* items in a lair, and only those items with a cost between 50% and 100% of the value registered at world creation.
Spell book requirements are ignored for lairs.
If there is no suitable item available, one (that is not in the prefab list) will be generated for you.
--I like ILSe
Reply

In Insecticide 1.40n we can make a "fix".
Currently wizards.exe:8da06 contains 7Ch.
Change it into EBh and you'll drop the requirement that an item in a lair or from the merchant must be non-special.
(This won't work in v1.31.)

I'm going to try this now.
--I like ILSe
Reply

How does the not enough spellbooks test actually work? Could it be testing the wrong spellbook type or something?

In any case, the Insecticide requirement of no 'special' items from lairs does account for why you don't get anything at all interesting from them.
Reply

(October 26th, 2013, 07:12)I like Serena Wrote: The algorithm (v1.31) is:
Code:
find_item(type, spellbooks, value):

try 50 times or until found
    select randomly from the 250 prefab items
    if (item in game)                  try again
    if (not enough spellbooks)         try again
    if (type = 1 AND special item*)    try again
    if (type = 2 AND NOT special item) try again
    if (value != 0 AND (item cost < value / 2 OR item cost > value)) try again
if (no item found)
    generate an item with random powers

*The Unk37 column indicates if the item is a "special item".

Like I said in 1.31 there appear to be violations.
Code:
if (not enough spellbooks)         try again
...seems to not to be resolving as intended for me. If you are reading the code correctly and it compiles fine, then there are a couple of possibilities, one being that 1.31 is deriving the spellbooks owned by the wizard from the wrong source (wrong address? wrong wizard?), another being that it is deriving the spellbook requirements of the powers on the item from the wrong source (bad offset in ITEMPOW.LBX?). Neither seems very likely. Thanks for investigating this. I think i'll do something drastic and grab other versions of the game, and run the bot more to see if there was a problem on my end.

barring that, the random seen used in the line
Code:
select randomly from the 250 prefab items
may be running another procedure using ITEMPOW or something. Urrgh....
Reply

(October 26th, 2013, 12:54)Anthony Wrote: How does the not enough spellbooks test actually work? Could it be testing the wrong spellbook type or something?

It tests each color and sees if the number spellbooks a wizard has is at least as high as the spell book requirement.
Nothing weird there, although kyrub left a note that he thought something was wrong about adding instead of subtracting.
But I don't think it is wrong.

So my question is: can you find items in v1.31 that do not satisfy the spell book criterium?


Quote:In any case, the Insecticide requirement of no 'special' items from lairs does account for why you don't get anything at all interesting from them.

Don't forget the "ignore spell book requirement in lairs".
That would explain how you can find items for which you do not have the spell books.
They should only be non-special though.


Either way, I'm still wondering what I'm missing.
A helm of trollish should not be in a lair in Insecticide due to the non-special requirement.
And it should only be in 1.31 lair if you have 6 nature books.
Furthermore monster masher should not be in a 1.31 lair due to the spell book requirements (life & death).
And it should not be in a 1.41n lair due to the non-special requirement.


Currently I'm playing a game with my "fixed" 1.40n version.
Up till now it works as expected (with the 12 items I've found so far), but I haven't found any truly powerful items yet.
Anyway, I'm getting to the point that I'm cracking heavy duty lairs, so we'll see.


Btw, I would be interested in a list of "violations".
That is, a list of non-possible items you have found "in a lair" combined with the version of MoM (v1.31 or v1.40n), and the number of spellbooks you have.
It would help to figure out what's going on.
--I like ILSe
Reply

(October 26th, 2013, 13:14)I like Serena Wrote:
(October 26th, 2013, 12:54)Anthony Wrote: How does the not enough spellbooks test actually work? Could it be testing the wrong spellbook type or something?

It tests each color and sees if the number spellbooks a wizard has is at least as high as the spell book requirement.
Nothing weird there, although kyrub left a note that he thought something was wrong about adding instead of subtracting.
But I don't think it is wrong.

So my question is: can you find items in v1.31 that do not satisfy the spell book criterium?

Yes, you can.

You can find items for which you don't have the books. This is an easy test, since the first such item that pops up obviously proves the rule is malfunctioning (see my reply 20 on prev. page).

You can also NEVER find certain item powers even though you have the books. This was much less certain, and impossible to prove outright, which is why I ran a bot to clear lairs thousands of times.
Reply

(October 26th, 2013, 13:14)I like Serena Wrote: Btw, I would be interested in a list of "violations".
That is, a list of non-possible items you have found "in a lair" combined with the version of MoM (v1.31 or v1.40n), and the number of spellbooks you have.
It would help to figure out what's going on.

I think what I might do is a game with the "easy" test described above - try to get you a full list of special items that appear when the wizard has zero books.

All my data was with 11 death or 11 sorcery. When i started this little investigation I had no idea the spellbooks would be important (because it had never seemed that way in the past) so I'm afraid I've been less rigorous about it so far.
Reply

Incidentally, will the AI actually cast Enchant Item/Create Artifact in Insecticide? I'm pretty sure it won't in v1.31, which means all the 'special' stuff is irrelevant.
Reply



Forum Jump: