Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Open room calculations  (Read 4105 times)

zzedar

  • Bay Watcher
    • View Profile
Open room calculations
« on: April 11, 2013, 02:32:19 pm »

So I just recently discovered something interesting about how room value is calculated -- specifically, how openings in the walls affect it. Here's the math. Please note that I'm only confident about this for rectangular rooms -- I haven't tested it out for other shapes.

Let vr be the value of the room itself, including the the value of the building used to designate it, and the value of the walls and floor (including material modifiers, smoothing/engraving, etc. -- see Kipi's excellent work for how to calculate this).

Let vf be the value of any additional furniture installed in the room (not including the item used to designate the room in the first place).

Let nb be the number of border tiles the room has.

Let ne be the number of those border tiles that are "empty" -- i.e., not occupied by a wall or door. (Note: I'm not totally confident that doors count as non-empty, but I think they do).

Let V be the total computed value of the room.

Then:

V = (8 - ceiling(4*ne/nb))*vr/8 + vf

Or to put it more simply:

V = mvr + vf

where m is given by the following:
No gapsm = 1
Up to a quarter of the border is gapsm = 7/8
Up to half of the border is gapsm = 3/4
Up to three quarters of the border is gapsm = 5/8
More than three quarters of the border is gapsm = 1/2

I have not tested to see what effect overlapping rooms have on this, nor am I certain whether doors count as part of vr or part of vf.

Edited for readability
« Last Edit: April 11, 2013, 05:56:54 pm by zzedar »
Logged
kingubu cancels Efficiency: Taken by mood
Project Whalegun is a go. Load the whale cannon!

krenshala

  • Bay Watcher
    • View Profile
Re: Open room calculations
« Reply #1 on: April 11, 2013, 03:01:46 pm »

Can't you determine which value the door applies to by changing what door is installed in a particular doorway?  No door versus door versus +door+, etc.
Logged
Quote from: Haspen
Quote from: phoenixuk
Zepave Dawnhogs the Butterfly of Vales the Marsh Titan ... was taken out by a single novice axedwarf and his pet war kitten. Long Live Domas Etasastesh Adilloram, slayer of the snow butterfly!
Doesn't quite have the ring of heroics to it...
Mother: "...and after the evil snow butterfly was defeated, Domas and his kitten lived happily ever after!"
Kids: "Yaaaay!"

zzedar

  • Bay Watcher
    • View Profile
Re: Open room calculations
« Reply #2 on: April 11, 2013, 03:25:33 pm »

Yeah, I plan to test that out, I just haven't gotten to it yet.

One interesting consequence of this is that if a room is going to have a lot of openings, it may be best to designate the room from the least valuable item of furniture in it.
Logged
kingubu cancels Efficiency: Taken by mood
Project Whalegun is a go. Load the whale cannon!

i2amroy

  • Bay Watcher
  • Cats, ruling the world one dwarf at a time
    • View Profile
Re: Open room calculations
« Reply #3 on: April 11, 2013, 04:58:27 pm »

I have not tested to see what effect overlapping rooms have on this
Overlapping floor rooms provide a flat *(1/4) onto any room's value. As for overlapping wall tiles, I'm not sure if that has any effects.
Logged
Quote from: PTTG
It would be brutally difficult and probably won't work. In other words, it's absolutely dwarven!
Cataclysm: Dark Days Ahead - A fun zombie survival rougelike that I'm dev-ing for.

Laserhead

  • Bay Watcher
    • View Profile
Re: Open room calculations
« Reply #4 on: April 11, 2013, 09:55:12 pm »

I'm pretty sure doors are counted. Many of the doors in my fort are high quality gold doors, and they seem to improve the value of a room compared to stone doors.
Logged

celem

  • Bay Watcher
    • View Profile
Re: Open room calculations
« Reply #5 on: April 11, 2013, 10:01:43 pm »

I'm pretty sure doors are counted. Many of the doors in my fort are high quality gold doors, and they seem to improve the value of a room compared to stone doors.

The question they are asking however is where is it counted.  In the base room value (which gets modified by this 'm' value the OP defines) or as part of furnishings, which this hypothesis says is unaffected by the modifier.

Following with interest, and thanks for the link to Kipi's work which I missed somehow
Logged
Marksdwarf Pillboxes
I wish I had something cool to say about this.  Because it's really cool.

zzedar

  • Bay Watcher
    • View Profile
Re: Open room calculations
« Reply #6 on: April 12, 2013, 04:09:23 pm »

Okay, here are my plans:
I have learned that internal doors count as part of vf, not vr. Thus, I can easily test external doors by switching a door between internal and external and seeing if the value changes.

I also want to check whether the multiplier shows up in my wealth summary in the stocks menu.

I should also probably check whether decorations on the designation building count as vf or vr -- I've been assuming, which I shouldn't. And I'm going to check whether items that just happen to be lying in the room count (with stockpiles).

Next, I'm going to check pillars -- walls that are completely surrounded by the room, and whether they count as perimeter tiles.

Then, I'm going to check constructed walls -- all I've done so far is with dug walls.

Anything else I should explore?
Logged
kingubu cancels Efficiency: Taken by mood
Project Whalegun is a go. Load the whale cannon!

Gentlefish

  • Bay Watcher
  • [PREFSTRING: balloon-like qualities]
    • View Profile
Re: Open room calculations
« Reply #7 on: April 12, 2013, 08:10:36 pm »

with constructed walls - check between blocks and raw stone. If I remember right, blocks are worth more than the raw material and may, then, play a factor in it. With that against engravings, we can see how much of a difference that would make.

zzedar

  • Bay Watcher
    • View Profile
Re: Open room calculations
« Reply #8 on: April 12, 2013, 09:47:01 pm »

Okay, I did some experimentation, and it looks like  non-internal doors don't count towards the value of the room at all. An exceptional gold door, which by itself has a value of 1500 -- enough to make a room "great" by itself -- is sitting at the entrance of a "meager" bedroom right now. However, there seems to be a bug here. Internal/external is only checked at the time when you resize the room. If a door in a room has its internal/external status flipped after the room is sized, that isn't taken into account in the calculations.
Logged
kingubu cancels Efficiency: Taken by mood
Project Whalegun is a go. Load the whale cannon!

i2amroy

  • Bay Watcher
  • Cats, ruling the world one dwarf at a time
    • View Profile
Re: Open room calculations
« Reply #9 on: April 13, 2013, 12:58:36 am »

I think that is due to the fact that non-internal doors prevent the room from spreading underneath them (and thus neither they, nor the floor beneath them, is counted as part of the room).
Logged
Quote from: PTTG
It would be brutally difficult and probably won't work. In other words, it's absolutely dwarven!
Cataclysm: Dark Days Ahead - A fun zombie survival rougelike that I'm dev-ing for.

King Mir

  • Bay Watcher
    • View Profile
Re: Open room calculations
« Reply #10 on: April 13, 2013, 01:15:29 am »

If the internal flag plays such a big role, you should see if it applies to hatches too. For completeness.

zzedar

  • Bay Watcher
    • View Profile
Re: Open room calculations
« Reply #11 on: April 13, 2013, 01:31:41 pm »

I think that is due to the fact that non-internal doors prevent the room from spreading underneath them (and thus neither they, nor the floor beneath them, is counted as part of the room).
Ooh, good point, I should check to see whether the floor tile counts.
Logged
kingubu cancels Efficiency: Taken by mood
Project Whalegun is a go. Load the whale cannon!