BallisticNG Track Tools

This is a page about the Ballistic Unity Tools.

This page covers the topic of how tracks are represented internally by BallisticNG and how you can use the track tools to configure your tracks.

## Track Format

### Tiles

A track tile is an imaginonary square that can be used for editing the surface ot the track. This includes the boost and weapons pads and pitlanes.

> **Technical**
>
>

A tile represents two triangles on the track mesh which forms a quad, tiles are tied to 6 indicies on the mesh and the quad is represented using 4 of those indicies. Tiles and the below mentioned sections are very closely tied to together, they require each other to work. When a ship wants to figure out which tile it's over, it checks which section it is currently at and then performs a distance check to each tile tied to the ships current section, the tile closest to the ship is the tile it's currently over.

### Sections

A section is a representation of two tiles, two tiles represent a part of the track. A section contains information regarding the centre and rotation of the track at that given point, width and height information is also baked in these.

> **Technical**
>
>

A sections width and height are baked by raycasting on either side of the section against the track wall iterativly. Ships figure out which section they are on by a distance check against all sections. Once it has an initial section that distance check is only performed on the surrounding 15 sections (30 in total). Each section holds a next and previous reference that can be used for iterating over them out of the section arrays order if edited, they can also hold a reference to a connected junction which are also included in the above 15 section distance check.

### Atlas

The track atlas is an extension of tiles, each tile contains an atlas index which points to UVs in a generated texture built from many different textures. This allows the track to be dynamically textured. Special tile types can be tied to a specific tile type so if you paint a speed pad for instance, then the tile you just painted will be automatically updated with the speed pad texture.

## Opening the Track Editor

The track editor is a tool which allows you to edit Tiles, Sections and the track Atlas. Once you have a track setup with generated data (see BallisticNG Scene Structure) you can access it by going to BallisticNG -> Track Editor on Unity's menu bar.

## Tile Editor

The tile editor is a painting tool which allows you to drag your mouse over tiles to edit their properties.

### **Type Painter**

The type painter allows you to paint what type of tile a tile is. The types available are Normal, Boost, Weapon, Recharge and Spawn.

The normal type does nothing and will be what most of the track is made from. The boost type is a speed pad, the weapon type is a weapon pad, the recharge type is the pitlane and the spawn type will be used as a spawn point for ships.

### **Wet Flag Painter**

The wet flag painter allows you to toggle whether a tile is wet or not. What this does is make a trail of water splash behind the ship.

### **Shadow Flag Painter**

The shadow flag painter allows you toggle whether a tile should act as if it is being shadowed or not.

### **Swooshable Flag Painter**

The swooshable flag painter allows you toggle whether the ship should play a swooshing wind sound when it passes over this tile at a fast enough speed. It is reccomended you set these if you have overarching scenery or small scenery pieces next to the tile.

## Section Editor

### **Type Painter**

The type painter allows you to paint what type a section is.

**Normal** - Normal section, most sections on the track will be this type.

**Jump**  - Indicates that this section is a jump, put this on the section before a jump. This is mostly used for camera positioning, it basically makes jumps feel better to fly over.

**Junction Start** - Indicates that this is the start of a junction, this should be set on the first section inside the junction (not the section that connects to it)

**Junction End** - Indicates that this is the end of a junction, this should be set on the last section inside the junction not the section that the junction branches back out onto)

> **Junction Logic**
>
>

Junctions are re-indexed when the track starts so they they represent the same indicies as a normal route. This makes more accurate race position calculating possible.

### Next Tool

The next tool allows you to update the next reference on a section. Click on a section to select it (it will turn red) and then hold control and click on another section. The section you initially clicked on will now rotate to face the second section you clicked on.

The Set Junction toggle allows you to set the junction reference, it works exactly the same as above. When a junction reference has been set the junction will have a second line drawn of it to show you the section it connects to. When the selected junction already has a junction reference set, a remove junction button will appear. Click this button to clear the reference.

### Metadata Tool

The metadata tool allows you setup other information regarding a section. The tools will only show up when you have sections selected. In this mode you can left click to select a segment, hold shift and drag to add more sections to the selection and hold control and drag to remove sections from the selection.

**Is Pitlane Entrance** - Set this toggle on a section connecting to a junction (this only applies to the first section in a selection) and the AI will know that the connected junction is a pitlane they can enter if they need to recharge shield energy.

**Is Maglock** - Whether this track section is a maglock. In 2280 mode this will lock the ship to the track, in normal mode this will remove the tilt restraint on the ship so it can pass through loops without gimbal lock.

**Rotation Muliplier** - This value controls how fast the ship rotates over a section, this is a multiplier so 1 is the normal speed.

#### Set Start Line

Click this button to place the start laser at the first section in the current selection. This is required as it serves as the actual start line for the track.

#### Set Mid Line

Click this button to place a second laser around the track at the first section in the current selection. This should be around half way around the track is required as it functions as a lap validator

## Atlas Editor

The atlas editor is a tool that allows you to paint textures onto the track.

### Tiles Mode

Texture mode allows you to paint textures onto the track. When you have textures added to the track you will see them here. Click on a texture to set it as the current texture to paint, when it is selected it will be highlighted cyan. Under each texture is an assortment of buttons that control the special type of the atlas texture. When you select a special type the button corrisponding to that type will become highlighted.

**Boost** - This texture will be automatically set for any boost tile types.

**Weapon** - This texture will be automatically set for any weapon tile types.

**Recharge** - This texture will be automatically set for any pitlane tile types.

**Spawn** - This texture will be automatically set for any spawn tile types.

**Wpn Rpl** - This texture will replace weapon tile type textures when not available (time trial, practice mode)

**Spwn Rpl** - Unused right now, but will be potentially used to replace spawn tile types in the future.

### UV Mode

The UV mode allows you to flip tile UVs on the track. The names are self explanitory and do not need explaining.

### Textures Mode

Texture Mode allows you to manage the textures on the track. Click new texture to add a new track texture to the list. Click the delete button next to the textures to delete them. Click on the images themselves to open the Unity object browser, from here you can select textures and once a texture is selected it will update the track texture. The left texture is the diffuse texture and the right texture is the illumination texture.

### Set Entire Atlas

With this toggle ticked the next edit you make will be applied to the whole track surface. This works indendantly for the track walls and floor.

## Adding textures to the track (manual)

To add a texture to the track you need to edit the track textures array, this can be found on the track data object (if you use the Track Wizard then it's the object called < Track Data >. Enter a value into the Track Textures size field and the array list will populate. Drag textures you want into the diffuse slots, if you have an illum texture then you can also drag an illumination texture into this. If you do not provide an illumination map then a default black texture will be generated.