Refining procedural track design: Environment and “flowtube”

Hello everyone, in the previous post we explained what is Camilla and its layer 1. At this moment, the track is drawn, recognized and rounded.

In the last chapter we found the closed broken line in a map of Voronoi’s cells and after recognizing the various topographies in the path (long bends, chicanes, zig-zag,  etc) with a set of mathematical rules, the map was “rounded”, using certain criteria related to the design of the track, the logical constraints (to avoid difficult or uncontrollable situations) and the playability of the whole track.

 

Screen-Shot-2015-06-26-at-18.32.18

 

In the above logical map you can see:

  • The broken lines definiing the closed circuit
  • The line of the track resulting from any “rounding” (grey)
  • The points with a strong rounding (usually in the green corners)
  • The starting point and its generated functional spaces
  • Variations created within the flowtube: escape routes, openings, structural noises…
  • The convex red line bordering the circuit which defines the inbound area.

 

 

 

Concept of “flowtube” for the procedural track generator

tflusso

The concept of flowtube, similarly to the concept used in fluid dynamics and electromagnetism, can also be associated to a racetrack. We define that as all the horizontal physical surfaces which can be ran over by the car and bounded by outer vertical walls colliding with vehicles. This is the closed volume defined by all physical surfaces and collision walls. In fact,, it defines the 70% of the vision of the driver while running on the track.

Now the layer 2 begins its work.

After this phase the track is perfectly defined when it comes to routing, smart rounding of the track zones and all types of bends, which are recognised and stored. Camilla now starts generating the different types of sections (find a more detailed explanation below) and refines the main features of the circuit.

Furthermore, Voronoi pattern leaves a series of cells which are very useful for defining areas contingent to the track. It’s really important that the engine stores all the cells within the outbound. These subsets are really useful for the next logical layers, where the areas and not-proximity objects (e.g.: architectural assets, stands, civilian houses, etc..) become the focus of generative algorithms.

The cells are also a source to generate escape routes, closed roads, alternate “closed” paths, hills and other heights within the path, exactly as it happens in reality.

 

Working on the flowtube: making it realistic, live, with escape routes, open spaces, never boring or repetitive.

One of the layer 2 tasks is making this flowtube more various and realistic as possible. The goal is giving the driver the feeling of an open scene and not a “gut” twisting along the track.

We made sure that Camilla generates flush-tubes with escape routes, spaces inside and outside the bends, zones with bounding walls (like in street circuits such as Montecarlo or a lot of classic American racetracks) and many other elements, creating almost endless combinations.

One of the layer 2 tasks is making this flowtube more various and realistic as possible.

The track width is another element which stems from the flowtube and affects two really important parameters:

  • Track speed and lap time: when you run on a track which is 3/4 meters wider than the others, you can be 5/6 seconds faster, using the same car, of course.
  • Playability in multiplayer mode: in multiplayer, the virtual driver has less perception of the competitors around him than in reality. This element makes all “wheel to wheel” collisions a lot more dangerous. If a driver challenges another one in a hard braking means taking several risks, and remaining side by side at each turn will bring to a collision or an accident in most of the occurrences. Have a look at a race on any high level simulator or a professional league like iRacing.

 

Escape routes (based on sand) and openings created for a zigzag section.
Escape routes (based on sand) and openings created for a zigzag section.

 

An escape area made by gravel generated outside of a long rounded turn.
An escape area made by gravel generated outside of a long rounded turn.

 

Camilla has opened an internal space in the corner. Don’t worry, the anti-cut system won’t allow you to go through it.
Camilla has opened an internal space in the corner. Don’t worry, the anti-cut system won’t allow you to go through it.

 

Management of the different types of sections: A, B and Bnc

Summarizing, the flowtube of the track must be really variable. Each area should be filled with elements such as:

  • Escape routes (sand, gravel, concrete, grass)
  • Marshall cabins and medical services
  • TV stations and operators
  • Stands or grandstands
  • Proximity assets as bridges, billboards. etc.
  • Proximity structures: kiosks, bathrooms, and other generic structures
  • Closed escape routes.
  • Others.

We want to avoid this kind of effect:

Screen Shot 2015-07-31 at 17.46.44

This is what we call a “gut repetitive” dug in a height-map. It could be suitable for a rally (if well-detailed) but not for a racing game where your goal is generating a realistic closed tracks, even if they don’t exist in reality.

 

