Difference between revisions of "Polypiling"

From NetHackWiki
Jump to navigation Jump to search
(When Not to Polypile: Added the giant stack of rocks technique.)
(Opps wrote that wrong. Sorry. Also elaborated on strategy.)
Line 21: Line 21:
 
The polymorph [[beam]] generated by the wand and spell acts on each pile separately.<ref>{{sourcecode|zap.c|2744}} (bhit calls bhitpile for each square/pile)</ref>  
 
The polymorph [[beam]] generated by the wand and spell acts on each pile separately.<ref>{{sourcecode|zap.c|2744}} (bhit calls bhitpile for each square/pile)</ref>  
  
First, there is a chance for each item stack on the pile to "shudder" (undergo a [[system shock]]).<ref>{{sourcecode|zap.c|1733}} (bhitpile goes through each stack separately, calling bhito--to which a function pointer has been passed in as fhito--to perform the actual polymorph)</ref><ref>{{sourcecode|zap.c|1515}} (bhito calls object_shudders on just one object, and object_shudders does not inspect other items on the square, i.e. in the pile)</ref>
+
First, there is a chance for each item stack in the pile to resist. See below for details.
 +
 
 +
Then, there is a chance for each item stack that did not resist to "shudder" (undergo a [[system shock]]).<ref>{{sourcecode|zap.c|1733}} (bhitpile goes through each stack separately, calling bhito--to which a function pointer has been passed in as fhito--to perform the actual polymorph)</ref><ref>{{sourcecode|zap.c|1515}} (bhito calls object_shudders on just one object, and object_shudders does not inspect other items on the square, i.e. in the pile)</ref>
  
 
The probability of an item stack undergoing [[system shock]] depends on its [[BUC status]], unless it is a [[wand]]:<ref>{{function|zap.c|object_shudders}} (obj_shutters determines whether a given stack will shudder.)</ref>
 
The probability of an item stack undergoing [[system shock]] depends on its [[BUC status]], unless it is a [[wand]]:<ref>{{function|zap.c|object_shudders}} (obj_shutters determines whether a given stack will shudder.)</ref>
Line 46: Line 48:
 
