Scalable Building Simulator
Building Design Guide
This document describes how to create your own buildings for Skyscraper's Scalable Building Simulator engine, and also describes all of the available commands.
1. Starting a new building
Buildings are stored in text files in Skyscraper's buildings folder, usually at c:\program files\skyscraper\buildings. The filenames end in BLD, and so you need to make sure your text file ends with ".bld" and not ".txt". To create a new building, first open up a text editor, and read the instructions below. When you're finished, save it into the buildings folder shown above, as something like "mybuilding.bld". The building will appear in Skyscraper's buildings list the next time you run it. You might also want to open one of the buildings that come with Skyscraper ("Triton Center.bld" and "Glass Tower.bld") to get a good idea of the format of a building data file. Eventually there will be a graphical designer app, but it'll be a while since I'm the only developer so far ;)
2. General Stuff
1. Comments
To add a comment to your file, simply put the # symbol right
before your comment. For example:
# This is a comment
It's a good idea to use comment markers to add a title header
at the top of your building file. The Triton Center file has this header:
#The Triton Center
#Copyright ©2003-2006 Ryan Thoryk
2. Variables
Variables are marked with percent signs (%), and most system
variables will be described later. There are 256 user variables (0-255) which
can be set using the Set command:
Set 2 = 100
and then can be used later:
Height = %2%
3. IF statements
Basic IF statements can be made, with the following syntax:
if(value1 sign value2)
command
For example, to set the height to 9.5 if the floor number is
less than 82:
if(%floor% < 82) Height
= 9.5
Available signs are = (equals), > (greater than), < (less than), and ! (is not)
4. Inline calculations
Values can be calculated inline by using the following math
operators:
+ (plus), - (minus), / (divide), and * (multiply).
They can be used anywhere in the data file - here's an example
of one being used with the Set command:
Set 1 = %floorheight% + 10
5. Object parameters from the outside
Information about floors can be obtained outside the floor sections, by referencing the floor in this manner:
Floor(number).parameter
Available parameters are Altitude and FullHeight.
Example:
Set 1 = Floor(5).Altitude
Commands:
1. CreateWallBox - creates 4 walls (box) at the specified coordinate
locations
Syntax: CreateWallBox destobject,
texturename, x1, z1, x2, z2,
height, voffset, tw, th
Example: CreateWallBox external,
brick, -10, -10, 10, 10, 15, 0, 0, 0
The parameters in this command are very similar to the ones in the AddWall command shown below in the Floor section, except for the destobject parameter; so loook in that section for info on most of these parameters.
Destobject can be either external, landscape, buildings, or columnframe (more will come soon). The voffset parameter would then be the altitude offset in feet of the specified destination object's base.
2. CreateWallBox2 - creates 4 walls (box) at a specified central
location
Syntax: CreateWallBox2 destobject,
texturename, centerx, centerz, widthx,
depthz, height, voffset, tw, th
Example: CreateWallBox2 external,
brick, 0, 0, 10, 10, 15, 0, 0, 0
The parameters are the same as the above command, except centerx and centerz define the center of the box, and widthx and depthz specify the width and depth off of the center.
3. The Globals Section
The Globals section contains the general information
about your building. The section starts with this header:
<Globals>
and ends with this footer:
<EndGlobals>
Parameters are placed between those two markers, and look like
this:
Parameter = value
Example:
Name = Triton Center
Here are the available commands:
1. Name - building name, required
Example: Name = My Building
2. Designer - name of building's designer, optional
Designer = Me
3. Location - location of the building, optional
Location = 100 Main Street
4. Description - Brief description of the building, optional
Description = A really average
building
5. Version - Version of the building (can be text), optional
Version = 1
6. Floors - total number of above-ground floors the building has, starting
with 0 (for a 15-story building, you would enter 14), required
Floors = 20
7. Basements - total number of below-ground floors the building has, required
Basements = 2
8. Elevators - total number of elevators, required
Elevators = 6
9. ElevatorShafts - total number of elevator shafts, required
ElevatorShafts = 1
10. Pipeshafts - total number of pipe/utility shafts, required
Pipeshafts = 2
11. Stairs - total number of stairwells, required
Stairs = 3
12. HorizScale - horizontal scaling modifier; default is 1, optional
HorizScale = 2 (makes
each horizontal foot become 2 feet, keeping vertical feet at the default)
13. CameraAltitude - camera's normal altitude in feet above the floor, required
CameraAltitude = 3.2
14. CameraFloor - camera's starting floor, starting with 0 (like Floors command),
required
CameraFloor = 0
15. CameraPosition - camera's starting position in X (left/right) and Z (in/out)
feet coordinates, required
Syntax: CameraPosition =
X, Z
CameraPosition = 0, -10
16. CameraDirection - direction the camera's facing on startup, in X (left/right),
Y (up down), and Z (in/out) feet coordinates, required
CameraDirection = 0, 10,
28.8
17. CameraRotation - rotation of the camera on startup, required
CameraRotation = 0, 0, 0
4. The Textures Section
The Textures section loads textures into the simulation and assigns names to them, for use in the rest of the sections.
1. Load - loads a texture
Syntax: Load filename,
name
Example: Load data\brick1.jpg,
Brick
2. LoadRange - loads a numeric range of textures, and the current
number is available in the number variable (%number%)
Syntax: LoadRange startnumber,
endnumber, filename, name
Example: LoadRange 2, 138,
data\floorindicators\%number%.jpg, Button%number%
This example will load the file 2.jpg and name it Button2, 3.jpg as Button3, and so on.
5. The Floor Sections
There are 2 Floor sections available - Floor
and Floors. Floor specifies a single floor, while Floors
specifies a range of floors.
For a single floor, the section would start with this:
<Floor number>
and end with this:
<EndFloor>
For example, a floor section for a lobby would use this:
<Floor 0>
For multiple floors, the section would start with this:
<Floors start
to finish>
and end with this:
<EndFloors>
For example, to work with floors 5-10, you would type:
<Floors 5 to 10>
Available variables:
%floor%
- contains the current floor number
%height% - contains
the current floor's ceiling height
%interfloorheight%
- contains the current floor's interfloor height (spacing between floors)
%fullheight% - contains
the current floor's total height, including the interfloor height
%doorheight% - contains
the current floor's default door height
%doorwidth% - contains
the current floor's default door width
Parameters:
1. Name - the name of the current floor, required
Example: Name = Floor %floor%
2. ID - the floor indicator name for the current floor, such
as L (for Lobby), LL (lower level), M (Mezzanine), etc
ID = %floor%
3. Type - the type of floor the current floor is. The types
are still being defined, but the currently used ones are Basement, Lobby,
Mezzanine, Conference, Office, Service, Skylobby, Hotel, Apartment, Condominium,
Restaurant, Observatory, Recreation, Ballroom, Communications, and Roof. (Required)
Type = Office
4. Description - description of the current floor, optional
Description = Offices
5. Height - the floor-to-ceiling height of the current floor,
required
Height = 9.5
6. InterfloorHeight - the height in feet of the space between
floors, starting right above the current floor's ceiling and ending right
below the next floor's floor, required.
InterfloorHeight = 2.24
7. DoorHeight - the default height in feet of the doors on the
current floor, optional.
DoorHeight = 7
8. DoorWidth - the default width in feet of the doors on the
current floor, optional.
DoorWidth = 3
Commands:
1. Exit - exits the current floor section
2. AddFloor - adds a textured floor with the specified dimensions
to the current floor/level
Syntax: AddFloor texturename,
x1, z1, x2, z2, voffset, tw,
th, isexternal
Example: AddFloor brick,
-10, -10, 10, 10, 0, 0, 0, False
Voffset is the height in feet above the current floor's altitude; tw and th are to size/tile the texture (0 lets the app autosize them), and isexternal determines if the floor is part of the building's external framework, or is part of the current floor (is either True or False).
3. AddWall - adds a textured wall with the specified dimensions
to the current floor/level
Syntax: AddWall texturename,
x1, z1, x2, z2, height1, height2,
voffset1, voffset2, tw, th, isexternal
Example: AddWall brick, -10,
-10, 10, 10, 10, 10, 0, 0, 0, 0, False
Height1 is the wall height in feet at the first coordinate set (x1 and z1), and height2 is for the second set (x2, and z2). Voffset1 is the vertical offset in feet (from the floor's altitude) for the first coordinate set, and voffset2 is for the second set. Tw and th are the texture sizing/tiling multipliers, and isexternal determines if the wall is part of the building's external framework (true) or if it's part of the current floor (false)
4. AddInterfloorFloor - adds a textured floor above the ceiling
of the current floor/level
Syntax: AddInterfloorFloor
texturename, x1, z1, x2, z2,
voffset, tw, th
Example: AddInterfloorFloor
brick, -10, -10, 10, 10, 0, 0, 0
The parameters are the same as the AddFloor command, except the voffset value is the height offset in feet above the current floor's ceiling.
5. AddInterfloorWall - adds a textured wall above the ceiling
of the current floor/level
Syntax: AddInterfloorWall
texturename, x1, z1, x2, z2,
height1, height2, voffset1, voffset2,
tw, th
The parameters are the same as the AddWall command, and the voffset values are the same as the AddInterfloorFloor command.
6. The External Section
The External section defines parts of the building's exterior. The exterior can also be somewhat created in the Floor sections, but this section provides more options.
Commands:
1. AddTriangleWall - adds a textured triangular wall
Syntax: AddTriangleWall texturename,
x1, y1, z1, x2, y2, z2,
x3, y3, z3, referenceheight, tw,
th, SetbackID
Example: AddTrianglewall
brick, 0, 0, 0, 0, 10, 0, 0, 0, 10, 10, 0, 0, mywall
SetbackID is optional (it assigns a name to the wall,
so position information can be retrieved later on angular positions).
Referenceheight is going to be removed soon - for now set it to a
height of a floor.
2. AddWall - adds a textured wall
Syntax: AddWall texturename,
x1, z1, x2, z2, height1, height2,
altitude1, altitude2, tw, th, SetbackID
Example: AddWall brick, -10,
-10, 10, 10, 15, 15, Floor(2).Altitude, Floor(2).Altitude, 0, 0
The command's parameters are the same as the Floor section's AddWall command, except for the altitudes. Since there is no floor to reference, the actual altitude of the wall in feet must be specified.
3. AddFloor - adds a textured floor
Syntax: AddFloor texturename,
x1, z1, x2, z2, altitude, tw,
th
The command's parameters are the same as the Floor section's AddFloor command, except the altitude parameter. Since there is no floor to reference, the actual altitude of the wall in feet must be specified.
7. The Elevator Section
The Elevator section allows you to create elevators for your building.
The section headers and footers are similar to the ones in the
Floor section.
To specify a single elevator, you would type something like:
<Elevator 1>
and end it with:
<EndElevator>
For a range of elevators, you would use something like:
<Elevators 2 to 10>
and end with:
<EndElevators>
Variables:
%elevator% - number of the current elevator
Parameters (the values of most of these are still being figured out as to what they exactly correspond to in real-world terms):
1. Speed - maximum speed of the elevator
Example: Speed = 1
2. Acceleration - acceleration speed of the elevator
Example: Acceleration = 0.003
3. Deceleration - deceleration speed of the elevator
Example: Deceleration = 0.4
4. OpenSpeed - open/close speed of the elevator doors
Example: OpenSpeed = 1.5
Commands:
1. CreateElevator - creates an elevator at the specified location
Syntax: CreateElevator x,
y, floor, direction
Example:
CreateElevator 0, 10, 0, 0
X and Y are the coordinates to place the center of the elevator at. Floor is the floor to place the elevator on, and Direction is the direction that the elevator faces (currently there are only 2: 0 is the doors on the left side, and 1 is the doors on the right side)
8. Small Example Building
To see an example of a small simplistic building in code, look at the Simple.bld file in Skyscraper's buildings directory. It's also available online here.