Feature - Implemented Add more $monster[] data

ckb

Active member
I would like to add monster elemental resistance and group size to $monster[].proxy data.

Currently $monster[] data includes a .physical_resistance. It would be helpful to add .elemental_resitance and .group_size.
These three data points are critical to determining damage against a monster.
 

VladYvhuce

Member
Out of curiosity, does elemental resistance go into negative values for elemental weaknesses? Or is that a different property?
 

gausie

D̰͕̝͚̤̥̙̐̇̑͗̒e͍͔͎͈͔ͥ̉̔̅́̈l̠̪̜͓̲ͧ̍̈́͛v̻̾ͤe͗̃ͥ̐̊ͬp̔͒ͪ
Staff member
This is easy enough to add - can anyone provide an initial data dump for the two values?
 

ckb

Active member
Here is my monster initial data:

Code:
Monster Name    id    Attrib
bee swarm    1079    Group: 3
bee thoven    1081    Group: 3
beebee gunners    1077    Group: 3
beebee queue    1080    Group: 2
big swarm of ghuol whelps    1073    Group: 15
Big Wheelin' Twins    1241    Group: 2
Blue Oyster cultist    1528    Elem: 0.75
Bubblemint Twins    1240    Group: 2
bunch of drunken rats    995    Group: 3
Chef Boy, R&D    1466    Elem: 0.5
clan of cave bars    1162    Group: 10
Clancy    1338    Elem: 0.25
cloud of disembodied whiskers    226    Group: 20
cow cultist    1902    Elem: if (to_int(get_property("lttQuestDifficulty"))==2) { eres = 0.75; } if (to_int(get_property("lttQuestDifficulty"))==3) { eres = 1.00; }
Demon of New Wave    892    Elem: 0.4
Deputy Nick Soames & Earl    1220    Group: 2
drippy bat    2163    Elem: 1
drippy reveler    2176    Elem: 1
drippy tree    2162    Elem: 1
Eldritch Tentacle    1974    Elem: 0.5
eXtreme Sports Orcs    336    Group: 2
Family Jewels    180    Group: 2
family of kobolds    1101    Group: 100
flock of seagulls    699    Group: 2
Flock of Stab-bats    133    Group: 4
giant swarm of ghuol whelps    1074    Group: 45
God Lobster    2088    Elem: if (have_equipped($item[God Lobster's Ring])) { Phys = 0.30; } if (have_equipped($item[God Lobster's Rod])) { Phys = 0.50; eres = 0.25; } if (have_equipped($item[God Lobster's Robe])) { Phys = 0.60; eres = 0.60; } if (have_equipped($item[God Lobster's Crown])) { Phys = 0.80; eres = 0.90; }
Gorgolok, the Demonic Hellseal    888    Elem: 0.4
Gorgolok, the Infernal Seal (Volcanic Cave)    882    Elem: 0.25
group of cultists    828    Group: 3
guy with a pitchfork, and his wife    394    Group: 2
Herald of Fridgr    2197    Elem: 1
Irritating Series of Random Encounters    167    Group: 20
Jeff the Fancy Skeleton    1917    Elem: 0.7
LOV Enforcer    2009    Elem: 0.25
LOV Engineer    2010    Elem: 0.75
LOV Equivocator    2011    Elem: 0.5
Lumpy, the Demonic Sauceblob    891    Elem: 0.4
Lumpy, the Sinister Sauceblob (Volcanic Cave)    885    Elem: 0.25
mad bugbears    257    Group: 3
Mismatched Twins    1242    Group: 2
moister oyster    1371    Elem: 0.25
moomy    1916    Elem: if (to_int(get_property("lttQuestDifficulty"))==2) { eres = 0.50; } if (to_int(get_property("lttQuestDifficulty"))==3) { eres = 0.75; }
oil baron    1237    Elem: 0.5
oil cartel    1238    Elem: 0.25 Group: 3
oil tycoon    1236    Elem: 0.25
pygmy assault squad    448    Group: 2
rag-tag band of survivors    1225    Group: 4
restless ghost    1906    Elem: if (to_int(get_property("lttQuestDifficulty"))==2) { eres = 0.50; } if (to_int(get_property("lttQuestDifficulty"))==3) { eres = 0.75; }
school of many    1374    Group: 20
school of wizardfish    717    Group: 4
Shub-Jigguwatt, Elder God of Violence    1377    Elem: 0.95
Somerset Lopez, Demon Mariachi    893    Elem: 0.4
Somerset Lopez, Dread Mariachi (Volcanic Cave)    887    Elem: 0.25
Spaghetti Demon    890    Elem: 0.4
Spirit of New Wave (Volcanic Cave)    886    Elem: 0.25
Sssshhsssblllrrggghsssssggggrrgglsssshhssslblgl    2012    Elem: 0.5
Stella, the Demonic Turtle Poacher    889    Elem: 0.4
Stella, the Turtle Poacher (Volcanic Cave)    883    Elem: 0.25
strong wind    2130    Elem: 1
swarm of fire ants    461    Group: 20
swarm of fudgewasps    1144    Group: 3
swarm of ghuol whelps    1072    Group: 15
swarm of killer bees    221    Group: 6
swarm of Knob lice    1059    Group: 100
swarm of lowercase As    935    Group: 6
swarm of scarab beatles    456    Group: 4
The Avatar of Boris    1339    Elem: 0.5
topiary duck    1711    Elem: 0.75
Troll Twins    1244    Group: 2
Twig and Berries    352    Group: 3
wall of bones    1708    Group: 100
War Hippy Dread Squad    410    Group: 2
Witchess Ox    1937    Elem: 0.5
Witchess Queen    1939    Elem: 0.5
Witchess Witch    1941    Elem: 0.75
zombie waltzers    401    Group: 2
 