The golem will attempt to absorb a number of individual items (not item stacks, "4 scrolls" counts for 4, not 1), equal to its weight.<ref>{{sourcecode|zap.c|1140}} (mons[pm_index] is a permonst structure, defined in permonst.h, the cwt field is the weight of the monsters corpse, which is defined for golems even though they leave no corpses.)</ref><ref>{{sourcecode|zap.c|1035}} (polyuse doesn't stop absorbing items until minwt is 0, minwt is initialized to golem corpse weight)</ref><ref>{{sourcecode|zap.c|1054}} (not that polyuse is subtracting the QUANTITY of objects from minwt, not the WEIGHT of those objects. iron golems will absorb up to 2000 iron items)</ref> Only items that are made of the same material as the item stack who's shuddering cause the golem to form are eligible for absorption. E.g., if a mithril coat shudders and results in an iron golem, that iron golem will absorb other mithril items on the pile, but leave iron items untouched. Each eligible item stack has a 1 in (golem weight + 1) chance to avoid being absorbed. Note that, given the high weights of golems, 400 for straw and paper up to 2000 for iron, it is highly unlikely that ANY eligible item will survive this process. Also note that this absorption occurs after the items have been polymorphed. If a mithril item shudders, creating an iron golem, and several other mithril objects on the pile are polymorphed into other materials, e.g. leather coats or iron helmets, they will NOT be absorbed, though any leather coats or iron helmets polymorphed into mithril items WILL be absorbed. <ref>{{sourcecode|zap.c|1043}} (which items are eligible for absorption; note that "mat" is the material of the shuddered item stack NOT of the golem created)</ref>
 
The golem will attempt to absorb a number of individual items (not item stacks, "4 scrolls" counts for 4, not 1), equal to its weight.<ref>{{sourcecode|zap.c|1140}} (mons[pm_index] is a permonst structure, defined in permonst.h, the cwt field is the weight of the monsters corpse, which is defined for golems even though they leave no corpses.)</ref><ref>{{sourcecode|zap.c|1035}} (polyuse doesn't stop absorbing items until minwt is 0, minwt is initialized to golem corpse weight)</ref><ref>{{sourcecode|zap.c|1054}} (not that polyuse is subtracting the QUANTITY of objects from minwt, not the WEIGHT of those objects. iron golems will absorb up to 2000 iron items)</ref> Only items that are made of the same material as the item stack who's shuddering cause the golem to form are eligible for absorption. E.g., if a mithril coat shudders and results in an iron golem, that iron golem will absorb other mithril items on the pile, but leave iron items untouched. Each eligible item stack has a 1 in (golem weight + 1) chance to avoid being absorbed. Note that, given the high weights of golems, 400 for straw and paper up to 2000 for iron, it is highly unlikely that ANY eligible item will survive this process. Also note that this absorption occurs after the items have been polymorphed. If a mithril item shudders, creating an iron golem, and several other mithril objects on the pile are polymorphed into other materials, e.g. leather coats or iron helmets, they will NOT be absorbed, though any leather coats or iron helmets polymorphed into mithril items WILL be absorbed. <ref>{{sourcecode|zap.c|1043}} (which items are eligible for absorption; note that "mat" is the material of the shuddered item stack NOT of the golem created)</ref>
  
Since each stack in a pile is polymorphed separately, from the most recently dropped item out to the item dropped longest ago, and the type of golem is determined by the material of the first item stack to shudder and result in golem creation, you can influence what material the golem is made of. The most recently dropped items are more likely to be the ones to decide golem material choice. If you want paper golems instead of iron golems, drop the iron items first, and then the paper items last. Since paper golems drop the most useful material--paper--and iron golems drop worthless iron chains, it's probably a good idea to do this. In fact, it is even better to add several stacks of rocks on top, causing the creation of a clay golem instead and conserving all your other items, because rocks are generally overabundant.<ref>{{sourcecode|zap.c|1160}} (once NetHack decides to create a golem it records the shuddering stack's material and stops trying to create golems for additional stacks.)</ref><ref>{{sourcecode|zap.c|1733}} (bhitpile goes through objects forwards through the list)</ref><ref>{{sourcecode|mkobj.c|1115}} (place_object adds dropped objects to the front of the list, where bhitpile will encounter them first.)</ref>
+
Since each stack in a pile is polymorphed separately, from the most recently dropped item out to the item dropped longest ago, and the type of golem is determined by the material of the first item stack to shudder and result in golem creation. This is exploitable: [[polypiling#stacking_strategy#one_large_pile|see below.]] <ref>{{sourcecode|zap.c|1160}} (once NetHack decides to create a golem it records the shuddering stack's material and stops trying to create golems for additional stacks.)</ref><ref>{{sourcecode|zap.c|1733}} (bhitpile goes through objects forwards through the list)</ref><ref>{{sourcecode|mkobj.c|1115}} (place_object adds dropped objects to the front of the list, where bhitpile will encounter them first.)</ref>
  
 
This process, from the start of this section of the page, is repeated for each pile hit by the beam.
 
This process, from the start of this section of the page, is repeated for each pile hit by the beam.
Line 60: Line 62:
 
** Reducing the number of item stacks on the pile, reducing the number of opportunities for golems to form.
 
** Reducing the number of item stacks on the pile, reducing the number of opportunities for golems to form.
 
** Limiting the number of items on the pile that are made of the same material, reducing the number of items a forming golem can absorb.
 
** Limiting the number of items on the pile that are made of the same material, reducing the number of items a forming golem can absorb.
*** In particular, the items on the top of the pile, the ones you drop last, should be a different material than the most valuable items in the pile. Potential golems will likely be made out of the material of the top items, not the material of the valuable items. Thus the valuable items will survive while the cheaper ones are destroyed.
+
*** In particular, the items on the top of the pile, the ones you drop last, should be a different material than the most valuable items in the pile. Potential golems will likely be made out of the material of the top items, not the material of the valuable items. Thus the valuable items will survive while the cheaper ones are destroyed. See [[polypiling#stacking_strategies#one_large_pile|below]] for details.
  
 
== Probability of item transformation ==
 
== Probability of item transformation ==
Line 105: Line 107:
 
* Never handle both polyfodder and items you want to keep in your main inventory at the same time, and never ever drop anything useful on your polypile line. People have wondered where their [[bag of holding]] with all the artifacts went.
 
* Never handle both polyfodder and items you want to keep in your main inventory at the same time, and never ever drop anything useful on your polypile line. People have wondered where their [[bag of holding]] with all the artifacts went.
 
* Even if you do not care about polyfodder loss, #name rocks to get stacks of at most four. There is a limit to how many gems can be created.
 
* Even if you do not care about polyfodder loss, #name rocks to get stacks of at most four. There is a limit to how many gems can be created.
* Max out your [[Luck]] to minimize golem creation. That reduces the total material lost. This is particular useful for larger stacks and piles, where any golem will do comparatively more damage.
+
* Max out your [[Luck]] to minimize golem creation. That reduces the total material lost. This is particular useful for larger stacks and piles, where any golem will do comparatively more damage. Do not max your luck if using the [[polypiling#stacking_strategy#seven_small_piles|below]].
 
* Configure [[autopickup exception]]s to pick up good morphs and your want-to-keeps from the pile.
 
* Configure [[autopickup exception]]s to pick up good morphs and your want-to-keeps from the pile.
 
* Polypile your items near a [[general store]] to help identify good morphs. Be very careful of polypiling in a store: the shopkeeper will attack you if any of his/her items are polymorphed, not just ask you to pay for the item.
 
* Polypile your items near a [[general store]] to help identify good morphs. Be very careful of polypiling in a store: the shopkeeper will attack you if any of his/her items are polymorphed, not just ask you to pay for the item.
Line 159: Line 161:
 
* Items not generated randomly aren't available from polypiling, e.g. [[athame]]s.
 
* Items not generated randomly aren't available from polypiling, e.g. [[athame]]s.
  
After these preparations, individually name stackables to separate them. This minimizes the chances of merging and shuddering. Now make seven piles in a straight line, each pile containing a good mix of different types of material. This minimizes the chances of a golem forming and reduces the damage a golem can do if it does form. These piles can be polymorphed in one zap. If you only have a limited number of polymorphs, such as from a wand, you could add more items, but you probably want to wait for the spell.
 
  
An alternate method which exploits the specifics of the polypiling algorithm: start out in the same way--individually name stackables to separate them. This minimizes the chances of merging and shuddering. Now put ALL of the stacks in one large pile. Top it off with a giant stack of rocks. Make sure you drop the giant stack of rocks LAST, so it's on the TOP of the pile. If you need to adjust the items then pick the rocks back up and drop them again after you have done so. With a large enough stack of rocks it is likely that the rocks will shudder and form a stone golem, which will absorb all of the rocks but leave the rest of the pile untouched. This maximizes the chances of one particular type of golem, and minimizes the damage the golem can do. This technique requires less micromanagement than the 7 pile technique, and ensures that every polymorph zap hits every item. (The beam may not be long enough to hit the last 4 piles in the 7 pile line.) Beware the long tail! If a stone golem doesn't form from the rocks then there is a good chance a golem WILL form from another material, possibly doing a lot of damage.
+
=Stacking strategies=
 +
 
 +
==Seven small piles==
 +
 
 +
===Step by Step===
 +
* Maximize your luck. (+13 is best.)
 +
* Collect your items. See the section above to decide what to polypile.
 +
* Individually name stackables to separate them. Separating them all the way into stacks of just one single item is best, but just getting them into stacks of four or fewer is almost as good.
 +
* Distribute the item stacks over seven small piles in a straight line, each pile containing a good mix of different types of material. Put the items you want polymorphed most at the front of the line. (First three piles are guaranteed, each of the four piles after that is progressively less likely.)
 +
* Zap polymorph.
 +
* Review results.
 +
* Repeat.
 +
 
 +
===Explanation===
 +
Separating your stackables minimizes the chances of merging and shuddering.
 +
 
 +
Maximizing your luck minimizes the chances of golems forming.
 +
 
 +
Distributing yours item stacks over 7 squares minimizes the damage a forming golem can do, because a golem can only absorb items from the square it forms on.
 +
 
 +
Ensuring a good mix of different materials also minimizes the damage a forming golem can do, because the golem can only absorb items that are made of the same material as the shuddered item that led to it's formation.
 +
 
 +
==One large pile==
 +
===Step by step===
 +
* Minimize your luck. (0 is good, -13 is better!)
 +
* Collect your items. See the section above to decide what to polypile, but avoid items made of [[mineral]]. The number of [[wand]]s and [[ring]]s destroyed by this method will be slightly greater than the number destroyed by the seven small piles method. If you are polypiling in order to get a [[mineral]] based item, do NOT use this method.
 +
* Individually name stackables to separate them. Separating them all the way into stacks of just one single item is best, but just getting them into stacks of four or fewer is almost as good.
 +
* Put every item stack in one large pile.
 +
* Obtain a very large number of rocks.
 +
* Curse the rocks.
 +
* Individually name the rocks to break them into small stacks. Five rocks per stack is best, get as close to that as your patience allows. Do not make stacks smaller than five.
 +
* Drop all the rocks on top of the item pile. MAKE SURE YOU DROP THE ROCKS AFTER THE ITEMS SO THEY ARE ON TOP.
 +
* Zap polymorph.
 +
* Kill the stone golem.
 +
* Review results.
 +
* Repeat.
 +
 
 +
You WANT a stone golem to form from those rocks, because it will prevent other types of golems from forming and damaging your valuable polyfodder. Assuming cursed rocks in stacks of 5: 50 rocks is approximately a 50% chance of a stone golem, 200 rocks is approximately a 95% chance of a stone golem, and 500 rocks is approximately a 99% chance of a stone golem.
 +
 
 +
A [[rubber chicken]] and a [[pick-axe]] are quite helpful here.
 +
 
 +
===Explanation===
 +
This method exploits the specifics of the polypiling algorithm.
 +
 
 +
Separating your stackables minimizes the chances of merging and shuddering. The only threat to deal with now is golem absorption.
 +
 
 +
Ordinarily putting every item stack on one pile would be a terrible idea, because any forming golem would have access to every item you were polypiling. However, in this strategy we ensure that the golem won't be able to absorb anything useful, by manipulating the material it is made of. A golem can only absorb items made of the same material it is. An iron golem generated from shuddering mithril can only absorb other mithril items. A wood golem generated from shuddering wood can only absorb other wood items. And--most importantly in this case--a stone golem generated from a shuddering [[mineral]] item can only absorb other [[mineral]] items.
 +
 
 +
Only one golem can be generated from a pile, and the first item stack to shudder and lead to golem formation gets to decide the material. By putting the rocks on top we ensure that they get processed first.
 +
 
 +
Cursing the rocks increases the chances that they will shudder.
 +
 
 +
Keeping the rocks in stacks of more than 4 (5 in this case) also increases this chance.
 +
 
 +
Minimizing our luck increases the chances that our rocks will give rise to a golem once they shudder.
 +
 
 +
The probability of an individual stack giving rise to a golem, IF it shudders, is (1 - (([[luck]] + 44)/([[luck]] + 45))^(stack size)). The probability of the stack shuddering is 2/3 for stacks of 5 or more cursed rocks, this is the highest chance we can get. Thus the probability of a stack both shuddering AND forming a golem is 2/3 * (1 - (([[luck]] + 44)/([[luck]] + 45))^(stack size)). If every stack of rocks in a pile is identical (all contain 5 cursed rocks), then the chance of at least one of them shuddering and giving rise to a golem is 1 - ((([[luck]] + 44) / ([[luck]] + 45))^(number of rocks total) * (2/3)^(number of stacks)). Thus we want our stacks to be as small as possible, so that we can have as many as possible, WITHOUT having less than 5 rocks per stack.
 +
 
 +
For the most part, there items made from mineral you might be interested in polypiling for. The exceptions are one type of wand and three types of rings. The material an item is made for can change when it is polymorphed, and it is the final material that matters for golem absorption. Since any polymorphed wand or ring could end up being one of the mineral ones, the effect is that this technique will consume slighty more wands and rings than the other technique.
 +
 
 +
There is a 5% chance of a normal item resisting polymorph and reaching this point unchanged, so the initial material matters some what as well. If you try to polypile a figurine and it resists, it is almost guaranteed to be absorbed.
 +
 
 +
Beware the long tail! If a stone golem doesn't form from the rocks then given the large pile underneath there is a good chance a golem WILL form from another material, possibly doing a lot of damage.
  
 
== SLASH'EM ==
 
== SLASH'EM ==

Revision as of 21:50, 18 February 2012

Polypiling is the action of polymorphing a pile of items in hopes of getting some useful items as a result. Objects polypiled are often referred to as polyfodder. The polyfodder often consists of junk. Polypile comes in book, wand, and potion forms.

The spell and wand supply a beam with a random range between 6 and 13 (long enough to hit 3 to 7 piles if they are all in line and contiguous and you are adjacent to the first) so you can work on several piles at once. The potion works on one item stack at a time, the item stack you dip into it.

Polymorphed items do not change item class. Potions will always yield potions, scrolls will yield into scrolls, etc. Unicorn horns are especially popular polyfodder because they may polymorph into other magical tools for instance magic markers. Another useful thing to do if you gain polymorph in the early game is to polypile spellbooks.

When considering polypiling it is important to distinguish stacks of items, which are all of one type, e.g. "4 blessed scrolls of blank paper", from piles of items, which are all of the items on one square. The terms stack and pile will be used rigorously on this page.

Polypiling has its drawbacks. Polyfodder may be destroyed, and golems may be generated. See the next section for more details, the exact mechanics of item destruction are rather complex, but understanding them is important if you want to get the most out of your resources.

When Polymorphing wands and spellbooks, their quality degrades. A spellbook will act as if it had been read once more. If the book's combined read/polymorph-count is four or more and it is a spell you already know, you will be told that the book is too faint to read anymore; if you do not know the spell, you can read it once to learn the spell but it will become "too faint" immediately thereafter. The only way to "cure" spellbooks too faint to be read anymore is to write a new spell on them with a magic marker.

Likewise, a wand may count as if it had been recharged, increasing the chance of an explosion if you attempt to recharge it; thus, it is not generally worthwhile to polypile empty wands, even if they become something worth charging, the chances of the new wand exploding instead of charging are already higher than normal. The chance of a wand's charge counter being incremented by polymorphing it is x/7 where x is number of the times the wand has been recharged[1]

The recharge count of tools is not affected by polymorphing them, unless the tool becomes a magic markers, in which case its charge counter will be set to 1.

Polypiling items that belong to a shopkeeper can anger the shopkeeper.

Probability of item loss and golem generation for wand and spell

The polymorph beam generated by the wand and spell acts on each pile separately.[2]

First, there is a chance for each item stack in the pile to resist. See below for details.

Then, there is a chance for each item stack that did not resist to "shudder" (undergo a system shock).[3][4]

The probability of an item stack undergoing system shock depends on its BUC status, unless it is a wand:[5]

  • Wands: 1/3
  • Blessed other item: 1/12
  • Uncursed other item: 1/8
  • Cursed other item: 1/3

When a stack shudders, it loses 1d(items in stack - 1) items, except in the case of single items, which are always destroyed. Note that stacks of more than 4 items have twice the chance of shuddering.[6]

For each item stack in the pile that undergoes a system shock, there is a chance for a golem to be created. For each item in a shuddering stack (counting those items destroyed by the shock itself) there is a 1/(luck + 45) probability of creating a golem.[7] No more than one golem can be created per pile.[8] However, even after NetHack has decided to create a golem, additional stacks in the pile can shudder. A 1/(luck + 45) chance for each item in the stack gives a (1 - ((luck + 44)/(luck + 45))^(stack size)) chance of a golem forming from that stack.

If an item stack shuddered, even if some of the items that were in the stack remain, it will NOT be polymorphed. The rest of the stacks in the pile still have a chance to be polymorphed.[9][10][11][12]

For any stack that did not shudder, the polymorph process continues. There is a (number of items in stack/1000) probability that the entire stack merges into a single item.[13]

The actual polymorph is now performed. See the next section for exactly what your item stack will be turning into.

This process is repeated for each item stack in the pile.

If a golem is created from ANY stack in a pile, then that golem can absorb material (read: destroy) additional item stacks in the pile. Not that the material absorbed (destroyed) by the golem is SEPARATE from that destroyed by the original system shock(s). If, after every stack has been polymorphed, zero or one item remains in the pile (due perhaps to bad system shocks), golem creation is aborted, if it had been planned at all. According to a comment in the source "no golems if you zap only one object -- not enough stuff", though note that the comment isn't entirely accurate. It's possible to zap several items, reach this point in the code, and have the material check fail because all or all but one of the items were destroyed by system shocks.[14]

The golem will attempt to absorb a number of individual items (not item stacks, "4 scrolls" counts for 4, not 1), equal to its weight.[15][16][17] Only items that are made of the same material as the item stack who's shuddering cause the golem to form are eligible for absorption. E.g., if a mithril coat shudders and results in an iron golem, that iron golem will absorb other mithril items on the pile, but leave iron items untouched. Each eligible item stack has a 1 in (golem weight + 1) chance to avoid being absorbed. Note that, given the high weights of golems, 400 for straw and paper up to 2000 for iron, it is highly unlikely that ANY eligible item will survive this process. Also note that this absorption occurs after the items have been polymorphed. If a mithril item shudders, creating an iron golem, and several other mithril objects on the pile are polymorphed into other materials, e.g. leather coats or iron helmets, they will NOT be absorbed, though any leather coats or iron helmets polymorphed into mithril items WILL be absorbed. [18]

Since each stack in a pile is polymorphed separately, from the most recently dropped item out to the item dropped longest ago, and the type of golem is determined by the material of the first item stack to shudder and result in golem creation. This is exploitable: see below. [19][20][21]

This process, from the start of this section of the page, is repeated for each pile hit by the beam.

The invocation artifacts and the Amulet of Yendor cannot shudder, polymorph, or be absorbed by forming golems. Normal artifacts have a 95% chance resist. If this 95% chance fails, they are polymorphed just like every other item, first undergoing a shuddering check and then, if they aren't destroyed, undergoing a polymorph to a random non-artifact weapon. Normal artifacts, however, have NO resistance to being absorbed by a forming golem. Excalibur may be mostly safe from shuddering or polymorphing atop that pile of iron junk, but if an iron golem forms it is virtually guaranteed that Excalibur will be absorbed (destroyed).[22]

In other words, there are 3 ways polyfodder can be destroyed:

  • Shuddering, which chance is decreased by blessing, polymorphing items other than wands, and keep the size of individual stacks under 4.
  • Merging, which chance is reduced by lowering the size of individual stacks.
  • Absorption into forming golems, which chance is reduced by:
    • Increasing your luck, reducing the chance of golem formation.
    • Reducing the size of the individual item stacks, reducing the chance of golem formation.
    • Reducing the number of item stacks on the pile, reducing the number of opportunities for golems to form.
    • Limiting the number of items on the pile that are made of the same material, reducing the number of items a forming golem can absorb.
      • In particular, the items on the top of the pile, the ones you drop last, should be a different material than the most valuable items in the pile. Potential golems will likely be made out of the material of the top items, not the material of the valuable items. Thus the valuable items will survive while the cheaper ones are destroyed. See below for details.

Probability of item transformation

When polymorphing a magical object, the game will try to change it into another random magical object, re-trying up to two times if the replacement would be non-magical[23]. The third item generated will be used, regardless if it is magical. The reverse is true when polymorphing a non-magical object. The upshot is that a magical object has a significantly higher probability than a non-magical object of turning into another magical object. So don't expect many magic markers from polypiling pick-axes and mirrors; you will have much better odds polypiling unicorn horns. The exceptions are potions of water, blank scrolls, blank spellbooks, and wands of nothing, all of which have a high chance of becoming more-useful items of the same type.

Class Magical -> Non-magical Non-magical -> Magical
Armour 54% 0.60%
Gem 92% negligible
Potion 1.70% 41%
Spellbook negligible 95%
Tool 60% 0.30%
Wand negligible 93%

Forbidden items

The following items cannot be produced by polymorph:

Additionally, Rider corpses and wands, potions and spellbooks of polymorph cannot be polymorphed. Artifacts have a 95% chance to resist, but can eventually be polymorphed into normal items. Stacks of more than four valuable gems will never be created. Invocation artifacts and the Amulet of Yendor cannot be polymorphed at all, nor can they be absorbed into forming golems or shuddered.

Strategy

Polypiling is often used to get ascension kit armor (and completed by wishing). Therefore, you might want to collect all those elven cloaks and boots in the game.

Polypiling is most often used by conduct players who need certain items: It can substitute for wishing, prayer/sacrifice benefits, or literacy, and it can be done relatively safely. Generated monsters offer an almost unlimited supply of polyfodder. However, polypiling is time-consuming and tedious. Generally, it is not worth it unless you are trying for conducts, or unless you are looking for many items at once.

Over preparing is the other common reason for polypiling. This goes for many first ascenders, pacifist characters who want the most protection, or even an attempt to get an absurdly high score by polypiling rocks into gems.

General Tips

  • Never handle both polyfodder and items you want to keep in your main inventory at the same time, and never ever drop anything useful on your polypile line. People have wondered where their bag of holding with all the artifacts went.
  • Even if you do not care about polyfodder loss, #name rocks to get stacks of at most four. There is a limit to how many gems can be created.
  • Max out your Luck to minimize golem creation. That reduces the total material lost. This is particular useful for larger stacks and piles, where any golem will do comparatively more damage. Do not max your luck if using the below.
  • Configure autopickup exceptions to pick up good morphs and your want-to-keeps from the pile.
  • Polypile your items near a general store to help identify good morphs. Be very careful of polypiling in a store: the shopkeeper will attack you if any of his/her items are polymorphed, not just ask you to pay for the item.
  • Familiarize yourself with the ways polyfodder is lost to determine how much risk to take on, given your available polyfodder and the amount of polypile sources you have available to you. Your patience is also a factor, perfect optimization is time consuming and tedious.

Preparing

  • To minimize loss, it is a good idea to mass-bless magical polyfodder, which is much less abundant than ordinary junk. Potions and scrolls can be cancelled so they will stack, and then dipped in holy water. Name and separate them into stacks of at most four items before polymorphing. Only armor and weapons (and wands) retain their enchantment; these should be cancelled if negative before blessing. A large stack of darts can be enchanted to +7 in one go and then polypiled individually for silver weapons or the future Excalibur etc as side benefit. Magical armor and tools tend to become non-magical rather than shuddering, so there is no point blessing them.
  • Non-stackables, such as rings, require more work to bless. Often, it is not worth the costs. The most efficient way is with a blessed, confused scroll of remove curse: In a safe location, pick up as much polyfodder as possible but carry no other uncursed items. Then confuse yourself, read a blessed scroll of remove curse, end confusion, and mass-uncurse cursed items via the spell of remove curse at a skilled level. The light blue aura boon when carefully praying on an altar or even another scroll can also uncurse your entire main inventory. This procedure yields 12.5 blessings per scroll on average.
  • Unless you will need only one read, name spellbooks individually how often you have read them, and sort them accordingly. Under each pile you intend to polymorph, engrave that number. Any nameless books after the polymorph will count as read one more time. Keep in mind how often you will have to re-read the spells you get.
  • Sort polyfodder by BUC status so you won't have to re-test after polypiling.

When to Polypile

  • If a game has been unforgiving, a good time to consider polypiling is when there are many things needed at once: the odds of getting at least one of them is improved. For example, if you're looking for a magic marker in particular, getting a tinning kit would be seen as a waste. However, if you were looking for both a magic marker and a tinning kit, the effective odds of getting something you want go up. If you're looking for a horn of plenty, a magic marker, a pair of lenses, and a tinning kit all at once, polypiling unicorn horns begins to look increasingly attractive.
  • Potions are attractive to polymorph, due to the ease of creating fruit juice and water, and mass blessing them. Furthermore, with the help of alchemy, a good third of the available potions are useful in some way. While you may not get the potion of enlightenment, or gain level, that you wanted, you are likely to end with various healing potions, levitation, etc, that can be quickly used to work towards what you really want.
  • Scrolls are commonly polymorphed for similar reasons. Here, part of the motivation is in doing away with magic markers. It adds a great deal of randomness to the mix, but scrolls are still cheaper than marker charges.
  • Magical tools. Unicorn horns are a common fodder, due to the large number of useful magical tools, and the abundance of unicorn horns. (For farmers: revived unicorns have a 5% chance of leaving another horn.) Certainly, the magic marker is generally what most would go for, but in the attempt you might find other goodies: A horn of plenty, which spawns potion you can polypile. A fire/frost horn may also be of help, as may a magic harp or magic flute. This is especially helpful to Tourists or neutral players with the PYEC.
  • Magical armor. This mostly to finish off an ascension kit, and most often using the various abundant elven equipment as fodder. This is mostly only useful to (wishless) conduct players, as the castle's guaranteed five wishes are good enough to get all the missing types of armor; furthermore, its armor stores might contain missing pieces.
  • A common trick is to polymorph elven armor, which can safely be enchanted to +7, into a +7 T-shirt. The number of +7 armors isn't terribly prohibitive: the blessed scroll of enchant armor (to get to +7) will also bless the armor and reduce the odds of shuddering.
Confidence Base Chance 25% 50% 75% 95%
Polymorphs 1 in 100 28.62 68.97 137.94 298.07
Shuddering 1 in 12 3.31 7.97 15.93 34.43
Armors needed (est.) 3.59 8.66 17.32 37.41
  • Rings. This mostly to finish off an ascension kit, and namely, to get a ring of levitation, slow digestion, or even free action if for some reason the RNG wasn't benevolent enough to give the player one. But usually you find those even before the Medusa level. Most other rings are only useful in specific situations, polypiling or not.
  • One cheesy trick is to polypile for rings of protection or increase damage, with the intention of eating them. It's possible to get a ridiculously low AC or ridiculously high damage. The former is pointless, other than to sound impressive, because you can reasonably get to -40AC without such mind-numbing busywork, and that is enough to make even a minotaur barely scrape the polish on your armor. The latter may be for Death farming to a ludicrously high score.
  • Spellbooks, if you are happy with any random book and accept you cannot re-read it. Early in the game, when you don't know many spells yet, you can get dozens of new ones out of a few spellbooks. Due to a bug in NetHack, a book will never be "too faint to be read anymore" if that adds a spell to your repository. This has proven popular among speed runners. Newbies might carry books and rings along (unencumbered) into a Minetown shop in the early game and polymorph there.
  • A large pile of junk armor. Shirts are annoyingly rare in the main dungeon, but other armors are not. Zapping a wand of polymorph at that 15 pages pile of items in Fort Ludios is probably the easiest way to get a shirt outside of wishing or playing a Tourist.

When Not to Polypile

  • Wands are generally not worth it. This is mostly because by the time the player has a serious stash of wands, and abundant means to polymorph objects (read: the spell), there is only one wand seriously worth going after: death. But this late into the game, there are only four monsters that it matters on—Pestilence, Famine, Rodney, and the High priest of Moloch. Likely (but not necessarily), you already have enough wands of death to deal with those enemies. Also, polymorped wands will more likely explode if charged again.
  • In the midgame, however, it may be worth it. If the player doesn't quite have enough items to make a full polypile line, a square of scrap wands may not make anything that you need, but it might make a wand you've yet to identify (if it has charges left). It may also be that you need a wand's special properties—for example, a wand of fire's ability to engrave a permanent Elbereth square.
  • Specific Spellbooks. If you only need one specific spellbook (or a book of polymorph to start with), there are better methods than polypiling: Wizards with sufficient Luck can write one using a magic marker. Anyone willing to do the altar work can get books from their god, especially the last few ones you do not yet know. For spells you do know, polypiling is terrible, as it takes only a few rounds of polymorph to make even previously unread books "too faint to read".
  • There are better ways to get various other items. For example, a trident, while normally quite rare, can be found in the death drop of a salamander or a horned devil. A silver saber, very desirable for twoweapon combat, can be found in the inventory of the Minetown watch, or the various captains that show up in the Castle.
  • Items not generated randomly aren't available from polypiling, e.g. athames.


Stacking strategies

Seven small piles

Step by Step

  • Maximize your luck. (+13 is best.)
  • Collect your items. See the section above to decide what to polypile.
  • Individually name stackables to separate them. Separating them all the way into stacks of just one single item is best, but just getting them into stacks of four or fewer is almost as good.
  • Distribute the item stacks over seven small piles in a straight line, each pile containing a good mix of different types of material. Put the items you want polymorphed most at the front of the line. (First three piles are guaranteed, each of the four piles after that is progressively less likely.)
  • Zap polymorph.
  • Review results.
  • Repeat.

Explanation

Separating your stackables minimizes the chances of merging and shuddering.

Maximizing your luck minimizes the chances of golems forming.

Distributing yours item stacks over 7 squares minimizes the damage a forming golem can do, because a golem can only absorb items from the square it forms on.

Ensuring a good mix of different materials also minimizes the damage a forming golem can do, because the golem can only absorb items that are made of the same material as the shuddered item that led to it's formation.

One large pile

Step by step

  • Minimize your luck. (0 is good, -13 is better!)
  • Collect your items. See the section above to decide what to polypile, but avoid items made of mineral. The number of wands and rings destroyed by this method will be slightly greater than the number destroyed by the seven small piles method. If you are polypiling in order to get a mineral based item, do NOT use this method.
  • Individually name stackables to separate them. Separating them all the way into stacks of just one single item is best, but just getting them into stacks of four or fewer is almost as good.
  • Put every item stack in one large pile.
  • Obtain a very large number of rocks.
  • Curse the rocks.
  • Individually name the rocks to break them into small stacks. Five rocks per stack is best, get as close to that as your patience allows. Do not make stacks smaller than five.
  • Drop all the rocks on top of the item pile. MAKE SURE YOU DROP THE ROCKS AFTER THE ITEMS SO THEY ARE ON TOP.
  • Zap polymorph.
  • Kill the stone golem.
  • Review results.
  • Repeat.

You WANT a stone golem to form from those rocks, because it will prevent other types of golems from forming and damaging your valuable polyfodder. Assuming cursed rocks in stacks of 5: 50 rocks is approximately a 50% chance of a stone golem, 200 rocks is approximately a 95% chance of a stone golem, and 500 rocks is approximately a 99% chance of a stone golem.

A rubber chicken and a pick-axe are quite helpful here.

Explanation

This method exploits the specifics of the polypiling algorithm.

Separating your stackables minimizes the chances of merging and shuddering. The only threat to deal with now is golem absorption.

Ordinarily putting every item stack on one pile would be a terrible idea, because any forming golem would have access to every item you were polypiling. However, in this strategy we ensure that the golem won't be able to absorb anything useful, by manipulating the material it is made of. A golem can only absorb items made of the same material it is. An iron golem generated from shuddering mithril can only absorb other mithril items. A wood golem generated from shuddering wood can only absorb other wood items. And--most importantly in this case--a stone golem generated from a shuddering mineral item can only absorb other mineral items.

Only one golem can be generated from a pile, and the first item stack to shudder and lead to golem formation gets to decide the material. By putting the rocks on top we ensure that they get processed first.

Cursing the rocks increases the chances that they will shudder.

Keeping the rocks in stacks of more than 4 (5 in this case) also increases this chance.

Minimizing our luck increases the chances that our rocks will give rise to a golem once they shudder.

The probability of an individual stack giving rise to a golem, IF it shudders, is (1 - ((luck + 44)/(luck + 45))^(stack size)). The probability of the stack shuddering is 2/3 for stacks of 5 or more cursed rocks, this is the highest chance we can get. Thus the probability of a stack both shuddering AND forming a golem is 2/3 * (1 - ((luck + 44)/(luck + 45))^(stack size)). If every stack of rocks in a pile is identical (all contain 5 cursed rocks), then the chance of at least one of them shuddering and giving rise to a golem is 1 - (((luck + 44) / (luck + 45))^(number of rocks total) * (2/3)^(number of stacks)). Thus we want our stacks to be as small as possible, so that we can have as many as possible, WITHOUT having less than 5 rocks per stack.

For the most part, there items made from mineral you might be interested in polypiling for. The exceptions are one type of wand and three types of rings. The material an item is made for can change when it is polymorphed, and it is the final material that matters for golem absorption. Since any polymorphed wand or ring could end up being one of the mineral ones, the effect is that this technique will consume slighty more wands and rings than the other technique.

There is a 5% chance of a normal item resisting polymorph and reaching this point unchanged, so the initial material matters some what as well. If you try to polypile a figurine and it resists, it is almost guaranteed to be absorbed.

Beware the long tail! If a stone golem doesn't form from the rocks then given the large pile underneath there is a good chance a golem WILL form from another material, possibly doing a lot of damage.

SLASH'EM

In SLASH'EM, polymorphed items revert back to their original form after 500–999 turns [29]. The in-game term for this, which can only be seen in wizard mode, is "hazy." Hazy items, however, can be "fixed" by dipping them in a potion of restore ability. The transmutation limits the usefulness of polypiling somewhat, as obtaining permanent items requires a commensurate supply of said potions. However, polypiling is still just as useful to obtain items that can be useful right away or relatively soon; for example, a polypiled magic marker can be immediately used to write a few scrolls, and then allowed to transmute back after it is empty. Also, one can use the transmutation property to one's advantage when polypiling magical items: if they turn into non-magical items, one can simply wait for them to revert, and try again.

Code

bhito in zap.c is the root of item polymorphs from the spell and from the wand. It is called for each stack of items a polymorph zap hits by bhitpile. First it refuses to poly polymorph sources, and allows items to resists [30]. It calls obj_shudders to check for system shocks [31] and calls do_osshock to perform them[32]. Finally bhito calls polyobj to actually transform the stack. [33].

do_osshock determines whether or not to generate a golem, and after all the stacks in the pile have been polymorphed by repeated calls to bhito, bhitpile calls create_polymon to actually generate the golem.

If create_polymon is called, it possibly creates the golem and then, if the golem was created, in turn calls polyuse to consume additional polyfodder.[34]

References

  1. Zap.c, line 1333 (rn2(recharge count) to see if polymorph increments charge counter on wands.)
  2. zap.c, line 2744 (bhit calls bhitpile for each square/pile)
  3. zap.c, line 1733 (bhitpile goes through each stack separately, calling bhito--to which a function pointer has been passed in as fhito--to perform the actual polymorph)
  4. zap.c, line 1515 (bhito calls object_shudders on just one object, and object_shudders does not inspect other items on the square, i.e. in the pile)
  5. object_shudders in zap.c (obj_shutters determines whether a given stack will shudder.)
  6. zap.c, line 1016 (object_shudders doubles shuttering chance for stacks with more than 4 items)
  7. zap.c, line 1162 (do_osshock decides whether or not it should make a golem)
  8. zap.c, line 1160 (poly_zapped is a file level static variable, visible to every function in zap.c, -1 means no golem created yet, else it contains the material of the item who's shuddering resulted in golem creation. do_osshock checks that its -1 before trying to make a golem.)
  9. zap.c, line 1519 (if the obj shuddered, bhito exits WITHOUT polymorphing the object.)
  10. splitobj in mkobj.c (If any items remained after the shuddering occurred, they will have been reinserted in the item tracking linked list, but they will have been inserted before the deleted ones, and bhitpile will not return to them.)
  11. zap.c, line 1735 (bhitpile decides the next object before bhito has a chance to call do_osshock and destroy/split item stacks.)
  12. zap.c, line 1521 (poly_obj is called AFTER do_osshock has finished with the stack.)
  13. zap.c, line 1312 (poly_obj decides whether or not to merge the items in the stack)
  14. Zap.c, line 1076 (golem creation aborted for not enough items)
  15. zap.c, line 1140 (mons[pm_index] is a permonst structure, defined in permonst.h, the cwt field is the weight of the monsters corpse, which is defined for golems even though they leave no corpses.)
  16. zap.c, line 1035 (polyuse doesn't stop absorbing items until minwt is 0, minwt is initialized to golem corpse weight)
  17. zap.c, line 1054 (not that polyuse is subtracting the QUANTITY of objects from minwt, not the WEIGHT of those objects. iron golems will absorb up to 2000 iron items)
  18. zap.c, line 1043 (which items are eligible for absorption; note that "mat" is the material of the shuddered item stack NOT of the golem created)
  19. zap.c, line 1160 (once NetHack decides to create a golem it records the shuddering stack's material and stops trying to create golems for additional stacks.)
  20. zap.c, line 1733 (bhitpile goes through objects forwards through the list)
  21. mkobj.c, line 1115 (place_object adds dropped objects to the front of the list, where bhitpile will encounter them first.)
  22. zap.c, line 1038 (resistance check only serves to protect the invocation items and the amulet)
  23. Zap.c, line 1215
  24. zap.c, line 1319 (no magic lamps)
  25. zap.c, line 1329 (no wands of wishing or polymorph)
  26. zap.c, line 1338 (no potions of polymorph)
  27. zap.c, line 1343 (no spellbooks of polymorph)
  28. zap.c, line 1225 (mksobj is called with "artif" set to false -- no artis)
  29. timeout.c in SLASH'EM 0.0.7E7F2, line 455
  30. Zap.c, line 1503 (bhito does a resistance check for each item)
  31. Zap.c, line 1515 (bhito checks for system shocks)
  32. Zap.c, line 1518 (bhito performs a system shock)
  33. Zap.c, line 1521 (bhito calls polyobj)
  34. zap.c, line 1140 (create_polymon calls polyuse)

External links