Lights
The Light tool places lights that are saved with your map: street lamps, warm light in a window, a flickering fire, a blinking warning light or a spotlight on a sign. Lights are not props. Every player’s game draws them itself, every frame, wherever a map with lights is enabled. That is why they come with their own limits, see Limits and performance.
Pick Light in the top bar. The panel header shows how many lights your working map has out of Config.Lights.maxPerMap, for example 12 / 320. Esc goes back to the Select tool.
Placing a light
Left-click where the light should go. It is placed on the surface under the cursor, lifted Config.Lights.dropLift (1 metre) off it, and saved on your working map right away. When the cursor points at nothing, the light lands on the ground along your aim, or Config.Pointer.missDistance (20 metres) ahead of the camera.
A new light takes the values in the panel and is selected. While no light is selected, the panel shows The values here go to every new light you place, until you pick a light to edit. When you pick a light, its values become the values for the next new light as well.
The first lights use Config.Lights.defaults: a warm white point light with intensity 3 and a range of 10 metres, without shadows or effect.
Night preview
Placed lights barely show in daylight. When you open the Light tool while the in-game hour is between Config.Lights.dayStartHour (6) and dayEndHour (19), your clock is set to autoNightTime (00:30) and stops there: The clock is now set to night. Placed lights barely show up in daylight. Your normal time comes back once you close the editor.
- Only your own game changes. Other players keep the server time.
- The night stays until you close the editor, also when you switch to another tool.
- When
qb-weathersyncorqbx_weathersyncis started, the editor sendsqb-weathersync:client:DisableSyncto pause the time sync, andqb-weathersync:client:EnableSyncwhen the editor closes. Config.Lights.autoNight = falseturns the night preview off.
Selecting and moving lights
Every light has a handle: a small orb in the light’s own colour. The handles show in every tool while the editor is open, up to Config.Lights.markerDistance (100 metres) away and at most markerMax (80) at once. Lights that are off are drawn faint.
- Click a handle to select the light. With the Select tool, clicking a handle opens the Light tool with that light selected.
- The selected light gets a larger handle and a circle that shows its range. A spot light also shows a line along its beam and a ring at the end of it.
- Move the selected light with the move arrows of the gizmo, and turn it with the rotate rings (Move and Rotate in the top bar, or
G). Turning only matters for spot lights: a new spot light points level, to the north, until you turn it. Xdeselects the light.
Mouse wheel
With a light selected and the cursor over the world:
| Input | Changes |
|---|---|
| Mouse wheel | Range, times or divided by 1.1 per notch (Config.Lights.tuning.wheelRangeFactor). |
Shift + mouse wheel | Intensity, 0.25 per notch (wheelIntensityStep). |
Light settings
The panel changes the selected light, or the values for new lights when no light is selected. Changes are saved a moment after you make them. Every value stays inside Config.Lights.limits: the panel, the mouse wheel and the server all keep to them.
| Setting | What it does | Default | Range |
|---|---|---|---|
| Type | Point glows all around. Spot shines one way. | Point | |
| Colour | The colour of the light, see below. | warm white, 255, 212, 170 | 0 to 255 per channel |
| Range | How far the light reaches, in metres. | 10 | 0.5 to 250 |
| Intensity | How bright the light is. | 3 | 0 to 25 |
| Drop-off | How quickly a spot beam fades towards its reach. Greyed out for point lights: Drop-off only applies to spot lights | 2 | 0 to 25 |
| Cast shadows | The light casts shadows, see Limits and performance. | off | |
| Enabled | Off: the light is not drawn, but stays in the map. | on | |
| Name | Only shown for a selected light. Up to 64 characters; an empty field shows Unnamed light. Press Enter or leave the field to save it. |
Colour
Pick one of the seven colour temperature swatches, type a colour as #RRGGBB in the field next to the colour square and press Enter, or use the three sliders for red, green and blue. Hover a swatch to see its name:
| Swatch | Temperature | Colour (r, g, b) |
|---|---|---|
| Candle flame | 1850 K | 255, 129, 0 |
| Sodium street lamp | 2200 K | 255, 146, 39 |
| Tungsten bulb | 2700 K | 255, 167, 87 |
| Halogen | 3600 K | 255, 195, 146 |
| Noon sun | 5000 K | 255, 228, 206 |
| Overcast sky | 6500 K | 255, 254, 250 |
| Clear blue sky | 10000 K | 202, 218, 255 |
Spot lights
These show up when Type is Spot:
| Setting | What it does | Default | Range |
|---|---|---|---|
| Beam angle (from centre) | How wide the beam opens, in degrees from its centre line. | 40 | 0.5 to 89.5 |
| Hot spot (from centre) | A brighter part in the middle of the beam, in degrees from the centre line. It is never wider than the beam. | 15 | 0 to 89 |
| Rim sharpness | 0 gives a soft edge to the beam, 1 a crisp one. | 0.25 | 0 to 1 |
The hot spot is Config.Lights.tuning.hotSpotBoost (75%) brighter than the rest of the beam. The total amount of light stays the same.
Effects
| Effect | What the light does |
|---|---|
| Steady | Stays at full brightness. This is the default. |
| Glow | Fades smoothly down and back up. |
| Blink | Full brightness for half a cycle, dimmed for the other half. |
| Sputter | Jumps between random brightness levels, sputterRate (10) times per second at tempo 1. |
| Ember | Drifts smoothly between random brightness levels. |
For every effect but Steady, two more sliders show up:
- Tempo: cycles per second.
1is one glow or blink per second, from 0.02 to 24. Glow, Blink and Ember never run faster thanfastestCycle(8 cycles per second), and Sputter never jumps more than twice as often. - Dimming: how much of the brightness the effect takes away at its lowest point, from 0 to 1 (default 0.5). At
0the effect can’t be seen.
Every light starts at its own point of the cycle, so lights with the same effect don’t all pulse together. The effects follow the shared network clock, so all players see a light dim and brighten at the same moment.
The light menu
Right-click a light handle. The top of the menu shows the light’s name, or its number such as #12.
| Item | What it does |
|---|---|
| Copy next to it | Places a copy 1 metre along the X axis and 1 metre along the Y axis from it, and selects the copy. The copy has the same settings, but no name, and it is not turned: turn a copied spot light again. |
| Disable light / Enable light | Switches the light off or on. |
| Remove this light | Removes the light. |
You can also remove the selected light with Delete or Remove selected light in the panel. Alt + click on any handle removes that light at once.
Placed lights
Below the settings, Placed lights lists the lights of your working map. A light without a name is listed with its type and number, for example Spot #12. The list shows up to 60 lights; with more, it says showing 60 of 75.
| Button | What it does |
|---|---|
| Go | Flies the camera to 3 metres above the light and selects it: Loading the area… |
| Delete | Removes that light. |
| Clear all | Removes every light of your working map. |
Clear all has no confirmation. One undo brings all the lights back.
Limits and performance
Lights are not entities. Every player’s game draws the lights near its camera every frame, so lights cost a little performance for everybody, and the settings below keep that in check.
| Limit | Default | What happens |
|---|---|---|
maxPerMap | 320 | Most lights one map holds: This map has reached its light limit |
maxTotal | 3000 | Most lights across all maps: The server has reached its light limit |
drawDistance | 120 m | A light is drawn up to this far from the camera, or as far as its own Range when that is larger. It fades out over the last tuning.fadeDistance (8 metres). |
shadowDistance | 45 m | Shadows are only cast this close to the camera, and fade out before that. |
maxShadows | 8 | Most lights that cast shadows at once, nearest first. The game has 8 slots, so this can’t go higher. When a shadow moves to another light, it fades over tuning.shadowFadeMs (250 ms). |
tuning.drawBudget | 256 | Budget for the extra draw calls per frame that spot lights (one to three calls each) and fading shadows need. The nearest lights get them first. Once it is used up, every further light is still drawn, with one simpler call. |
idleWait | 500 ms | How often the game looks for lights again while none is in range. |
All of them are in Config.Lights and Light tuning.
Lights for players
- Lights are saved in the
bablo_mapeditor_lightstable and belong to the map they were placed on. Players see the lights of every enabled map. Switch a map off and its lights go out for players. - Light handles, the range circle and the beam line only show for editors while the editor is open.
- A map published as its own resource draws its lights the same way, without the editor. It takes only the lights that are on, together with the
Config.Lightsvalues at the moment you publish: publish again after changing them. The JSON export keeps the lights too. The other export formats leave them out: Lights are not part of this format and will be dropped. See Import, Export & Publish.
Undo
Placing, copying, moving, changing, switching and removing a light are each one step in the undo history, and so is Clear all. See Undo & Redo.
Settings
Config.Lights = {
maxPerMap = 320, -- lights a single map may hold
maxTotal = 3000, -- lights across every map
drawDistance = 120.0, -- a light stops drawing past this distance from the camera (m); a light whose own range reaches the camera stays lit
shadowDistance = 45.0, -- shadow casting stops earlier than the light itself (m)
maxShadows = 8, -- shadowed lights drawn at once, nearest first (the engine has 8 slots)
idleWait = 500, -- how often the renderer looks for lights again while none is in range (ms)
dropLift = 1.0, -- height (m) a new light is lifted off whatever you click on
autoNight = true, -- entering the light tool in daylight flips the clock to night so lights read
autoNightTime = { 0, 30 }, -- the clock (hour, minute) it switches to
dayStartHour = 6, -- daylight window that triggers the flip (hours, inclusive start)
dayEndHour = 19, -- ... exclusive end
marker = { 168, 200, 255 }, -- editor chrome colour for an unselected light
markerDistance = 100.0, -- how far the editor draws light handles (m)
markerMax = 80, -- most light handles drawn at once
markerSize = 0.18, -- handle radius (m)
markerAlpha = 140, -- orb opacity; the wire rings on top stay solid
-- ...
}| Setting | What it does |
|---|---|
maxPerMap, maxTotal | Light limits per map and across all maps. |
drawDistance, shadowDistance, maxShadows, idleWait | See Limits and performance. |
dropLift | How high a new light is placed above the point you click. |
autoNight, autoNightTime, dayStartHour, dayEndHour | The night preview. |
marker | Colour of the rings around a handle that is not selected. The selected one uses Config.Selection.colorSelected. |
markerDistance, markerMax, markerSize, markerAlpha | How far handles are drawn, how many at once, their size and the opacity of the orb. |
The rest of Config.Lights is explained on the configuration page:
- Light defaults: the values of new lights, and of saved lights that miss a value.
- Light limits: the allowed range of every value.
- Light tuning: how lights are drawn and how the mouse wheel changes them.