ckb

Active member
I still think it would be nice to have the consistency of adding this information to Mafia, mostly given that physical_resistance is already tracked.
A Lot of monster information is currently embedded in monsters.txt, and adding these two other factors seems like it is in line with what the mafia data files offers rather than embedded in an additional script.

I'll reformat my data dump a bit better to match the exact format of monsters.txt if that will help
 

gausie

D̰͕̝͚̤̥̙̐̇̑͗̒e͍͔͎͈͔ͥ̉̔̅́̈l̠̪̜͓̲ͧ̍̈́͛v̻̾ͤe͗̃ͥ̐̊ͬp̔͒ͪ
Staff member
I at the very least agree that group size should be in mafia
 

Veracity

Developer
Staff member
Here is my monster initial data:

Code:
Monster Name    id    Attrib
bee swarm    1079    Group: 3
bee thoven    1081    Group: 3
beebee gunners    1077    Group: 3
beebee queue    1080    Group: 2
big swarm of ghuol whelps    1073    Group: 15
Big Wheelin' Twins    1241    Group: 2
Blue Oyster cultist    1528    Elem: 0.75
Bubblemint Twins    1240    Group: 2
bunch of drunken rats    995    Group: 3
Chef Boy, R&D    1466    Elem: 0.5
clan of cave bars    1162    Group: 10
Clancy    1338    Elem: 0.25
cloud of disembodied whiskers    226    Group: 20
cow cultist    1902    Elem: if (to_int(get_property("lttQuestDifficulty"))==2) { eres = 0.75; } if (to_int(get_property("lttQuestDifficulty"))==3) { eres = 1.00; }
Demon of New Wave    892    Elem: 0.4
Deputy Nick Soames & Earl    1220    Group: 2
drippy bat    2163    Elem: 1
drippy reveler    2176    Elem: 1
drippy tree    2162    Elem: 1
Eldritch Tentacle    1974    Elem: 0.5
eXtreme Sports Orcs    336    Group: 2
Family Jewels    180    Group: 2
family of kobolds    1101    Group: 100
flock of seagulls    699    Group: 2
Flock of Stab-bats    133    Group: 4
giant swarm of ghuol whelps    1074    Group: 45
God Lobster    2088    Elem: if (have_equipped($item[God Lobster's Ring])) { Phys = 0.30; } if (have_equipped($item[God Lobster's Rod])) { Phys = 0.50; eres = 0.25; } if (have_equipped($item[God Lobster's Robe])) { Phys = 0.60; eres = 0.60; } if (have_equipped($item[God Lobster's Crown])) { Phys = 0.80; eres = 0.90; }
Gorgolok, the Demonic Hellseal    888    Elem: 0.4
Gorgolok, the Infernal Seal (Volcanic Cave)    882    Elem: 0.25
group of cultists    828    Group: 3
guy with a pitchfork, and his wife    394    Group: 2
Herald of Fridgr    2197    Elem: 1
Irritating Series of Random Encounters    167    Group: 20
Jeff the Fancy Skeleton    1917    Elem: 0.7
LOV Enforcer    2009    Elem: 0.25
LOV Engineer    2010    Elem: 0.75
LOV Equivocator    2011    Elem: 0.5
Lumpy, the Demonic Sauceblob    891    Elem: 0.4
Lumpy, the Sinister Sauceblob (Volcanic Cave)    885    Elem: 0.25
mad bugbears    257    Group: 3
Mismatched Twins    1242    Group: 2
moister oyster    1371    Elem: 0.25
moomy    1916    Elem: if (to_int(get_property("lttQuestDifficulty"))==2) { eres = 0.50; } if (to_int(get_property("lttQuestDifficulty"))==3) { eres = 0.75; }
oil baron    1237    Elem: 0.5
oil cartel    1238    Elem: 0.25 Group: 3
oil tycoon    1236    Elem: 0.25
pygmy assault squad    448    Group: 2
rag-tag band of survivors    1225    Group: 4
restless ghost    1906    Elem: if (to_int(get_property("lttQuestDifficulty"))==2) { eres = 0.50; } if (to_int(get_property("lttQuestDifficulty"))==3) { eres = 0.75; }
school of many    1374    Group: 20
school of wizardfish    717    Group: 4
Shub-Jigguwatt, Elder God of Violence    1377    Elem: 0.95
Somerset Lopez, Demon Mariachi    893    Elem: 0.4
Somerset Lopez, Dread Mariachi (Volcanic Cave)    887    Elem: 0.25
Spaghetti Demon    890    Elem: 0.4
Spirit of New Wave (Volcanic Cave)    886    Elem: 0.25
Sssshhsssblllrrggghsssssggggrrgglsssshhssslblgl    2012    Elem: 0.5
Stella, the Demonic Turtle Poacher    889    Elem: 0.4
Stella, the Turtle Poacher (Volcanic Cave)    883    Elem: 0.25
strong wind    2130    Elem: 1
swarm of fire ants    461    Group: 20
swarm of fudgewasps    1144    Group: 3
swarm of ghuol whelps    1072    Group: 15
swarm of killer bees    221    Group: 6
swarm of Knob lice    1059    Group: 100
swarm of lowercase As    935    Group: 6
swarm of scarab beatles    456    Group: 4
The Avatar of Boris    1339    Elem: 0.5
topiary duck    1711    Elem: 0.75
Troll Twins    1244    Group: 2
Twig and Berries    352    Group: 3
wall of bones    1708    Group: 100
War Hippy Dread Squad    410    Group: 2
Witchess Ox    1937    Elem: 0.5
Witchess Queen    1939    Elem: 0.5
Witchess Witch    1941    Elem: 0.75
zombie waltzers    401    Group: 2
Physical Resistance is currently a percentage - from 0 to 100 - and is not set up to have an expression.
Looks like Elemental Resistance will also need to be an Expression.
 

