Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1] 2 3

Author Topic: Creatures should care about personal rooms being properly private  (Read 3440 times)

G-Flex

  • Bay Watcher
    • View Profile

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).
« Last Edit: August 26, 2009, 09:13:31 pm by G-Flex »
Logged
There are 2 types of people in the world: Those who understand hexadecimal, and those who don't.
Visit the #Bay12Games IRC channel on NewNet
== Human Renovation: My Deus Ex mod/fan patch (v1.30, updated 5/31/2012) ==

irmo

  • Bay Watcher
    • View Profile
Re: Creatures should care about personal rooms being properly private
« Reply #1 on: August 27, 2009, 01:31:46 am »

Rather than make this interact with personality traits, it would be more straightforward for rooms to just not function if they don't have walls. A patch of floor in a 10x10 barracks is not a room, even if you designate it as one. A dwarf sleeping there gets the benefit of having an assigned bed, but not a bedroom.

An alternate way to do this is to just have the room spill out to the maximum extents: floodfill from the bed/desk/other fixture, stopping at walls, doors, and outdoor squares, and then designate all of those squares as being in the room. If this overlaps any other rooms with different owners, all of them stop functioning (so you can have a dwarf's private apartment with an overlapping dining room, office, and bedroom, but it has to have a door separating it from the next apartment).
Logged

G-Flex

  • Bay Watcher
    • View Profile
Re: Creatures should care about personal rooms being properly private
« Reply #2 on: August 27, 2009, 02:34:00 am »

Rather than make this interact with personality traits, it would be more straightforward for rooms to just not function if they don't have walls. A patch of floor in a 10x10 barracks is not a room, even if you designate it as one. A dwarf sleeping there gets the benefit of having an assigned bed, but not a bedroom.

An alternate way to do this is to just have the room spill out to the maximum extents: floodfill from the bed/desk/other fixture, stopping at walls, doors, and outdoor squares, and then designate all of those squares as being in the room. If this overlaps any other rooms with different owners, all of them stop functioning (so you can have a dwarf's private apartment with an overlapping dining room, office, and bedroom, but it has to have a door separating it from the next apartment).

The problem here is that it denies you the ability to make unorthodox arrangements. For instance, in real life, a lot of the time rooms WILL have open entrances instead of actual doors, and I could see sometimes semi-cordoning-off an area of a larger room and defining it as, say, somebody's office despite it only being walled in on three sides.
Logged
There are 2 types of people in the world: Those who understand hexadecimal, and those who don't.
Visit the #Bay12Games IRC channel on NewNet
== Human Renovation: My Deus Ex mod/fan patch (v1.30, updated 5/31/2012) ==

Granite26

  • Bay Watcher
    • View Profile
Re: Creatures should care about personal rooms being properly private
« Reply #3 on: August 27, 2009, 09:15:18 am »

Rather than make this interact with personality traits, it would be more straightforward for rooms to just not function if they don't have walls. A patch of floor in a 10x10 barracks is not a room, even if you designate it as one. A dwarf sleeping there gets the benefit of having an assigned bed, but not a bedroom.

An alternate way to do this is to just have the room spill out to the maximum extents: floodfill from the bed/desk/other fixture, stopping at walls, doors, and outdoor squares, and then designate all of those squares as being in the room. If this overlaps any other rooms with different owners, all of them stop functioning (so you can have a dwarf's private apartment with an overlapping dining room, office, and bedroom, but it has to have a door separating it from the next apartment).

The problem here is that it denies you the ability to make unorthodox arrangements. For instance, in real life, a lot of the time rooms WILL have open entrances instead of actual doors, and I could see sometimes semi-cordoning-off an area of a larger room and defining it as, say, somebody's office despite it only being walled in on three sides.

Also, people share rooms all the time.  Roomates, partners, children.  Even a soldier in a barracks is going to have some concept of what's 'his' personal space, even if it's just his bed and locker.  Sure, it's not as good as his own room, but it still counts for something.

buman

  • Bay Watcher
    • View Profile
Re: Creatures should care about personal rooms being properly private
« Reply #4 on: August 27, 2009, 01:19:01 pm »

the only thing that should be considered is value, obviously an enclosed room can be worth worth more because you have a ring of walls+door that can be of various quality. Perhaps once the economy is revamped then a dwarf will get bad thoughts if he can't rent a room that fits his pay.
Logged

tsen

  • Bay Watcher
    • View Profile
Re: Creatures should care about personal rooms being properly private
« Reply #5 on: August 27, 2009, 01:45:29 pm »

This makes a lot of sense. Even if it's additional complexity, hehe. 8"}
Logged
...Unless your message is "drvn 2 hsptl 4 snak bite" or something, you seriously DO have the time to spell it out.

irmo

  • Bay Watcher
    • View Profile
Re: Creatures should care about personal rooms being properly private
« Reply #6 on: August 27, 2009, 02:28:38 pm »

The problem here is that it denies you the ability to make unorthodox arrangements. For instance, in real life, a lot of the time rooms WILL have open entrances instead of actual doors, and I could see sometimes semi-cordoning-off an area of a larger room and defining it as, say, somebody's office despite it only being walled in on three sides.

Yeah, requiring the room to be fully enclosed is a little harsh. I could see requiring half of the perimeter to be walled, though.

Also, people share rooms all the time.  Roomates, partners, children.  Even a soldier in a barracks is going to have some concept of what's 'his' personal space, even if it's just his bed and locker.  Sure, it's not as good as his own room, but it still counts for something.

He does have the concept of "his" bed, just not "his" room. You can still assign the bed; you just wouldn't be able to designate a room from it.

the only thing that should be considered is value, obviously an enclosed room can be worth worth more because you have a ring of walls+door that can be of various quality.

This is exactly backward. Walls have essentially no value in themselves--the benefit of having them is that they enclose the room.
Logged

G-Flex

  • Bay Watcher
    • View Profile
Re: Creatures should care about personal rooms being properly private
« Reply #7 on: August 27, 2009, 02:33:53 pm »

the only thing that should be considered is value, obviously an enclosed room can be worth worth more because you have a ring of walls+door that can be of various quality. Perhaps once the economy is revamped then a dwarf will get bad thoughts if he can't rent a room that fits his pay.

Except the game needs to distinguish between a room that's actually enclosed by walls, and some sort of hideous monstrosity where the walls are in the MIDDLE. You can't get away with just counting the number of wall and floor tiles, because you can't assume they're in the "correct" place.

And the concept of privacy is a tad different from overall value. Granted, personality/preferences should affect perception of a room's quality in general, but this is more along the lines of the unhappy thought a dwarf gets if, say, he has to hold a meeting in a bedroom.
Logged
There are 2 types of people in the world: Those who understand hexadecimal, and those who don't.
Visit the #Bay12Games IRC channel on NewNet
== Human Renovation: My Deus Ex mod/fan patch (v1.30, updated 5/31/2012) ==

lucusLoC

  • Bay Watcher
    • View Profile
Re: Creatures should care about personal rooms being properly private
« Reply #8 on: August 27, 2009, 03:32:54 pm »

I like the idea, i just do not see any way of handaling all the edge cases without calculating LOS to every tile in toe room, especialy with all the talk of multi level rooms. That would be computatonaly very expensive, for very litle gain gameplay wise. I am going to have to vote no on this, unless somoene can come up with a simple way to do it that handles any arbitrary room space.
Logged
Quantum dumps are proof of "memory" being a perfectly normal dimension in DF. ~Gazz

Bricks

  • Bay Watcher
  • Because you never need one brick.
    • View Profile
Re: Creatures should care about personal rooms being properly private
« Reply #9 on: August 27, 2009, 04:12:53 pm »

"He had to change in public recently."

Should cause bad moods, would be a simple solution.  Of course, you would need dwarves to actually not wear the same pair of pants from birth to death.
Logged
EMPATHY - being able to feel other peoples' stuff.

BlckKnght

  • Bay Watcher
    • View Profile
Re: Creatures should care about personal rooms being properly private
« Reply #10 on: August 27, 2009, 04:37:59 pm »

I like the idea, i just do not see any way of handaling all the edge cases without calculating LOS to every tile in toe room, especialy with all the talk of multi level rooms. That would be computatonaly very expensive, for very litle gain gameplay wise. I am going to have to vote no on this, unless somoene can come up with a simple way to do it that handles any arbitrary room space.
I think you are right that there might be some issues with computational complexity, but I suspect that with some cleverness many of the tougher calculations would only need to be done a few times, either when the room was designated or when a specific event took place.  There are a lot of ways for dwarves to think about privacy and personal space:

Dwarves might not care about having walls and a door as long as nobody is walking through the space that belongs to them.  That would make a huge barracks less desirable than a private room, because the dwarf's roommates would be walking over his stuff all the time.  There might need to be exceptions for family members or sqadmates, depending on the situation (e.g., the Dungeon Master shouldn't mind having the Fortress Guards frogmarch prisoners across his office to the jail).

If we get a more sophisticated economic system in place so that dwarves all spend money to purchase things that they keep in their rooms, we might have the "security" of a room's contents affect it's value.  Having a door that closes off a room would presumably be better for security than an open doorway (though this might depend on the behavior of thieves and the guards that search for them).  Having things stolen from your room would greatly degrade the room's value (and possibly the values of nearby rooms).  This would probably require that doors and coffers be lockable (by dwarves), and keys and lockpicks would become new items.

As for transparent materials, the game might do an LOS check when the room's owner changes clothes or goes to sleep to see if any non-related or non-squadmember dwarf is in sight.  That would allow the Baron to have grand picture windows in his bedroom but still allow him at privacy if his bed and wardrobes are tucked away behind screens or in alcoves. (It looks like Bricks has had this same idea while I've been typing.)
Logged

irmo

  • Bay Watcher
    • View Profile
Re: Creatures should care about personal rooms being properly private
« Reply #11 on: August 27, 2009, 06:13:34 pm »

Dwarves might not care about having walls and a door as long as nobody is walking through the space that belongs to them.  That would make a huge barracks less desirable than a private room, because the dwarf's roommates would be walking over his stuff all the time.  There might need to be exceptions for family members or sqadmates, depending on the situation (e.g., the Dungeon Master shouldn't mind having the Fortress Guards frogmarch prisoners across his office to the jail).

