User feedback:
> Ah, this was the first half my dream!
> The second half is that it would simulate the comfort levels!
>
> Or if just the precise rules of discomfort distribution would be posted somewhere.
> I tried to make experiments how much 1 wall or 1 wall + 1 empty cell protect from discomfort, and the results contradicted each other...
---
## Investigation: Comfort Mechanics in Space Haven
### Official Mechanics
  • The comfort system is divided into three categories:
    Work
    ,
    Leisure
    , and
    Sleep
    . Each tile has a comfort value in each of these three.
  • Facilities generate
    positive comfort
    for some categories, and
    negative comfort
    for others. E.g., arcade machines give leisure comfort but might negatively affect sleep (noise).
  • Positive comfort
    no longer decays with distance
    (since Alpha 14). Negative comfort
    does
    have fall-off with distance.
### Role of Walls, Empty Cells & "Bleeding"
  • Walls and doors
    reduce
    (but don't fully block) the spread of negative comfort.
  • Buffer space behind walls helps substantially—even 1 tile of empty space makes a difference.
  • Multiple negative sources (industry, generators) stack their debuffs, overwhelming thin walls.
### What's Known vs. Unclear
| Aspect | Known | Unclear |
|---|---|---|
| Facility comfort values | Many documented in wiki/patch notes (Alpha 14+) | Some items not well tested; specific fall-off distances vary |
| Wall buffering | Walls reduce spread; empty tiles help | Exact attenuation amounts (how many tiles needed?) |
| Empty cells vs walls | Buffer space helps more than walls alone | Is 1 tile gap sufficient, or 2-3 needed? |
| Multiple negative sources | Negative comfort stacks | Linear vs exponential decay; overlapping radius behavior |
### Common Contradictions Explained
  1. Wrong overlay view
    : Work/Leisure/Sleep are separate—check the right one
  2. Hidden negative sources
    : Generators outside walls still bleed through
  3. Dual-purpose items
    : Jukeboxes help leisure but hurt sleep if too close
---
## Implementation Notes
### Data Sources
The game's
spacehaven.jar
contains structure definitions in
library/haven
XML, but comfort/discomfort values are
not currently parsed
by our JAR converter. We'd need to:
  1. Extend the JAR parser
    to extract comfort-related attributes from structure definitions (likely
    envEffect
    ,
    comfort
    , or similar XML elements)
  2. Reverse-engineer propagation rules
    through community testing or game code analysis
  3. Build a heatmap overlay
    that renders comfort values per tile
### Technical Approach
ComfortSystem:
- Parse comfort emitter data from JAR (positive/negative values, radius)
- Implement propagation algorithm:
- Positive: flat value, no distance decay
- Negative: distance decay + wall attenuation
- Render as color-coded overlay (green=high comfort, red=discomfort)
- Toggle between Work/Leisure/Sleep modes
### Open Questions
  • What XML attributes in the JAR define comfort values?
  • What's the exact wall attenuation formula?
  • How do multiple overlapping sources combine?
---
Effort:
8 (requires JAR parser extension + propagation algorithm + rendering)
Impact:
4 (high user value for ship optimization)