Dwarf Fortress Bug Tracker - Dwarf Fortress
View Issue Details
0004530Dwarf FortressDwarf Mode -- Militarypublic2011-04-15 02:062015-12-11 21:11
Toady One 
0004530: Marksdwarves won't use training bolts unless combat bolts all used up
As the summary states, marksdwarves do not seem to switch from their "combat" bolts to their "training" bolts unless they use up all of the "combat" bolts first, or unless they take their quiver off, which only happens when disbanding the whole squad (as they wear their quivers when off-duty).

Essentially, the combat bolts get "stuck" in the quiver and they will not switch from one to the other. It seems that they know they're not supposed to use the bolts for training anymore, but won't put them down either!
Assign some bolts to a Marksdwarf for both combat and training, make sure the "combat" bolts are in his quiver. Assign him to training and observe as nothing happens.
Can provide a save if necessary.
ammunition, binary patch, Marksdwarves, Save Included, training
related to 0001374new  If squad is assigned multiple ammo types, dwarves with "individual choice ranged" carry wrong ammo, and other ammo bugs 
has duplicate 0002648resolved Footkerchief Marksdwarves refuse to train at archery range if they have more than specified ammo 
has duplicate 0006007resolved Footkerchief Military dwaves equipt wrong bolts for training 
has duplicate 0006269resolved Footkerchief Ammo Material Prefering 
Issue History
2011-04-15 02:06NiliqNew Issue
2011-04-15 06:09QuietustNote Added: 0017389
2011-04-15 18:41gpmfuchsIssue Monitored: gpmfuchs
2011-09-06 14:42QuietustNote Edited: 0017389bug_revision_view_page.php?bugnote_id=0017389#r7013
2011-10-21 02:05KogutTag Attached: Marksdwarves
2011-10-21 17:28Rafal99Note Added: 0018874
2011-10-21 17:29Rafal99Issue Monitored: Rafal99
2011-10-21 17:29Rafal99Tag Attached: ammunition
2012-04-08 09:18thvazNote Added: 0022154
2012-04-08 10:17FootkerchiefTag Attached: AWAITING UPDATE
2012-06-03 20:46Rafal99Tag Attached: training
2012-06-03 21:04Rafal99Note Added: 0022833
2012-06-03 21:06Rafal99Tag Attached: Save Included
2012-06-03 21:10Rafal99Note Added: 0022835
2012-06-04 11:06Rafal99Issue End Monitor: Rafal99
2012-06-04 11:06Rafal99Issue Monitored: Rafal99
2012-06-07 04:29Rafal99Note Edited: 0022835bug_revision_view_page.php?bugnote_id=0022835#r8519
2012-06-10 13:34FootkerchiefRelationship addedrelated to 0001374
2012-06-10 13:34FootkerchiefNote Added: 0022945
2012-06-10 13:34FootkerchiefRelationship addedhas duplicate 0002648
2012-06-10 13:34FootkerchiefIssue Monitored: Khym Chanur
2012-06-10 13:34FootkerchiefIssue Monitored: Hieronymous Alloy
2012-06-11 12:33FootkerchiefRelationship addedhas duplicate 0006007
2012-10-08 05:27agNote Added: 0023642
2012-10-08 05:30agIssue Monitored: ag
2012-10-31 01:12agNote Added: 0023697
2012-10-31 01:13agTag Attached: binary patch
2013-01-09 16:59FootkerchiefRelationship addedhas duplicate 0006269
2014-01-15 14:40Kirig Stonebeard IIIssue Monitored: Kirig Stonebeard II
2014-01-17 10:09Kirig StonebeardIssue Monitored: Kirig Stonebeard
2014-03-25 13:35DwarfuTag Detached: AWAITING UPDATE
2014-03-25 13:35DwarfuAssigned To => Dwarfu
2014-03-25 13:35DwarfuStatusnew => acknowledged
2014-07-26 20:41cephaloNote Added: 0027663
2014-07-28 15:23RedDwarfStepperIssue Monitored: RedDwarfStepper
2014-07-29 15:31DwarfuStatusacknowledged => confirmed
2014-08-03 14:03lethosorProduct Version => 0.31.25
2014-08-21 19:27chaosvoltNote Added: 0029467
2014-08-24 09:55Dame de la LicorneNote Added: 0029574
2014-09-17 01:34hvIssue Monitored: hv
2014-09-17 06:36CanisaurIssue Monitored: Canisaur
2014-09-25 12:25nomad_deltaNote Added: 0030361
2014-09-25 13:02FootkerchiefIssue Monitored: Toady One
2014-11-23 06:05int_uaIssue Monitored: int_ua
2015-12-07 16:31nomad_deltaNote Added: 0033613
2015-12-10 13:54Toady OneNote Added: 0033742
2015-12-10 13:54Toady OneStatusconfirmed => resolved
2015-12-10 13:54Toady OneFixed in Version => Next Version
2015-12-10 13:54Toady OneResolutionopen => fixed
2015-12-10 13:54Toady OneAssigned ToDwarfu => Toady One
2015-12-11 21:11Rafal99Issue End Monitor: Rafal99

