Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0004530Dwarf FortressDwarf Mode -- Militarypublic2011-04-15 02:062015-12-11 21:11
ReporterNiliq 
Assigned ToToady One 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionfixed 
PlatformOSOS Version
Product Version0.31.25 
Target VersionFixed in Version0.42.03 
Summary0004530: Marksdwarves won't use training bolts unless combat bolts all used up
DescriptionAs 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!
Steps To ReproduceAssign 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.
Additional InformationCan provide a save if necessary.
Tagsammunition, binary patch, Marksdwarves, Save Included, training
Attached Files

- Relationships
related to 0001374new If squad is assigned multiple ammo types, dwarves with "individual choice ranged" carry wrong ammo, and other ammo bugs 
has duplicate 0002648resolvedFootkerchief Marksdwarves refuse to train at archery range if they have more than specified ammo 
has duplicate 0006007resolvedFootkerchief Military dwaves equipt wrong bolts for training 
has duplicate 0006269resolvedFootkerchief Ammo Material Prefering 

-  Notes
(0017389)
Quietust (reporter)
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 0.28.181.40d and earlier, archery practice was done using a stack of "hauled" bolts which never got equipped in the first place.

(0018874)
Rafal99 (reporter)
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.
(0022154)
thvaz (reporter)
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.
(0022833)
Rafal99 (reporter)
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.
(0022835)
Rafal99 (reporter)
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.

(0022945)
Footkerchief (manager)
2012-06-10 13:34

Thanks, this one fell through the cracks. Looks like a more complete version of 0002648.
(0023642)
ag (reporter)
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.
(0023697)
ag (reporter)
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.
(0027663)
cephalo (reporter)
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.
(0029467)
chaosvolt (reporter)
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<
(0029574)
Dame de la Licorne (reporter)
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.
(0030361)
nomad_delta (reporter)
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.
(0033613)
nomad_delta (reporter)
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.
(0033742)
Toady One (administrator)
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.

- Issue History
Date Modified Username Field Change
2011-04-15 02:06 Niliq New Issue
2011-04-15 06:09 Quietust Note Added: 0017389
2011-04-15 18:41 gpmfuchs Issue Monitored: gpmfuchs
2011-09-06 14:42 Quietust Note Edited: 0017389 View Revisions
2011-10-21 02:05 Kogut Tag Attached: Marksdwarves
2011-10-21 17:28 Rafal99 Note Added: 0018874
2011-10-21 17:29 Rafal99 Issue Monitored: Rafal99
2011-10-21 17:29 Rafal99 Tag Attached: ammunition
2012-04-08 09:18 thvaz Note Added: 0022154
2012-04-08 10:17 Footkerchief Tag Attached: AWAITING UPDATE
2012-06-03 20:46 Rafal99 Tag Attached: training
2012-06-03 21:04 Rafal99 Note Added: 0022833
2012-06-03 21:06 Rafal99 Tag Attached: Save Included
2012-06-03 21:10 Rafal99 Note Added: 0022835
2012-06-04 11:06 Rafal99 Issue End Monitor: Rafal99
2012-06-04 11:06 Rafal99 Issue Monitored: Rafal99
2012-06-07 04:29 Rafal99 Note Edited: 0022835 View Revisions
2012-06-10 13:34 Footkerchief Relationship added related to 0001374
2012-06-10 13:34 Footkerchief Note Added: 0022945
2012-06-10 13:34 Footkerchief Relationship added has duplicate 0002648
2012-06-10 13:34 Footkerchief Issue Monitored: Khym Chanur
2012-06-10 13:34 Footkerchief Issue Monitored: Hieronymous Alloy
2012-06-11 12:33 Footkerchief Relationship added has duplicate 0006007
2012-10-08 05:27 ag Note Added: 0023642
2012-10-08 05:30 ag Issue Monitored: ag
2012-10-31 01:12 ag Note Added: 0023697
2012-10-31 01:13 ag Tag Attached: binary patch
2013-01-09 16:59 Footkerchief Relationship added has duplicate 0006269
2014-01-15 14:40 Kirig Stonebeard II Issue Monitored: Kirig Stonebeard II
2014-01-17 10:09 Kirig Stonebeard Issue Monitored: Kirig Stonebeard
2014-03-25 13:35 Dwarfu Tag Detached: AWAITING UPDATE
2014-03-25 13:35 Dwarfu Assigned To => Dwarfu
2014-03-25 13:35 Dwarfu Status new => acknowledged
2014-07-26 20:41 cephalo Note Added: 0027663
2014-07-28 15:23 RedDwarfStepper Issue Monitored: RedDwarfStepper
2014-07-29 15:31 Dwarfu Status acknowledged => confirmed
2014-08-03 14:03 lethosor Product Version => 0.31.25
2014-08-21 19:27 chaosvolt Note Added: 0029467
2014-08-24 09:55 Dame de la Licorne Note Added: 0029574
2014-09-17 01:34 hv Issue Monitored: hv
2014-09-17 06:36 Canisaur Issue Monitored: Canisaur
2014-09-25 12:25 nomad_delta Note Added: 0030361
2014-09-25 13:02 Footkerchief Issue Monitored: Toady One
2014-11-23 06:05 int_ua Issue Monitored: int_ua
2015-12-07 16:31 nomad_delta Note Added: 0033613
2015-12-10 13:54 Toady One Note Added: 0033742
2015-12-10 13:54 Toady One Status confirmed => resolved
2015-12-10 13:54 Toady One Fixed in Version => Next Version
2015-12-10 13:54 Toady One Resolution open => fixed
2015-12-10 13:54 Toady One Assigned To Dwarfu => Toady One
2015-12-11 21:11 Rafal99 Issue End Monitor: Rafal99


Copyright © 2000 - 2010 MantisBT Group
Powered by Mantis Bugtracker