View Issue Details

IDProjectCategoryView StatusLast Update
0005843Dwarf FortressDwarf Mode -- Roomspublic2024-09-28 19:47
ReporterQuietust Assigned Tolethosor  
PrioritynormalSeverityminorReproducibilityhave not tried
Status feedbackResolutionopen 
Product Version0.34.07 
Summary0005843: Thoughts about tomb quality don't happen
DescriptionThought codes exist for dwarves being happy about the quality of their tomb when they grow a year older (or unhappy if it's substandard), but these thoughts never actually happen because the code is comparing the dwarf's current tomb quality to itself rather than the dwarf's desired tomb quality.

The corresponding thoughts for bedroom, dining room, and office quality all seem to work fine.
Additional InformationThis was originally observed while digging through the code for version 0.23.130.23a (the final 2D release), and it still seems to be present in version 0.34.07.
Tags50.13

Activities

kwieland

2012-04-26 12:56

reporter   ~0022381

So that confirms what I found, that in the first 3d versions, the happiness of a dwarf didn't matter if your dwarf had a tomb or not.

Quietust

2012-08-17 08:18

reporter   ~0023469

It didn't matter in the 2D versions either - I just checked a disassembly of version 0.21.93.19a (i.e. the very first public release) and it had the same problem, so this has never worked correctly.

Furthermore, even if this particular bug gets fixed, only nobles will get thoughts from tomb quality, since it skips giving out thoughts if the dwarf's "desired tomb quality" is zero.

Quietust

2012-09-24 11:10

reporter   ~0023605

There's actually another bug hidden beneath this one - if a dwarf gets the "worried greatly about not having a tomb after gaining another year" thought, the happiness penalty will be based on the dwarf's desired office quality rather than the desired tomb quality.

Shonai_Dweller

2018-06-09 22:26

reporter   ~0038454

Someone's just remarked on receiving this message with a screenshot on Reddit. It's a 44.10 screenshot (includes memories), so presumably the reshuffle of numbers for the stress release finally got this working.

hittemvvvhard

2018-06-10 12:58

reporter   ~0038456

reddit post: https://www.reddit.com/r/dwarffortress/comments/8pvpqj/today_was_my_birthday_i_really_should_have_got_a/?st=ji976edq&sh=288896d4

Loci

2018-06-11 15:37

viewer   ~0038459

Thanks for the update.

I'm not sure if tomb-quality thoughts are intended to apply to non-noble dwarves, but that would seem to be less of a bug and more of a suggestion.

The calculation error using desired office quality instead of desired tomb quality, however, is a bug, if that is still the case in the current version. The effect is minor since almost all nobles have equivalent office and tomb quality demands. Presumably this bug can be tested by modding nobles with lowered tomb demands and checking if they are satisfied with those low quality tombs or demand office-quality tombs instead (or just checking the code again).

Quietust

2021-01-26 07:08

reporter   ~0040880

Last edited: 2021-03-04 05:25

I've just checked the relevant code in version 0.47.04, and it looks like it's still affected by this bug, if only partially - thoughts for lacking a tomb happen as they should, but thoughts for having a poor quality tomb don't.

The happiness penalty likely isn't a problem anymore, since that logic would've been rewritten during the happiness -> stress update.

It's possible that there are multiple places that generate the tomb quality thought, though I don't know where it would be - the only one I found is the same one that existed in older versions, but maybe Toady added another check elsewhere (which might explain why people have seen it happen).

.text:0000000140C58BCD    lea     rdx, [rbp+0C80h+room_req]
.text:0000000140C58BD4    mov     rcx, rsi
.text:0000000140C58BD7    call    unit_getNobleRoomRequirements
.text:0000000140C58BDC    lea     rdx, [rbp+0C80h+room_cur]
.text:0000000140C58BE3    mov     rcx, rsi
.text:0000000140C58BE6    call    unit_getCurrentRoomValues
.text:0000000140C58BEB    cmp     [rbp+0C80h+room_req.tomb], 0
.text:0000000140C58BF2    jle     loc_140C58CFF                        ; Skip logic if unit doesn't need a tomb
.text:0000000140C58BF8    mov     ecx, [rbp+0C80h+room_cur.tomb]
.text:0000000140C58BFE    test    ecx, ecx
.text:0000000140C58C00    jle     loc_140C58CBD                        ; Do "tomb lack" if current value is zero
.text:0000000140C58C06    call    getRoomTierFromValue                 ; Convert current tomb value to tier
.text:0000000140C58C0B    movsx   ecx, ax                              ; Copy current tomb tier to ecx
.text:0000000140C58C0E    movsx   r9d, ax                              ; Copy current tomb tier to r9d
.text:0000000140C58C12    sub     r9d, ecx                             ; Subtract the two tiers (which are the same)
.text:0000000140C58C15    cmp     r9d, 1                               ; If less than one, try to complain
.text:0000000140C58C19    jl      short loc_140C58C5E                  ; Otherwise, add positive thought
...
.text:0000000140C58C5E loc_140C58C5E:
.text:0000000140C58C5E     mov     edx, misc_trait_type_RoomComplaint
.text:0000000140C58C63     mov     rcx, rsi
.text:0000000140C58C66     call    unit_getCounter
.text:0000000140C58C6B     test    rax, rax
.text:0000000140C58C6E     jnz     loc_140C58CFF                       ; Skip if they just became a noble
.text:0000000140C58C74     cmp     r9d, -1
.text:0000000140C58C78     jg      loc_140C58CFF                       ; Skip if greater than -1 (i.e. if 0)
                           ...                                         ; Generate thought


Quietust

2023-11-25 09:31

reporter   ~0041904

Still appears to be present in 50.11.

Approximate logic:
    int32_t req_rooms[4], cur_rooms[4];
    unit->reqlevel(req_rooms,NULL,NULL,NULL);
    unit->curreqlevel(cur_rooms);
    if (req_rooms[3] > 0)
    {
        if (cur_rooms[3] > 0)
        {
            int32_t cur_val = convert_value_to_level(cur_rooms[3]);
            int32_t want_val = convert_value_to_level(cur_rooms[3]); // BUG - should be req_rooms[3]
            int32_t value_diff = cur_val - want_val;
            if (value_diff < 1) { /* experience circumstance "HAVE_TOMB" with negative value, unless DELAYDEMANDS counter exists or value_diff is zero */ }
            else { /* experience circumstance "HAVE_TOMB" with positive value */ }
        }
        else { /* experience circumstance "HAVE_NO_TOMB" */ }
    }

ab9rf

2024-08-09 15:04

reporter   ~0042302

still present in 50.13

Quietust

2024-09-26 05:42

reporter   ~0042367

The release notes for version 50.14 suggest that this has been fixed.

lethosor

2024-09-28 19:47

manager   ~0042371

will mark resolved once confirmed

Add Note

Note

Issue History

Date Modified Username Field Change
2012-04-26 10:55 Quietust New Issue
2012-04-26 12:56 kwieland Note Added: 0022381
2012-08-17 08:18 Quietust Note Added: 0023469
2012-09-24 11:10 Quietust Note Added: 0023605
2018-06-09 22:26 Shonai_Dweller Note Added: 0038454
2018-06-10 12:58 hittemvvvhard Note Added: 0038456
2018-06-11 15:37 Loci Note Added: 0038459
2018-06-11 15:37 Loci Assigned To => Loci
2018-06-11 15:37 Loci Status new => feedback
2021-01-26 07:08 Quietust Note Added: 0040880
2021-01-26 07:08 Quietust Status feedback => assigned
2021-01-26 07:09 Quietust Note Edited: 0040880
2021-01-26 07:10 Quietust Note Edited: 0040880
2021-01-26 07:29 Quietust Note Edited: 0040880
2021-01-26 07:32 Quietust Note Edited: 0040880
2021-01-26 07:46 Quietust Note Edited: 0040880
2021-03-04 05:25 Quietust Note Edited: 0040880
2023-11-25 09:31 Quietust Note Added: 0041904
2024-08-09 15:04 ab9rf Note Added: 0042302
2024-09-26 05:42 Quietust Note Added: 0042367
2024-09-28 19:47 lethosor Assigned To Loci => lethosor
2024-09-28 19:47 lethosor Status assigned => feedback
2024-09-28 19:47 lethosor Note Added: 0042371
2024-09-28 19:47 lethosor Tag Attached: 50.13