It would make sense to generate bad moods every time someone walks through a dwarf's room (and isn't a family member, attending a party or meeting, or otherwise allowed to be there). This would also be a good reason to separate personal dining rooms and offices from bedrooms. One problem with this is that it would also trigger on people going to the room to do jobs, such as installing the dwarf's furniture and removing refuse. (There could also be an order to disallow dwarves from accepting jobs in private rooms that aren't their own, similar to the "don't go outside" order. This wouldn't stop them from going through those rooms on the way to do other things, but that's a traffic management issue.)

The other, larger problem is that bad moods don't actually matter much until they cause a full-blown tantrum cascade, because, once again, legendary opium den dining room.

Quote
If we get a more sophisticated economic system in place so that dwarves all spend money to purchase things that they keep in their rooms, we might have the "security" of a room's contents affect it's value.  Having a door that closes off a room would presumably be better for security than an open doorway (though this might depend on the behavior of thieves and the guards that search for them).  Having things stolen from your room would greatly degrade the room's value (and possibly the values of nearby rooms).  This would probably require that doors and coffers be lockable (by dwarves), and keys and lockpicks would become new items.

See some of the previous threads on management of keys for why this is a problem. Lockable doors raise hell with pathfinding. Lockable coffers aren't so bad as long as we completely abstract the keys.
Logged