The variety of the vertical elements: walls and others

In the vertical containment elements (such as the walls limiting the runnable area of the flowtube) we can find different types of vertical containment surfaces:

  • Concrete walls (different colors, different patterns)
  • Guardrails (different colors, different patterns)
  • Wall tyres (dynamically placed in the impact points)
  • Air fences (dynamically placed in the impact points)
  • A combination of the above elements

 

 

The edges of the track

Camilla can also generate many different elements related to the horizontal surfaces between the track and the outer containment walls:

  • Grass of various types, colors and noise
  • Concrete, in various colors and patterns
  • Gravel
  • Sand
  • Various types of kerbs, both aesthetic and functional
  • Concrete with lines and stripes with different size, colors and patterns
  • A combination of the above elements

 

Camilla can also generate similar patterns with dynamic colors, like in ultra-modern tracks.
Camilla can also generate similar patterns with dynamic colors, like in ultra-modern tracks.

 

The two sides of the track edges are not necessarily symmetrical (like in the photo above). Anyway, Camilla always tries to avoid “multicolor” with too much variety on the track that can destroy coherence.

Some examples of generation:

 

A "stripe average" with blue plot lines generated on a straight
A “stripe average” with blue plot lines generated on a straight

 

Minimal with tarmac and grass
Minimal with tarmac and grass

 

Another symmetrical pattern generated: a medium patch
Another symmetrical pattern generated: a medium patch

 

A classic side with a simple white thin line
A classic side with a simple white thin line

 

Note: Kerbs placement is done by routines completely different from those used for sides positioning. The type of turn, the ideal line and a random component are taken in account to place kerbs (6 different types, with random textures and colors) around the circuit (layer 3). To better understand this, think that simply changing the circuit from clockwise to anticlockwise, you will have kerbs (sometimes of a different type) placed in different positions.

 

 

Flowtube section types

 

Type A:

It may be asymmetrical or symmetrical. The vertical delimiter is on the track limits ,without spaces between. This creates traits similar to streets circuits and a lot of classic American racetracks.

 

Type A (symmetrical) with bridge. Camilla can also generate concrete walls in this case,
Type A (symmetrical) with bridge. Camilla can also generate concrete walls in this case.

 

Camilla could also generate walls, rails, fences and many other aesthetic elements. These sectors are difficult to drive and require lots of precision. Mistakes are heavily paid here.

 

Type B:

It may be asymmetrical or symmetrical. Some space exists between the track and the vertical surfaces in these sections:

 

Type B (symmetrical)
Type B (symmetrical)

 

In the above screenshot, you can see how Camilla generated a patch of grass along the walls/fences.

Camilla takes in account the topography of the current track section while it’s generating the track and avoids the general variety becoming too exaggerated (we will address this later),, creating a “carnival effect”.

 

Type Bnc. Non Conventional B type:

It may be asymmetrical or symmetrical. Camilla generates additional areas inside and/or outside used as escape routes, functional areas, marshall cabins, medical structures, and many other track buildings and elements.

 

A section with blue and white guardrails.
A section with blue and white guardrails.

 

The escape routes generated by Camilla can belong to various types which affect driving behavior when making a mistake: sand, soil, concrete, gravel, etc. Please have a look at some examples:

 

Classic double escape areas generated by Camilla on a wide chicane, with sand on both sides.
Classic double escape areas generated by Camilla on a wide chicane, with sand on both sides.

 

Camilla generates a space that widens at the entrance of a turn.
Camilla generates a space that widens at the entrance of a turn.

 

Small space generated by the engine inside a small straight to allow the placement of several structures, with gravel as covering material.
Small space generated by the engine inside a small straight to allow the placement of several structures, with gravel as covering material.

 

 

How Camilla will use next layers in these generated areas?

Placing assets like:

  • Stands near the track.
  • Marshall cabins and tractors.
  • Medical cabins
  • TV operators structures
  • Generic area with race direction and some characters.
  • Food kiosks, WCs, shops, megastructures, etc….

These zones will be placed and protected at a later time by dynamically created walls. These areas are considered the flowtube structural noises.

 

Please note: All the game screenshots in this article are from an early Racecraft Tech Demo (April 2015).