2011-04-15 06:09   
(edited on: 2011-09-06 14:42)
When I loaded up my two older fortresses (from 0.31.12 and 0.31.18), I assigned them to use steel bolts for combat and all other types for training, waited long enough for them to all grab some steel bolts, then went and made some wooden training bolts; one single marksdwarf grabbed a stack and did some practice (perhaps he was asleep at the time I assigned steel bolts, so his quiver was empty), but nobody else has set foot near the archery ranges since.

This seems to be due to marksdwarves in 0.31.xx performing archery practice using ammunition stored in their quivers - if their quiver is full of combat-only ammo, they'll never train because there's no room for practice ammo. Back in and earlier, archery practice was done using a stack of "hauled" bolts which never got equipped in the first place.

2011-10-21 17:28   
I have similar problem in my current fortress (0.31.25).
Once I produced enough metal bolts so that every marksdwarf can fill his quiver with them, they stopped archery-practicing at all. It indeed seems that they no longer have space in their quivers for training ammo.
What is worse, they refuse to drop the metal bolts no matter what. I tried removing C for Combat from metal bolts and adding it to wooden bolts, or even removed the metal bolts completety from assigned ammo - all this had no effect, they all still had metal bolts equipped.
The only thing that worked was dumping all metal bolts, after I did that they grabbed wooden bolts and some of them finally started archery practice.
2012-04-08 09:18   
As this one is recent, I won't mark close this, though I hadn't problem with this bug in my last fortresses.
2012-06-03 21:04   
From my testing it seems the exact bug is not about combat vs training bolts, but rather about metal vs wooden bolts. Dwarves won't pick wooden bolts when they have metal bolts in their quivers, even if metal bolts are for training and wooden for combat.

Here I made a save demonstrating the bug in DF v0.34.10:
http://dffd.wimbli.com/file.php?id=6420 [^]

I set the marksdwarves squad to use metal bolts for combat, they all grabbed copper bolts.
Then I added wooden bolts for training and set the squad to Training alert. They all stand still with metal bolts in their quivers.
Then I removed Combat designation from metal bolts and set wooden bolts as Combat. Still no effect.
If you remove metal bolts completely from the squad ammo assignments they still won't drop the the metal bolts and won't pick wooden ones.

The only way is to make them shoot all their metal bolts, or to dump them.
2012-06-03 21:10   
(edited on: 2012-06-07 04:29)
Can we have relationship to 0000535 added?
(So Toady notices this bug when he browses military bugs)

Edit: And to 0001374.

2012-06-10 13:34   
Thanks, this one fell through the cracks. Looks like a more complete version of 0002648.
2012-10-08 05:27   
The relevant code in uniform update function looks something like this in pseudocode:

required_ammo = 25;