ckb

Active member
@Veracity - I should totally be able to figure out how to submit a PR for this but I can't seem to get it right.
I do have an updated monsters.txt attached if you want to review and run it thought your “test fix-monster-attributes”
Thanks.
 

Attachments

  • monsters.txt
    344.2 KB · Views: 1

Veracity

Developer
Staff member

ckb

Active member
For everyone here - I am reasonably confident of the numbers for Group and Elem and Phys, but I have not done an exhaustive game test because that requires more time and data than I have. This has been lightly tested and any corrections or feedback is appreciated.

@zarqon - not sure if you want to modify batfactors to use this data instead of your own. Some of it was pulled from there, some from the wiki, some from other spading.
 

zarqon

Well-known member
@ckb: Thanks for the heads up -- I'll have a look at it and probably remove redundant data and modify BatBrain to use mafia's but prefer its own where specified.
 

zarqon

Well-known member
So, today I whipped up this little relay diff tool to see the differences between batfactors and mafia's data for resistances, and there are quite a few differences. (requires CLI Links and, of course, BatBrain) [edit: updated file attached two posts below]

I'm starting to slowly look through the differences and edit batfactors, but it also appears that mafia's resistance data is still incomplete.

I've updated BatBrain to use mafia's new group size information and will be removing that duplicated info from batfactors (although support for the keyword still exists), but as the other data still needs to be fleshed out I'm not yet moving BatBrain over to use mafia's elemental resistance data (it has been using mafia's physical resistance data for a long time, though, which is why in the attached relay script, differences in only physical resistance are not highlighted as 'different').

@ckb
 
Last edited:

ckb

Active member
Thanks @zarqon - I will review this and compare missing data to the wiki and work on a update to monsters.txt for updated Elem and Phys resistances.

I will also note that this Mafia system only allows for those two types of resistance, without a modifier for a single element type, so a monster like [Astrologer of Shub-Jigguwatt] who can only be harmed by cold will not have a good way to be represented.
 

zarqon

Well-known member
@ckb, I saw your recent commit which added a bunch more monster resistance data. Excellent. So now, of the 37 data mismatches between mafia and batfactors, about half are missing from batfactors, and a good portion of the remainder are due to asymmetrical elemental resistance which can't be specified using mafia's format. The remaining handful of differences can be accounted for thusly:

I believe monsters 2196-2200 (the cargo summons) should all have 100% physical resistance. As you mentioned before, their elemental resistance cannot be correctly specified in mafia's format, but we can at least specify the physical part.

[692] spooky hobo should have 100% elemental resistance. The Wiki notes that all elemental damage is reduced to 1.

From the Wiki page for the Unkillable Skeleton (Hard Mode): "The Unkillable Skeleton seems to have 50% physical and 95% elemental damage reduction (needs spading)." On the non-Hard version it simply says "Elemental damage is drastically reduced." Previously batfactors had 50% across the board for both versions, but I'm happy to use the above numbers given that better numbers aren't likely to come along if they haven't by now.

Others to be confirmed:
  • Clara
  • Granny Hackleton
  • trendy bugbear chef

Though batfactors lists at least 50% elemental resistance for these, I suspect it may be in the wrong for these three.

I think I can now instruct BatBrain to use mafia's elemental resistance data, and start removing now-redundant data from batfactors. Yay!

Note: updated ElemDiff to sort by monster ID and be able hide data matches, attached below.
 

Attachments

  • relay_ElemDiff.ash
    2.3 KB · Views: 2
Last edited:

Veracity

Developer
Staff member
Interesting.

The Cargo monsters are "Immune to all damage except ELEMENT"
swamp troll is "Immune to all damage except Hot"
KoLmafia has no support for that.

Oil Peak monsters resist X% of all elemental damage - but also, because they are sleaze, take double damage from cold and spooky.
That is accurately expressed as "ED: sleaze Elem: X"

blazing bat, "takes 1 damage from all damage that isn't cold".
Ditto for "Servant of Lord Flameface".
That is the same as 100% resistance, right? Monster Resistance says so.

What if we had, say, "EV: hot", which means "Phys" and "Elem" resistance does not apply to a (some?) elements.
Not the same as "ED", which doubles damage of the two opposing elements - and then reduces by resistances.
 

zarqon

Well-known member
Two more notes:
  1. Mafia has the [1183]angry cavebugbear as having 25% physical resistance, while the Wiki says "Resists elemental damage (needs spading) but not physical damage."
  2. The [1238]oil cartel should have 75% elemental resistance, not 25%.

@Veracity: If that monster properties leak from years back is still relevant, KoL uses physresist, 5 x <individual element>resist, and elementalresist properties to represent monster resistances. I'm not sure whether there are any monsters that have both elementalresist and one or more individual elements specified, or how those would stack, but that's how KoL is representing it. At the moment it looks like mafia now has 2 of 7 (a big step up from 1). BatBrain was always using individual resistance per element, but nothing for pan-elemental resistance; now that we're using mafia's data as a start point we effectively have the full 7. Yay!

So I personally could take or leave your suggestion, but that's because I already have a solution to the issue in place. On principle I do like the idea of mafia's knowledge being more complete though -- or at least the existence of a framework allowing for such completeness.
 

ckb

Active member
PR Submitted for the updated Elem and Phys values by Zarqon

FWIW, I don't see the need to include special handling for "Immune to all damage except Element" or such. There are only a few monsters that qualify and those likely need special handling anyway, so I am fine without Mafia support for that beyond what we currently have.
 
Top