[crossfire] "identification" skills patch

Mark Wedel mwedel at sonic.net
Tue May 22 23:20:01 CDT 2007


Lalo Martins wrote:

> My idea is that the code would pick the item(s) most likely to be dropped 
> and print that; the word "often" is static.  However, I don't remember 
> how "dropping" works, so I'm not sure there even is a way to determine 
> what's most likely.

  One can parse the treasure lists, but that is a complete new set of code that 
doesn't really exist.

  The treasure generation logic is quite formulaic - in some cases, like the 
treasureone list, it is very easy to see the most likely object, as only one 
object will get generated.

  However, other treasurelists can basically have if/else type of logic, and 
within those areas, depending on the condition, a group of items is generated 
(an obvious case of this is bows & arrows - we don't generate one without the 
other for monsters).

  It gets even more complicated in that treasurelists can contain other 
treasurelists, also within those clauses, or have different odds of going to 
that other treasurelist.

  Throw in the fact that some treasures (or traversals to other treasure lists) 
may have minimum map difficulties.  Does the code try to figure out what 
difficulty maps the monsters would typically be on?

  So figuring out the most likely objects is certainly possible, but may not be 
as simple as one thinks it may be.

  In some sense, this is almost like figuring out odds in blackjack (21).  One 
can do it mathematically, but is is easier to just brute force it - you write a 
program that plays a million hands and records different probabilities.

  That could pretty much work in crossfire also - one could do a thousand calls 
to the treasure generation function, and record each time what is generated, and 
then figure out what is the most likely.  But that has its own drawbacks - you 
want some level of grouping - you'd rather say 'generates potions often' by 
grouping all the times it generates a potion of some sort vs the potion of 
strength, potion of int, etc.

  Also, given the time it is likely to take to do this, you'd need to do this as 
startup or something.  It may in fact be reasonable to generate a file in lib 
periodically (maybe as part of make install) that has this information.

> 
> Equally, the "usually attack" actually displays what attack is stronger; 
> if the monster actually uses that or not, is beyond our scope to know.  
> (How to compare relative "strength" of spells vs. physical attacks is 
> something that still has to be worked out, I'll give this a thought, but 
> only if people generally agree this format is worth the work.  I'll 
> obviously also write the code, since I had the idea :-P)

  Figuring if a monster usually attacks with spells compared to physical gets 
tricky.  And for many monsters, you now need to factor in what equipment they 
have - titans always have bonecrushers, which I believe change their physical 
attack characteristics quite a bit compared to if they didn't have them.  Other 
monsters may be similar.

  The spoiler already extracts some of this information, but IIRC, it does some 
basic parsing of treasurelists, and in the spoiler list all the spell like 
abilities the creature may have, where as in almost all cases, a monster would 
only have a subset of those.

  Now some of this can become a lot easier if you look at the monster on the 
spaces being examined - in those cases, you know exactly what objects the 
monster has, as well as what spells, so can pretty easily give accurate results, 
but these are now specific to the monsters around, not general case.



More information about the crossfire mailing list