Sites Editor

Medium

The Sites Editor, found under Windows > Gameplay in the World Editor, is used for creating gameplay-related areas and points of interest, and is split into three categories: Locations, Zones, and Parking Spots.

Here is what the editor looks like when you open it:

Overview

The Sites data created in this editor contains three components:

  • Locations are points of interest. They can be used to mark a destination, and they detect the closest road to the point.
  • Zones are polygonal areas that can detect if a vehicle or point is inside or outside of the area. They are commonly used to define boundaries for missions, but they are useful for other things as well.
  • Parking Spots are rectangular areas that can detect if a vehicle is properly contained inside or outside of the box. They are used in some missions, but can also be used to define parking for a level.

General Editing

For each data type, the left panel shows the list of all objects, and the right panel allows you to inspect and edit the properties of the currently selected object.

The objects from each data type have a lot in common with how they can be edited in the world. You can click Left Mouse Button to select them, and you can move them just like other objects.

Here are some tips about how to create each object:

  • Location: Hold down SHIFT and click Left Mouse Button in the world to place a new location.
  • Zone: Select Create… to add a new zone to the list. While the zone is selected, hold down SHIFT and click Left Mouse Button in the world to place a new zone corner. You will need at least 3 corners, or vertices, for a valid zone.
  • Parking Spot: Hold down SHIFT and click Left Mouse Button in the world to place a new parking spot. You can also hold down SHIFT and drag Left Mouse Button as a shortcut for setting the parking spot rotation.

Each data type allows you to save custom tags and fields.

Sites can be saved and loaded. By default, sites will get saved in <userfolder>/gameplay/sites/.

Zones

Zones can be used to highlight different areas of the level, or to create boundaries for gameplay, such as for missions. In essence, they are two-dimensional polygons, with an optional floor and ceiling if you really need height limits. In the editor, they can detect if the current player vehicle is inside the zone area, with a Calc Time value representing the CPU time that it takes to check the status each frame.

Zones that are intended to be linked to the level can have a speed limit property. In the Custom Fields section, create speedLimit as a New Number, and then set a custom speed (in metres per second). All roads in the zone will take this value.

Parking Spots

Parking Spots have some extra special features. If you want to create a bunch of parking spots in a row, click on the Is Multispot checkbox. Some options will show up, allowing virtual copies of parking spots to be extended from the current parking spot. Keep in mind that they might not be aligned to the terrain, so you may need to tweak the rotation of the original parking spot to align the copied spots.

If you want to use parking spots for the automatic parked cars feature, here is a list of optional custom tags and fields that you can apply:

Tag
Description
Tag
forwards
Description
Parked cars will always face forwards when spawning here
Tag
backwards
Description
Parked cars will always face backwards when spawning here
Tag
perfect
Description
Parked cars will always be perfectly centered in this spot
Tag
street
Description
Street parking; other AI vehicles will try to avoid collisions with parked cars here
Tag
nightTime
Description
This spot is favored for night time parking
Tag
dayTime
Description
This spot is favored for day time parking
Field
Description
Field
probability
Description
The chance that a parked car will spawn in this spot (from 0 to 1)

Keep reading if you want these parking spots to be automatically loaded by the level.

Main Level Site

If you name your Sites file city.sites.json, and save it to the root folder of a level, it will always get loaded and processed every time the level loads. Currently, this is the intended way to have default zones and parking spots for a level. The parking spots are especially useful if you want to see parked cars show up if the “Spawn Parked Cars” option is enabled.

Last modified: April 17, 2023

Any further questions?

Join our discord
Our documentation is currently incomplete and undergoing active development. If you have any questions or feedback, please visit this forum thread.