The words, Doc! What do they mean?!

As promised in the previous post I’m here today to teach you some words! Well, you’ll know most of the words already. But I’ll tell you what exactly I mean when I use them in the upcoming articles about X4’s mass traffic system.

Waypoint

Waypoints are usually defined in an object’s asset. The properties mass traffic cares about are their positions, tags, and links to other waypoints.

Each waypoint can have links to one or more other waypoints. For mass traffic, these links define possible lines of movement. They’re placed by artists to not pass through anything that could be blocked.

Octree

An Octree is a useful data structure to subdivide a space efficiently. In our case an object’s octree is created using its collision shape, marking every part that contains something collidable as blocked.

Graph

The mass traffic system creates a so-called Directed Graph during initial setup. It’s specifically designed to allow running the A* algorithm for path finding.

Road

A road is a one-directional connection between two linked waypoints.

Flow

A flow is a complete path leading from a start dock to an end dock, using a sequence of connected roads. A road can be used by multiple flows.

It also has a spline, a sequence of Bézier curves, that defines ship movement.

Movable

A movable is a representation of a mass traffic vehicle. It contains minimal data: a pointer to its flow, the launch time, a pointer to the graphical data, and (very) few other bits and pieces.

Agent

An agent is a movable that has left its predefined flow and is now acting under full AI logic. It’s now a “real” ship with a pilot and a physics body, not fundamentally different from any other ship in the game

Zone

A zone is a section of space. They’re largely invisible to the player, with the exception of highways, but there are many of them in every sector. Objects are usually children of zones, with few exceptions like docked ships.

Their primary purpose is to quickly filter visibility. A zone that’s too far away from the camera can be entirely skipped when determining which objects to render1. Physics, animations, sounds, and many other costly systems are also disabled unless an object is in a visible zone.

Network

The network is what contains all the roads, flows and movables. There are two basic types of network:

Static networks are always created for an entire zone. They include waypoints from all static objects like stations. They mostly consist of decorative traffic, but a small part also has a function.

Dynamic networks are more functional. There can be several per zone, often one per object (usually a ship or a station) that’s exchanging wares, constructing, repairing or dismantling. They can move with an object, e.g. if they belong to a capital ship that’s using its repair drones.


  1. There are a few exceptions to this, like rendering jumpgates and stations sector-wide at the lowest possible level of detail, without any animations or effects. ↩︎