Right now, rooms are defined solely by the dimensions you give them. Creatures don't really care if the rooms have doors, for instance.
This is sort of weird. Currently, you can fill a room with bed, like a barracks, and simply define each section of floor as a separate room, and dwarves won't really care that they aren't properly private.
I propose that rooms should be checked (possibly whenever value is rechecked, since that must happen whenever basically anything changes about it) to see whether or not they're "enclosed" properly. By "enclosed" in this post I mean sufficiently private, the typical example being with walls and a door (or a hatch-covered stairway, for instance).
To do this, I guess you could just have a single pathfinding (or better yet, just a dumb flood-fill) operation out from the room, treating doors and hatches as impassable for these purposes, but perhaps considering things like statues passable. From here, it could do one of two things:
- Mark the room as "enclosed" if the operation can only reach tiles that are a part of the room (or, more lax, a part of any room assigned only to him, this way it cares more about whether or not the dwarf's private quarters are enclosed, and wouldn't consider it "unenclosed" just because two rooms of his own don't have a door betwee).
- Do it in a more fuzzy/lax fashion, so that a dwarf can have, say, multiple rooms of his own branching off of his own private (with door) hallway. This case would fail the test outlined above since the hallway isn't technically part of any room of his, but I'm not sure how this would be done intelligently, or how necessary it is.
You could also tie how much a creature cares into personality traits. FRIENDLINESS seems to be the basic introversion/extraversion trait (although slightly more complex), so that's relevant here. For instance, a reversed, introverted dwarf is likely to care more about privacy, whereas an extremely outgoing dwarf might not care too much if his personal dining room is in the middle of a common area.
That last example is basically what I'm trying to prevent here: The ability to define private rooms for creatures in rather nonsensical areas; dwarves should care if their "personal bedroom" is just a 10-by-10 foot section of flooring in the middle of the party hall or what have you.
Type of room should matter too, I suppose. Generally speaking, a dwarf would probably care more about his bedroom being private than his office, although offices certainly apply too.
Of course, this still leaves some oddities. For instance, dwarves wouldn't care about their bedrooms being closed in by only windows and a glass door. You could just assume that the dwarves have some sort of windowshades, I guess, but that's not technically true since in game-terms they still allow light in.
So making it COMPLETELY realistic would take a lot more work, but still doesn't seem impossible, perhaps being accomplished by comparing the length of the room's perimeter (or something) with the number of tiles along that perimeter that allow line-of-sight through them, so that all but the most rigidly reserved dwarves would be fine with a window or two, but all also that all but the most exhibitionistic would feel weird about their entire bedroom front wall being made out of crystal glass windows (I could make a juvenile comment here, but I'll leave that as an exercise to the reader).