Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0011901Dwarf FortressCreaturespublic2022-08-16 14:092022-08-25 11:41
ReporterQuietust 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusnewResolutionopen 
Platformamd64OSWindowsOS Version8.1
Product Version0.47.05 
Target VersionFixed in Version 
Summary0011901: Cave Adaptation completely resets when dwarves step outside
DescriptionWhenever a dwarf spends time underground, its CAVE_ADAPT counter increases by 1 every game tick to a maximum amount of 800000.

If a sufficiently-adapted dwarf steps outside while the weather is clear (i.e. the sun is out), there is a 1/1000 chance per game tick that the dwarf will experience negative effects (i.e. being Irritated or Nauseated by the sun, depending on how heavily they are adapted).

In older versions, it would then decrease the dwarf's adaptation by 10 and to a minimum of zero, but in version 0.47.05 the "decrement and check" are both missing, causing it to immediately reset adaptation to zero the instant the dwarf sets foot outside.

As a result, dwarves only have a 1/1000 chance to ever suffer from negative effects (or even experience negative thoughts) from cave adaptation, and that will only happen if they spend at least a year without ever going outside.
Steps To Reproduce1. Put a dwarf underground and wait at least a year and a half (or just initialize its cave adaptation to a sufficiently large value)
2. Have it step outside
3. Observe that its cave adaptation is now completely gone and it likely hasn't suffered from it.
Additional InformationPrior to version 0.40.13, cave adaptation was partially broken in that it did not inflict the Pain+Dizziness+Nausea effects - this was fixed by 0006512, but it's unclear exactly when this specific bug was introduced.
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0041293)
Quietust (reporter)
2022-08-16 14:56
edited on: 2022-08-26 07:43

A few other minor bugs I've spotted:
* In older versions, "nauseated" applied 50-99 ticks of Dizziness while "irritated" only applied 25-49 ticks; in the current version, "irritated" also applies 50-99 ticks.
* The "irritated" case checks if the creature can suffer Nausea, even though it never actually applies it - as a result, if the creature has [NOPAIN] and [NO_DIZZINESS] but not [NONAUSEA], light cave adaptation will apply a "wound" with no effects.

(0041298)
Quietust (reporter)
2022-08-25 11:41
edited on: 2022-08-26 07:49

It appears that this was introduced in version 0.47.05 - looking at a disassembly of version 0.47.04, the "decrement and check" code was present, but in 0.47.05 it was absent.

The release notes for that version claim "Made cave adaption negative effects less frequent", but instead it seems to have eliminated them entirely. Maybe the intent was to only cure them after they suffered negative effects?

Some random ideas/suggestions for alternative fixes:
* When a creature is "nauseated" by the sun, immediately subtract 2 months (so they only vomit a few times)
* When a creature is "irritated" by the sun, immediately subtract 1 month (so they get stunned maybe 6 times)
* Still have it slowly decay by 10 per tick (so that negative effects still have a chance of happening at all)
* Maybe reduce the chance per tick (e.g. to 1/2000) so that negative effects are spread out over time


- Issue History
Date Modified Username Field Change
2022-08-16 14:09 Quietust New Issue
2022-08-16 14:56 Quietust Note Added: 0041293
2022-08-25 11:41 Quietust Note Added: 0041298
2022-08-25 11:43 Quietust Note Edited: 0041298 View Revisions
2022-08-25 11:47 Quietust Note Edited: 0041298 View Revisions
2022-08-25 11:48 Quietust Note Edited: 0041298 View Revisions
2022-08-26 07:41 Quietust Note Edited: 0041298 View Revisions
2022-08-26 07:43 Quietust Note Edited: 0041293 View Revisions
2022-08-26 07:43 Quietust Note Edited: 0041293 View Revisions
2022-08-26 07:49 Quietust Note Edited: 0041298 View Revisions


Copyright © 2000 - 2010 MantisBT Group
Powered by Mantis Bugtracker