# How to make comfortable furniture/terrain

**URL:** <https://discourse.cataclysmdda.org/t/how-to-make-comfortable-furniture-terrain/18019>\
**Category:** The Drawing Board\
**Created:** [December 20, 2018, 6:18pm UTC](https://discourse.cataclysmdda.org/t/how-to-make-comfortable-furniture-terrain/18019 "2018-12-20T18:18:01Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fris0uman](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/fris0uman/32/8607_2.png) [@Fris0uman](https://discourse.cataclysmdda.org/u/Fris0uman)\
**Post date:** [December 20, 2018, 6:18pm UTC](https://discourse.cataclysmdda.org/t/how-to-make-comfortable-furniture-terrain/18019/1 "2018-12-20T18:18:01Z")

</div>

I’m trying to add a new type of terrain that should be comfortable to sleep on but I can’t find how to do that.  
When I look at the definition of f\_sofa and f\_bed I can’t find what makes them comfortable.

---

<div class="post-metadata">

**Author:** ![mlangsdorf](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/mlangsdorf/32/2462_2.png) [@mlangsdorf](https://discourse.cataclysmdda.org/u/mlangsdorf)\
**Post date:** [December 20, 2018, 7:41pm UTC](https://discourse.cataclysmdda.org/t/how-to-make-comfortable-furniture-terrain/18019/2 "2018-12-20T19:41:29Z")

</div>

This C++ code in player.cpp:

```auto
    if(!plantsleep && (furn_at_pos == f_bed || furn_at_pos == f_makeshift_bed ||
         trap_at_pos.loadid == tr_cot || trap_at_pos.loadid == tr_rollmat ||
         trap_at_pos.loadid == tr_fur_rollmat || furn_at_pos == f_armchair ||
         furn_at_pos == f_sofa || furn_at_pos == f_autodoc_couch ||
         furn_at_pos == f_hay || furn_at_pos == f_straw_bed ||
         ter_at_pos == t_improvised_shelter || (in_shell) || (websleeping) ||
         vp.part_with_feature( "SEAT", true ) ||
         vp.part_with_feature( "BED", true ) ) ) {
        add_msg_if_player(m_good, _("This is a comfortable place to sleep."));
    } 

```

It really needs to get moved to a couple of JSON flags.

---

<div class="post-metadata">

**Author:** ![Fris0uman](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/fris0uman/32/8607_2.png) [@Fris0uman](https://discourse.cataclysmdda.org/u/Fris0uman)\
**Post date:** [December 20, 2018, 7:51pm UTC](https://discourse.cataclysmdda.org/t/how-to-make-comfortable-furniture-terrain/18019/3 "2018-12-20T19:51:21Z")

</div>

So i’d just need to add one `|| furn_at_pos == id_of_New_furniture` to the code ?

EDIT : It’s done, hopefully it works and we’ll soon be able to hide in pillow forts  
[https://github.com/CleverRaven/Cataclysm-DDA/pull/27204](https://github.com/CleverRaven/Cataclysm-DDA/pull/27204)

---

<div class="post-metadata">

**Author:** ![Zhilkin](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/zhilkin/32/3749_2.png) [@Zhilkin](https://discourse.cataclysmdda.org/u/Zhilkin)\
**Post date:** [December 20, 2018, 9:13pm UTC](https://discourse.cataclysmdda.org/t/how-to-make-comfortable-furniture-terrain/18019/4 "2018-12-20T21:13:54Z")

</div>

There are no flags in trap definitions though (and traps are horrible hardcoded instead of using tags/flags).

---

<div class="post-metadata">

**Author:** ![TheZoneWizard](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/thezonewizard/32/1397_2.png) [@TheZoneWizard](https://discourse.cataclysmdda.org/u/TheZoneWizard)\
**Post date:** [December 20, 2018, 9:48pm UTC](https://discourse.cataclysmdda.org/t/how-to-make-comfortable-furniture-terrain/18019/5 "2018-12-20T21:48:40Z")

</div>

Any chance a chair could provide comfort instead of making it say we sleep on concrete floor.

---

<div class="post-metadata">

**Author:** ![Fris0uman](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/fris0uman/32/8607_2.png) [@Fris0uman](https://discourse.cataclysmdda.org/u/Fris0uman)\
**Post date:** [December 20, 2018, 9:58pm UTC](https://discourse.cataclysmdda.org/t/how-to-make-comfortable-furniture-terrain/18019/6 "2018-12-20T21:58:45Z")

</div>

So making the comfortable flag into a comfortable quality ?  
1 for something flat and not too hard  
2 for a normal bed  
3 for really comfy stuff ?

---

<div class="post-metadata">

**Author:** ![TheZoneWizard](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/thezonewizard/32/1397_2.png) [@TheZoneWizard](https://discourse.cataclysmdda.org/u/TheZoneWizard)\
**Post date:** [December 20, 2018, 10:04pm UTC](https://discourse.cataclysmdda.org/t/how-to-make-comfortable-furniture-terrain/18019/7 "2018-12-20T22:04:25Z")

</div>

Do we have an in between 4th option?

Between 1 and 2 seems room for a “Better than the floor” comfort. I can sit on a wood chair and it seems better than concrete. So I am not especially happy with it. But it isn’t a concrete floor.

---

<div class="post-metadata">

**Author:** ![Fris0uman](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/fris0uman/32/8607_2.png) [@Fris0uman](https://discourse.cataclysmdda.org/u/Fris0uman)\
**Post date:** [December 20, 2018, 10:11pm UTC](https://discourse.cataclysmdda.org/t/how-to-make-comfortable-furniture-terrain/18019/8 "2018-12-20T22:11:33Z")

</div>

It would make sense, but I don’t think that qualities are a thing outside crafting right now anyway.

---

<div class="post-metadata">

**Author:** ![Mantar](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/mantar/32/42_2.png) [@Mantar](https://discourse.cataclysmdda.org/u/Mantar)\
**Post date:** [December 21, 2018, 12:33am UTC](https://discourse.cataclysmdda.org/t/how-to-make-comfortable-furniture-terrain/18019/9 "2018-12-21T00:33:15Z")

</div>

So have three flags: comfy, comfier, comfiest. 😁

---

<div class="post-metadata">

**Author:** ![Fris0uman](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/fris0uman/32/8607_2.png) [@Fris0uman](https://discourse.cataclysmdda.org/u/Fris0uman)\
**Post date:** [December 21, 2018, 9:08am UTC](https://discourse.cataclysmdda.org/t/how-to-make-comfortable-furniture-terrain/18019/10 "2018-12-21T09:08:53Z")

</div>

Problem solved :  
[https://github.com/CleverRaven/Cataclysm-DDA/pull/27202](https://github.com/CleverRaven/Cataclysm-DDA/pull/27202)

Make it so that comfort can be specified by a value in json.