for (ammo in inventory) {
  required_ammo -= ammo->getStackSize();

  if (ammo is assigned and correct type)
    register in uniform vectors etc;

if (required_ammo > 0) {
  find some of the correct type, queue pickup

Thus, any ammo in inventory is subtracted from the required count without checking its type, so they don't get pickup instructions to get more; however the actual shooting activity does check the type and aborts.

This patch for linux appears to successfully work around this issue in the case when the current ammo is combat-only, and some is needed for training (there are two separate loops for this and the opposite cases):

http://pastebin.com/Gf3u1YgR [^]

All it does is remove the subtraction before the check, and add the same operation once the type is verified. Since with new container sizes quivers appear to hold up to 80 bolts, loading two stacks at once doesn't seem to be a problem.

Another issue is that ammo in quivers is never added to the removal queue vector, even if not listed in uniform; this means that if your actions unassign currently assigned and equipped ammo, it will still be left in the quivers, and unless patched, subtracted from the count.
2012-10-31 01:12   
Recently I have made a windows patch for this too:

http://pastebin.com/Aw8mi9zD [^]

After looking at more of the equipment code while investigating barrack container issues, it seems that this problem with removing ammo from quivers could have all kind of weird consequences, for instance:

 - Dwarf goes archery practice mode, switches to the training uniform.
 - The table of ammo holders is recomputed from scratch, his combat ammo
   is logged as free since he is not supposed to be holding it.
 - Some other dwarf decides to assign it to itself. Now we have ammo that is
   held by one dwarf (who won't release it), and assigned to another one.
   Fortunately it will probably fix itself once that mapping is recomputed
   again (can't really tell when exactly that happens though).

Unfortunately, removing that ammo is not that simple either, if you want
squad armory containers to work as well, and in an intelligent way too.
I'm thinking that perhaps holding both combat and training ammo at the same time while training should be official behavior, so as to avoid the whole problem of storing and then retrieving the combat ammo.

Another issue I've noticed is that ammo seems to be assigned newest-first, both when choosing ammo for squad, and when a dwarf selects what to put in his quiver.

I'm thinking this is not the best way to do it, because it encourages stupid behavior like going hunting in the field for unforbidden single bolts that have been just shot, or trying to snatch freshly produced ammo directly from the workshop instead of the nearby squad storage. An opposite bias of choosing oldest ammo first (at least when filling the specific dwarf's uniform) might produce more sensible behavior.
2014-07-26 20:41   
Still a problem in 40.04

I set my marksdwarves to go ahead and train with their metal bolts, and my problem marksdwarf went ahead and emptied his quiver of iron bolts onto a target. However, when I set it back to only use metal for combat, he still won't train even though he has no bolts getting in the way.
2014-08-21 19:27   
I've found the closest thing to getting around this issue is just letting them use wooden bolts for both combat and training. Not as good against armor, but still rather lethal in DF2012 and beyond.

Alongside metal bolts assigned as combat-only, this at least ensures that the squad will remain battle-ready at all times, which is less of a problem than reducing training time.

Granted, I seem to eventually end up doing a lot of live target practice on captured enemies. >w<
Dame de la Licorne   
2014-08-24 09:55   
.40.09: Bought some steel bolts from the dwarven caravan, and my marksdwarves blew through all of the steel bolts practicing on an archery target, before re-equipping bone bolts and continuing their target practice.
2014-09-25 12:25   
I can confirm that this is still broken in .40.13: I had a squad of 5 Marksdwarves assigned 250 Wood Bolts for [T] Training only, and they were happily burning through those at the archery range as expected. Some hostiles showed up outside so I added 250 Metal Bolts to the squad's ammo assignment set for [C] Combat only (leaving the Wood Bolts [T] Training designation in place) and activated the squad to a Defend Burrows Alert.

They dutifully went and picked up their Copper Bolts and successfully unloaded them at the targets, hooray!...

...but afterward they were all stuck with various amounts of Copper Bolts in their quivers and none would ever go back to the archery range to train from then on.

I tried removing the 250 Metal Bolts [C] entry from their ammo assignment, but this had no effect. The copper bolts stayed in their quivers, and still no one is training at the archery range.

Of all the bugs in DF, *this* is the one that would make the happiest if it were fixed.
2015-12-07 16:31   
Just tested and confirmed that this is still a problem in v0.42.02. I can upload a save as an example if that would help?

Steps to reproduce:

1. Embark with or create a crossbow and a quiver.
2. Create a Crossbow squad and set Ammo to 100 wood bolts [t] for training and 100 metal bolts [c] for combat.
3. Build an archery target and assign it to the squad for training.
4. First build 100 copper bolts. The crossbow dwarf will fill quiver with 25 of those.
5. Next, build 100 wooden bolts.

The crossbow dwarf will *never* pick up the wooden bolts and will *never* train. They'll just sit there with 25 copper bolts in their quiver which they can't use because they're marked for combat, not training.
Toady One   
2015-12-10 13:54   
Yeah, I went with the carry-both-while-training option, and my test dwarf did a few rounds of training properly while also carrying combat bolts. There will still be problems if they are interrupted or something, but it should be a lot better than before.