Skip to content

Configuration

imshooter edited this page Oct 23, 2026 · 3 revisions

The settings live in config.json under 3dandreas. Every one is optional, and a missing one takes its default. These are the defaults:

"3dandreas": {
    "database": "scriptfiles/3dandreas/world.db",
    "models": "scriptfiles/3dandreas/models.json",
    "navmesh": "scriptfiles/3dandreas/navmesh.db",
    "threads": 2,
    "rate": 60.0,
    "sync_error": 0.1,
    "sync_horizon": 0.3,
    "collision_speed": 1.0,
    "bounce_speed": 0.1,
    "contact_distance": 0.02,
    "draw_distance": 0.0,
    "max_updates": 1000,
    "floor": -100.0,
    "vehicles": true
}

The map

database

The map database, relative to the folder of the server. When it is the default and the file is missing, the component reads scriptfiles/colandreas/ColAndreas.cadb instead, without surfaces, water and model data.

models

The model settings, relative to the folder of the server: the shape and the values A3D_CreateObject gives each model it lists. A missing file leaves every model with the collision of the game.

navmesh

The navigation mesh, relative to the folder of the server. A missing file leaves walks on the paths of the game, and the natives that ask where a pedestrian can walk fail. Leaving it out saves about 65 MB of memory.

vehicles

Whether vehicles take part. With true, every vehicle is a box the size of its model that moves with it, so physics objects bounce off vehicles and queries find them. A parked vehicle costs a check of its position on each step, about 4 milliseconds a second for a thousand of them, and a moving one is moved in the simulation too. With false, vehicles are left out of the simulation and of the queries.

The simulation

threads

The worker threads that share the simulation with the thread of the server. 0 runs it all on the thread of the server. More threads help with hundreds of objects awake at once. Queries always run on the thread of the server, inside the native that asks them.

rate

The steps of the simulation per second, at least 10. Each tick of the server runs the steps due since the last one, at most four, so a server that falls behind slows the simulation down instead of piling up work. More steps make fast and small objects collide more precisely and cost more.

floor

The height under which a falling object is stopped and A3D_OnStopped is called. It catches what falls through a hole in the map or off its edge.

collision_speed

The slowest impact, in metres per second, that calls A3D_OnCollided. A3D_SetCollisionSpeed changes it for one object.

bounce_speed

The slowest impact, in metres per second, that bounces. Slower contacts stop dead, which keeps resting objects still. Lower it when slow objects must still bounce off each other, as balls on a table.

contact_distance

How close in metres two bodies come before a contact between them is kept, ahead of the touch. The default suits nearly every use.

What players see

sync_error

How far in metres the object players see may stray from its body before a new move is sent. It also bounds the rotation: the object may turn away by the angle that moves its far end by that distance. A3D_SetSyncError changes it for one object. A smaller value looks more exact and sends more updates. See Physics objects.

sync_horizon

How many seconds ahead each move sent to players aims, at least 0.05. A move that would meet something before then ends where the object touches it. A longer horizon sends fewer updates while an object flies straight and needs more corrections when its path bends.

max_updates

The most updates of the objects players see that go out in a second, at least 10. Each one is a message every player who sees the object acknowledges, and past network.acks_limit, 3000 a second by default, open.mp warns and the game of that player falls behind and may crash. When more objects stray at once, the ones furthest off go first and the rest wait. Raise it only with a higher acks_limit.

draw_distance

The draw distance of the global objects the component creates. 0.0 keeps the distance the game gives the model.

Example

A server with many vehicles that does not need them in the physics world, and pool tables that need exact balls:

"3dandreas": {
    "vehicles": false,
    "sync_error": 0.05,
    "bounce_speed": 0.05
}

Home

Guides

Reference

Functions

Creating objects
Motion
Placement
Behaviour
Display and data
Rays
Shapes
Players, vehicles and actors
Map probes
Screen
Map objects
Water
Models and surfaces
Rotations and offsets
Vehicles
Routes
Route display
Walking
Callbacks

Clone this wiki locally