PcoWSkbVqDnWTu_dm2ix

Building System

Building System

Roblox Battle Royale features a building system that lets players build their own structures to reach higher ground for a better shooting angle, or to provide cover during battle. Using a menu, the player can select from a number of different tile types and place them in the world.

To maintain an orderly and structured system:

  • Each tile must be connected to another existing tile or to the ground.
  • All building tiles are placed within a grid mapped to the game world so that tiles connect properly and do not overlap.

Tile Composition

In order for players to build new tiles quickly and easily, the building system needs to understand what tiles are connected to each other and where new tiles can be placed on the grid:

Aspect Description
Asset A BasePart (Part, MeshPart, etc.) placed in ReplicatedStorage/BuildingSystem/Assets that represents what the tile should look like when it's placed in the game world. This BasePart must have two children:
  • ObjectType — A StringValue with a StringValue/Value|Value of the tile type name.
  • StartingRotation — A NumberValue with a NumberValue/Value|Value should be the tile's starting rotation when it's placed in the world.
Occupancy A bitmask which represents the physical space the tile type takes up within a cell. Each building system tile/object can occupy any number of faces of a grid cell (front, left, back, right, top, and bottom) and any number of octants in a grid cell. A building system object can only be placed in a cell if all the faces and octants that the object occupies are available in that cell. Occupancy for a building system object is defined as follows:
Bit Index Meaning
0 Bottom face of cell
1 Top face of cell
2 Right face of cell
3 Back face of cell
4 Left face of cell
5 Front face of cell
6 +X, –Y, +Z octant of cell with origin at center of cell
7 +X, +Y, +Z octant of cell with origin at center of cell
8 X, –Y, +Z octant of cell with origin at center of cell
9 X, +Y, +Z octant of cell with origin at center of cell
10 X, –Y, –Z octant of cell with origin at center of cell
11 X, +Y, –Z octant of cell with origin at center of cell
12 +X, –Y, –Z octant of cell with origin at center of cell
13 +X, +Y, –Z octant of cell with origin at center of cell
Connectivity
A bitmask which represents what portions of the cell's faces/edges the tile type touches. A building system tile/object's connectivity is represented by a series of bits representing connection points on the surface of a cell. They are arranged in the following way on the faces of the cell:
A building system object is considered connected to another building system object in the grid if they share at least 2 connectivity points on the surface of a cell.

Creating New Tile Types

To create a new tile type:

  1. Place the asset in ReplicatedStorage/BuildingSystem/Assets. Remember that it must contain ObjectType and StartingRotation children as defined above.
  1. Define the Occupancy and Connectivity for your new tile type in ReplicatedStorage/BuildingSystem/Libraries/Grid/ObjectTypeConfigurations:
For example, the Wall tile type is expressed as follows:

Working With Terrain

If you would like to create a map with free-form articles/Intro To Terrain|terrain that lines up perfectly with the building system, we recommend that you use the heightmap import system as outlined in /articles/importing terrain data/index.html|Importing Terrain Data and that you observe the following details:

  • Terrain in Roblox is represented by a three dimensional array of voxels, each of which occupies a cube of 4×4×4 studs in the world. Because of this, Roblox Battle Royale uses a grid cell size of 20×16×20 studs, with wall tiles that are 20×16×1 studs and floor/ceiling tiles that are 20×1×20 studs in size. This allows building tiles and terrain to line up properly.
  • Each pixel in your heightmap image should represent one terrain voxel in the X/Z plane, so a 5×5 area in pixels represents one building system grid cell that occupies a 20×20 stud area.
  • In your heightmap image, make sure the red channel or grey channel value for each pixel is divisible by the height of your building system grid cell so that the floor tiles sit nicely on top of the terrain.
  • When you import your heightmap, set:
    Position (X, Y, Z) = 0, 0, 0
    Size (X, Y, Z) = heightmap_width × 4, 256, heightmap_length × 4

Previous Pickup System Next Minimap System