Camilla: Sim Racing Tracks Procedural Engine

Procedural programming is a programming paradigm, derived from structured programming, based upon the concept of the procedure call. Procedures, also known as routines, subroutines, methods, or functions (not to be confused with mathematical functions, but similar to those used infunctional programming), simply contain a series of computational steps to be carried out. Any given procedure might be called at any point during a program’s execution, including by other procedures or itself. Procedural programming is a list or set of instructions telling a computer what to do step by step and how to perform from the first code to the second code.

“In computer graphics, procedural generation is generating content algorithmically rather than manually. In video games this means graphic content for a game can be created by the host computer, instead of pre-rendered artwork being included with the game package.

Since I was a kid, I’ve always been fascinated by all those games using procedural techniques to create scenarios and contents. As a game designer, I consider procedural technologies as something allowing creation of games with endless and always different contents.

Procedurality is the only road to follow when it comes to VR.

If we have the chance to create an infinite number of contents, experiencing them with immersive devices, it’s very easy to understand that procedurality is the only road to follow to reach deep experiences in Virtual Reality:

Virtual Reality (VR), which can be referred to as immersive multimedia or computer-simulated life, replicates an environment that simulates physical presence in places in the real world or imagined worlds. Virtual reality can recreate sensory experiences, which include virtual taste, sight, smell, sound, and touch.

Immersion into Virtual Reality is a perception of being physically present in a non-physical world. The perception is created by surrounding the user of the VR system in images, sound or other stimuli that provide an engrossing total environment.

During all these years, as a racing enthusiast, I always looked for games where I could race on tracks which were always different. I played several interesting titles, with good track editors or casual games with a procedural concept but which weren’t true racing games. I really love Trackmania, but I can’t consider that as a pure racing game, something that can be satisfying for hardcore simmers who love playing Assetto Corsa, iRacing, Rfactor and other similar titles.

The possibility of procedurally creating “realistic” racing tracks has never been developed in a proper way, because it requires two really important skills:

  1. Knowing all technical and structural limits, but also all those calculations you should perform.
  2. Having a deep knowledge of sim racing and real racing, real circuits, Tilkodromes and all their features.

If one of these elements is missing, it’s very easy to create incomplete products. The majority of procedural algorithms I have seen until now are based on two elements to generate their output: customizable terrains with varied height maps and splines (in all their shapes):

Customizable terrains with varied height maps and splines
Customizable terrains with varied height maps and splines


In my opinion, the outcome of these techniques is unrealistic and not fit for real racing games.

Using a spline as a logical instrument to create tracks is a very big mistake.

Splines are polynomial functions whose value/weakness is softening tracks, making them really annoying for a driver, who is continuously forced to keep his driving wheel steered, especially in sim and mid-sim games. When a player uses a digital or an “almost digital” controller such as a joypad in these kind of games, he will perform continuous corrections and his driving “comfort” will enormously be affected.

You need to be different from real tracks, where straights without curves exist. It may seem strange to hear about curve straights, but this is the way we define all those parts of the track where you go through at full throttle, even if they are not geometrically straight. If you don’t have real straights in your tracks, being always steered is a big handicap for the average player.

A different vision should be employed to randomly create some realistic tracks. I started from the bottom, with a different concept. While I was exploring procedural algorithms to create buildings and cities I found what I was looking for: something more “natural” which could generate tracks on par with reality. The algorithm is called Voronoi. It has very simple math principles and gives really impressive results.

In mathematics, a Voronoi diagram is a partitioning of a plan into regions based on distance to points in a specific subset of the plan. That set of points (called seeds, sites, or generators) is specified beforehand, and for each seed there is a corresponding region consisting of all points closer to that seed than to any other. These regions are called Voronoi cells. The Voronoi diagram of a set of points is dual to its Delaunay triangulation. Put simply, it’s a diagram created by taking pairs of points that are close together and drawing a line that is equidistant between them and perpendicular to the line connecting them. That is, all points on the lines in the diagram are equidistant to the nearest two (or more) source points.

20 points and their Voronoi cells
20 points and their Voronoi cells

More than a year ago, we decided to use Voronoi as starting point for the new procedural engine.

Another important element we should keep in account is that in a “mathematical circuit” you don’t have references for kerbs, escape routes, HUD driving aids, speed traps and placement of grandstands, billboard or other assets.

Everything should be calculated by specific algorithms and the mathematical and physical framework for such an endeavor is enormous. Unlike several other games where tracks are replicated from reality using laser-scan technologies (so, every tiny bit of the real circuit is reproduced), Camilla builds and places every element using maths.


Camilla is our new proprietary procedural engine.

The synergy we will be able to create joining procedural tracks and race strategies will give great prestige to the procedural technology. I also believe that E-Sports, in particular E-Racing, has a chance to part from brands and real circuits and start its own new life.


Quotes via Wikipedia