Puzzlemaker

  • Bay Watcher
    • View Profile
Re: Creatures should care about personal rooms being properly private
« Reply #12 on: August 27, 2009, 06:22:05 pm »

Perhaps instead they should just get an unhappy thought if someone walks into their room while they are there.
Logged
The mark of the immature man is that he wants to die nobly for a cause, while the mark of the mature man is that he wants to live humbly for one.

G-Flex

  • Bay Watcher
    • View Profile
Re: Creatures should care about personal rooms being properly private
« Reply #13 on: August 28, 2009, 03:03:24 am »

Real people care about more than that, though.

I know that if my bedroom only has two walls and dozens of people walk by every hour, I'll feel uncomfortable sleeping in there even if nobody enters the "room" proper. :P
Logged
There are 2 types of people in the world: Those who understand hexadecimal, and those who don't.
Visit the #Bay12Games IRC channel on NewNet
== Human Renovation: My Deus Ex mod/fan patch (v1.30, updated 5/31/2012) ==

Nivim

  • Bay Watcher
  • Has the asylum forgotten? Are they still the same?
    • View Profile
Re: Creatures should care about personal rooms being properly private
« Reply #14 on: August 28, 2009, 08:57:48 pm »

So you'd give a bed a line of sight kinda like a person, if the bed "sees" someone, the dwarf will get an unhappy thought about someone coming in their room next time they sleep or are also "seen" by their bed. Exceptions should be made for the barracks option, friends, family (liked family that is), lovers, cleaning staff, and building staff. If you need to get someone to fix or paint a wall, you wont change clothes or sleep in their presence (more making sure they come when you wont be bothered), but you will consider it a required event, and thus not get annoyed just because they are there. But there will probably be a negative thought if they leave tools behind, knock something down, or be a slob somehow. I recall there is a personality trait for organization and cleanliness?
Logged
Imagine a cool peice of sky-blue and milk-white marble about 3cm by 2cm and by 0.5cm, containing a tiny 2mm malacolite crystal. Now imagine the miles of metamorphic rock it's embedded in that no pick or chisel will ever touch. Then, imagine that those miles will melt back into their mantle long before any telescope even refracts an image of their planet. The watchers will be so excited to have that image too.
Pages: [1] 2 3