View Issue Details

IDProjectCategoryView StatusLast Update
0003855Dwarf FortressDwarf Mode -- Skills and Professionspublic2018-05-06 13:33
ReporterKogut Assigned Touser6 
PrioritynoneSeveritytrivialReproducibilityalways
Status confirmedResolutionopen 
PlatformSDLOSwindowsOS Version7
Summary0003855: Upright spear/spike traps, if constantly toggled, will rapidly train dwarves' skills ("danger room" exploit)
DescriptionDwarves continually poked by active upright spear traps train their combat skills really fast. So fast that it is likely bug.
Steps To Reproducehttp://df.magmawiki.com/index.php/Danger_room
Tagsbinary patch, exploit, Intentional/Expected?

Relationships

related to 0006397 resolvedToady One Nonlethal fall onto upright spike causes unreasonably high skill gain 

Activities

user6

2010-12-29 10:05

  ~0014746

Have you confirmed that the XP gain from dodged/blocked spikes is greater than the XP gain from other dodged/blocked weapons?

Kogut

2011-01-02 02:50

reporter   ~0014770

Is not greater, but more frequent.

Kogut

2011-01-14 00:45

reporter   ~0014867

Last edited: 2011-11-25 12:46

OK, now I tested it myself.

In previous game I had soldiers that have been training for years, destroyed ambushes, sieges - and advanced 1, maybe 2 levels.

With danger room I have almost immediately legendary soldiers.

====

To fix [random ideas]:
- reducing exp for fight with machinery
- requiring real enemy to advance to legendary

UPDATE: Sparring is effective - but you need good teachers (embark with dwarf with high teacher+combat skills), but danger room is still faster, by orders of magnitude.

Kogut

2011-02-20 09:16

reporter   ~0015322

still in .19

Mercurio

2011-03-02 11:09

reporter   ~0015678

Last edited: 2011-03-02 12:34

There really should be a way to make regular training more efficient.
The combat demonstrations are cancelled most of the time (even though I use a separate armor stand now), or provide only 10-20 exp each. Sparring rarely occurs and its rather annoying to have several adamantine-equipped soldiers train for years with barely any progress.

Orkel2

2011-03-27 13:32

reporter   ~0016685

Still in .23

Training needs to be more effective, this is the only way to get skilled soldiers in less than 10 years.

toybasher

2011-11-25 11:19

reporter   ~0019030

Still In .25

I agree training needs to be more effective. Perhaps having sparring/training raise skills quicker would be nice.

Kogut

2011-11-25 12:34

reporter   ~0019031

Why? Sparring is effective - but you need good teachers (embark with dwarf with high teacher+combat skills).

kwieland

2011-11-26 15:31

reporter   ~0019041

Kogut, can you elaborate? If they are expert ax/expert teacher, do the dwarves level up quicker? If so, you should post that on the wiki. It currently just says "presumably" higher level teachers help.

Rafal99

2011-11-29 16:59

reporter   ~0019055

I usually embark with proficient axedwarf / proficient teacher. And what?
2 skill levels after 4 years of training...
Currently the only trained military you can get without expliots are marksdwarves and miners.

ag

2012-11-22 02:06

reporter   ~0023741

Since I couldn't find any bug report that explicitly claims that 'military training is too slow', posting here.

I have investigated the military training code over the past few weeks, and found a number of issues that reduce the training speed from what it could be:

1) All military training code is invoked from unit idle action processing code, which would be fine if not for the fact that the rate of these updates is adjusted depending on unit count (obviously to improve fps), and can change in the range between 10 and 100 ticks between updates. This can cause up to 10x slowdown, although to get that maximum number you need 700 alive uncaged units and thus fps death; a normal developed fort would use somewhere around 50 ticks. The training code does nothing to compensate this, so a skill demo can take anywhere between 3 and 30 in-game days, for the same xp gain.

2) The code that schedules skill demo selects the teacher based on his skill level; however, the actual demo code uses the total xp gained so far to compute the xp difference, which then translates into xp gain. During the 300 unit updates a demo takes, the teacher gets 75 xp, and a student between 225 and 1350 xp (with reductions for poor teacher/student skills). Choosing the wrong teacher can reduce the overall gain, and widen the xp distribution instead of bringing it closer.

3) As noted above, sparring has the lowest priority beyond demo for any possible skill, and even individual practice at archery target; it seems that as long as there is ammo, marksdwarves will never spar and won't gain any hammer skill whatsoever. There also is a random chance for sparring to be rejected based on cautiousness/risk seeking traits.

