Skip to content

Building size and floorspace calculations

algernon-A edited this page Jul 17, 2022 · 17 revisions

Realistic Population 2 bases its calculation of realistic population values based on the physical sizes of building models. Note that this is based the size of the **builing **itself - NOT the size of the lot the building is situated on. For example, a typical house in the game may be situated on a 4x4 (32m x 32m) lot - however, the mod would only base its calculations on the building itself, which could be much smaller than the lot size.

To calculate the size of a building, Realistic Population 2 takes the footprint of the physical building model, and divides it into 256 segments (in a 16x16 grid). It then calculates the maximum height of the building (in metres) within each segment, and then works out how many building floors (stories) will fit into that height. Finally, the mod then allocates floors within the building, starting from the base up; each floor's area is the sum of the areas of all the segments whose maximum heights can accomodate that floor level.

Example

Building segmentation example Our sample building is an irregular shape, 170m wide and 85m deep (note that this is for explanation and is much larger than most buildings in the game, and indeed in real life). The mod first segments it into 256 segments, each approximately 10.6m x 5.3m with an area of 56m2. In this building, the floor height is a constant 3 meters (each floor is 3m above the level of the previous floor).

The mod then calculates the maximum building height for each segment, calculated on the building model shape and size. Let's assume that our example building has a calculated height of:

  • 70m in 80 segments,
  • 35m in 140 semgents.
  • 0m (no building) in the remaining 36 segments.

So, we go to calculate the area of the first floor - a total of 220 segments have at least a first floor, for a total first floor area of 12,320m2 (220 segments x 56m2 per segment).

We then work up to the next floor - this floor is the same size and shape as the first floor, so it too is 320m2. We've now calculated our first two floors, and the total building floorspace so far is 24,640m2 (12,3202 on each of the first two floors). This continues for the next 11 floors.

However, when we reach the 12th floor, there is a change - we are now close to the roof of the building for some segments. For example, in 140 of our segments the building is only 35m high. We have already allocated 11 floors to it, or a total of 33 metres of allocated height (3 meters per floor x 11 floors). After this allocation, only 2 meters are left above the previous floor - not enough to fit in another floor. So, the floorspace allocation for these segments stops at the 11th floor.

From now on, the floors are calculated with only the 80 segments with building heights of over 35 metres (for a total of 35 x 56m2 = 4,480m2 per floor. After an additional 11 floors are added, the top of these segments is reached (at 70 meters); and that's it for this building.

We have calculated a total of 22 floors for this building, some smaller than others, as you would expect from the building’s shape. Our total building floor area is (11 floors of 12,320m2 + 11 floors of 4,480m2) = 184,800m2.