Autogenerated Map Set

picklish

Member
Edit 2006-08-13: Now includes familar equipment and weights. Also, updated my wiki cache so some values have changed. Goat cheese tacos are not a 1 fullness/4 adventure food. :p)

Edit 2006-08-14: Trademarks now stripped, so should work in Windows.

Now that we all have the altogether nifty file_to_map and map_to_file commands, the only thing missing is a decent set of maps to load. The advantage to using maps is not just because it's faster than adding them in manually, but that you can switch out the maps when items get updated and your scripts keep working, becuase they don't reference items directly.

Combining the forces of the wiki and some rogue perl scripts, I concocted a set of map files which I've attached to this message. You can blow out the zip file over your current mafia installation to populate the data directory with the maps. It comes with a test script that loads all the maps. If you unzip the file in the right place, load up mafia, call testMaps.ash, and you see "everything ok" and no pages and pages of Java stacktraces, then you're good to go.

The files are all named something like "$effect_by_$itemtype.map". You can load them as either float[item] or int[item] maps except in two cases. Anything involving adventures and consumables should only be used via float[item] maps and anything involving familiars should be used via a familiar[item] map. Here's a quick example of how you might use this:
Code:
void main()
{
  # Put on the hat that gives the most rollover adventures (naive)...
  int[item] rollover_by_hat;
  file_to_map("rollover_by_hat.map", rollover_by_hat);

  # find best
  int max = 0;
  item best;
  foreach hat in rollover_by_hat
  {
    if (item_amount(hat) > 0 && rollover_by_hat[hat] > max)
    {
      max = rollover_by_hat[hat];
      best = hat;
    }
  }

  if (max != 0)
  {
    print("Best hat found: " + best);
    equip(best);
  }
  else
  {
    print("No hats found that give extra adventures.");
  }
}

Other ideas are left as an exercise to the reader...;)

Item Effects:
Here is a list of the shorthand item effects that you will find in the map filenames and what the mapping corresponds to. These effects already include intrinsic effects (like complete delusion) that you get when wearing the equipment.
mox => amount of moxie added when equipped
moxpercent => percent of moxie added when equipped
moxreq => amount of moxie required to equip
mys => amount of mysticality added when equipped
myspercent => percent of mysticality added when equipped
mysreq => amount of mysticality required to equip
mus => amount of muscle added when equipped
muspercent => percent of muscle added when equipped
musreq => amount of muscle required to equip
meatpercent => percentage increase to meat drops
itempercent => percentage increase to item drops
initiative => percentage increase to initiative
spelldamage => extra spell damage when equipped
rollover => extra adventures at rollover when equipped
hands => hands required to wield (1, 2, or 3)
power => weapon/armor power
extrastats => extra stat points when equipped
meleedamage => extra melee damage when equipped
hp => extra HP when equipped
mp => extra MP when equipped
ml => extra monster level when equipped
skillcost => change to cost of skills when equipped (numbers are negative)
sellprice => autosell price
weight => change in familiar weight when equipping
familiar => the only familiar that can equip this. If any familiar can equip an item, it will not be in this map. (reminder: use a familiar[item] map for anything involving this)

Food Effects
fullness => fullness gained when consuming this item
drunkness => drunkenness gained when consuming this item
spleen => spleenliness gained when consuming this item
adventures => average adventures gained when consuming this item (reminder: use a float[item] map for anything involving this effect)

Item Types:
Item types should be self explanatory. The "equip" category is all equipment. The "weapon" category is all weapons (melee or ranged). The "armor" category is anything you can wear that's not a weapon. The "item" category is everything. The "famequip" category is equipment for your familiars.

Finally, if somebody has a place this archive could live permanently and that I could automate an update to via ftp or somesuch, I can keep these up to date for everyone as new items are added.
 

Attachments

  • mafiaMaps.tar.gz
    40.1 KB · Views: 73

peterbones

New member
First, let me say that you are a warm hearted human being; these be very useful.  And I've started to use them, for instance in calculating XP gains using the ml_by_equip and such (see http://kolmafia.us/index.php/topic,344.msg1883.html#msg1883).  A couple of things that would make them even more useful:

1. Familiar equipment in XXXXX_by_equip.  I don't know if it's not there by design, but it means that for instance the annoying pitchfork has to be coded separately when calculating monster level.

2. Familiar weights (+X lbs) map.  Probably useful for many things.

3. Effects/Skills maps.  If I want to figure out how to maximize my moxie, for instance, I want to figure out not only what to wear but what skills to cast, and I need to know what effects I have that influence moxie.

4. Effect to Item/Skill & vice versa.  I know we already have the skill_to_effect & vice versa, but no item to effect.  Could even have an equipment to effect for intrinsics.

5. Outfit to whatever.   Probably wouldn't be used as much, but I can imagine where it would come up.

Anyway, humble suggestions from someone who is not a rogue perl coder.  As a not so humble suggestion, may I suggest that having picklish's maps and others like those I suggest come with mafia would not only encourage people to start using maps and allow for reusable code (since everyone would use the same maps for these things), but it would keep the devs from having to add functionality like skill_to_effect (which could actually just be rewritten as a wrapper around a map).

If you want my hand generated (well, copied from the wiki and reformatted) maps, you can go to the post linked above. It has the following in a zip file.

familiar_weight_by_item -> If equipped gives +X lbs of familiar. All equipment, including hats, acc, familiar equipment.
familiar_weight_by_effect -> If you have this effect, you have +X lbs of familiar.
extrastats_by_effect -> like extrastats_by_equip, but with effects
ml_by_effect -> like ml_by_equip, but with effects
 

picklish

Member
In answer, the contents were chosen because I already had the parsing infrastructure to parse all available items, which is why there aren't any effects, skills, outfits, or familiars. ;)

1) Yeah, I forgot to include familiar equipment as a part of equipment. I can add familiar weight as well when I do that.

2) familiar_weight_by_item makes sense. I assume that would need to be paired with some way to determine which items go with which familiars? A familiarequipment_by_familiar map, I'd guess?

4) I guess I wasn't clear about this, but intrinsic effects are included in the above maps (since in my mind they're just a way to add enchantments to items with some more flavor.)

I think the skills ones would be useful, but skills don't change very frequently and there aren't that many of them that you have to consider at any given time. I'll add the familiar equipment and weight related maps (and reply again when that's done and the zip file is updated). I'll leave the skills and effects maps to somebody else who wants to take that on.

Edit: added familiar equipment, familiar weights, and a familiar by familiar equipment map which includes only familiar equipment that can be worn by one familiar. Zip file above has been modified.
 

peterbones

New member
Thanks much.

As for the effects, while it's true that skills are relatively fixed, items that give effects aren't. And there are many more effects from items than from skills. Anyway, it's not something that I would use right now, especially if mafia starts giving us +ML and whatnot, but just something I thought someone might like in the future.
 

asturia

Minion
just a question: when I run your script: it gives me the following error:
Invalid line in data file:
Frostâ„¢ brand sword 3. Debug log printed.

apparently it doesn't recognize the "tm" symbol in the maps you have posted.
Maybe it is just me, but I just noticed this.
 

picklish

Member
Ah, I see your problem. You're probably using Windows? Since KoLmafia handles item names sans trademark, I'll just strip them. Let me know if the new zip file works for you. :)
 
Top