4) Sparring uses counter fields to count out its 300 update duration, but they are decremented separately by all units participating in the event. This means that the actual duration is 300/N updates, i.e. the larger the squad, the shorter the sparring. In comparison, skill demo has a designated teacher, and only that unit decrements the counter.

5) Skill gain from combat, and thus sparring, seems to be extremely unbalanced. Testing in arena, one medium-skilled dwarf hitting another with a sword, the other one blocking it and counter-striking gives each approximately: +3 for dodge, +6 for armor, +20 for shield, +60 for sword, and +90 for fighter. This means for instance that training dodge and armor with any kind of reasonable speed is only possible by skill demo, so sparring rate actually has to be kept low unless you want legendary+5 fighters with dodge 2.

6) The combat code is very complex, and I may be very wrong, but it seems that the skill roll for counter-strike may be backwards, i.e. a lower-level fighter has more chance to counter-strike over a high-level one. This does seem to be confirmed by some arena tests.

I made a dfhack tweak to work around issues 1-4, and according to tests done by another dfhack developer, it allows reaching around level 15 fighter, level 10 melee weapon, dodge 6, wrestler/striker 3 from zero in two years of full-time training:

https://github.com/angavrilov/dfhack/compare/2401be1b3b4ed...902d2d55970c#L36L51

Notably I had to reduce the rate of forced sparring, because in the first test marksdwarves gained more in hammer skill than archery, and dodge/armor gains were too low.

Regarding danger rooms, any combat is exactly 20x more effective in producing xp than sparring - there is code that ensures that.

ag

2012-11-28 05:44

reporter   ~0023750

Remembered one more minor issue: skill demo has a 100-update timeout waiting until all units gets into the barracks. While it is running, it is rechecked every 10 ticks and reset to zero if they are indeed all there. The weird thing is that from the disassembly the check appears to be written as something like:

  if (units_in_barracks.size() != participants.size()-1) countdown = 0;

I.e. it will also cancel after 10 ticks if more than 1 unit is missing. Could be intended, but it's strange. Or it could be a typo.

Loci

2018-05-06 13:33

viewer   ~0038267

v0.43:Danger rooms were nerfed by allowing force-translation to damage body parts through armor. Additionally, training and sparring were made more effective. A few of the details noted by ag above should probably be reviewed (particularly counter-striking), but this issue is mostly resolved.

Add Note

Note

Issue History

Date Modified Username Field Change
2010-12-29 01:34 Kogut New Issue
2010-12-29 10:04 user6 Tag Attached: AWAITING UPDATE
2010-12-29 10:05 user6 Note Added: 0014746
2011-01-02 02:50 Kogut Note Added: 0014770
2011-01-06 08:23 user6 Summary danger room exploit => Upright spear/spike traps, if constantly toggled, will rapidly train dwarves' skills
2011-01-06 08:23 user6 Tag Attached: Intentional/Expected?
2011-01-06 08:23 user6 Tag Detached: AWAITING UPDATE
2011-01-14 00:45 Kogut Note Added: 0014867
2011-01-14 00:47 Kogut Tag Attached: exploit
2011-02-20 09:16 Kogut Note Added: 0015322
2011-03-02 11:09 Mercurio Note Added: 0015678
2011-03-02 12:34 Mercurio Note Edited: 0015678
2011-03-27 13:32 Orkel2 Note Added: 0016685
2011-03-27 13:54 user6 Summary Upright spear/spike traps, if constantly toggled, will rapidly train dwarves' skills => Upright spear/spike traps, if constantly toggled, will rapidly train dwarves' skills ("danger room" exploit)
2011-11-25 11:19 toybasher Note Added: 0019030
2011-11-25 12:34 Kogut Note Added: 0019031
2011-11-25 12:46 Kogut Note Edited: 0014867
2011-11-26 15:31 kwieland Note Added: 0019041
2011-11-29 16:59 Rafal99 Note Added: 0019055
2012-11-22 02:06 ag Note Added: 0023741
2012-11-28 05:44 ag Note Added: 0023750
2013-12-24 14:32 user1294 Relationship added related to 0006397
2014-08-07 11:00 user6 Tag Attached: binary patch
2014-08-07 11:00 user6 Assigned To => user6
2014-08-07 11:00 user6 Status new => confirmed
2018-05-06 13:33 Loci Note Added: 0038267