All updates
News

Devlog: Track Editor 1

View on Steam

I'm going to add a track editor to NEODRIVE. I don't foresee it being completed by 1.0, but it will be likely completed shortly after.

Before I start working on the track editor, however, I wanted to make something almost as important: an item importer.

The Item Importer

This is a custom content generation system with Steam Workshop integration, similar to the Livery Editor. With it, you'll be able to model and import your own 3D track pieces to use in the track editor, and publish them on the Steam workshop. The track editor update will ship with a bunch of premade items, so you won't need to model your own track pieces in order to build tracks.

I'm building it before the Track Editor because I'll be, to use the programming phrase, eating my own dog food. All assets available for use in the Track Editor will be created using this item importer workflow, which has two advantages:

  1. I don't take any shortcuts by making these assets in Unity and instead have to make a robust, user-friendly editor that I'll be using a lot while I make track pieces.

  2. Cleaner code that doesn't have to differentiate between "track pieces I added in the Unity engine" and "user-generated track pieces added via the item editor."

Here are screenshots of what it looks like currently. I've remade the orange track with no walls completely from scratch.

It's taken me a few weeks to get this far, but the item editor is pretty powerful. Some of its cool features include:

  • Importing 3D models with separate meshes for different LOD levels and collision

  • Editing up to four material slots per model

  • Selecting different shaders (Normal, Outlined, Alpha Dither, Alpha Cutout) per-material

  • Human-readable json config files for everything that you can edit outside the game

  • Importing custom textures for albedo, highlight mask, and emission

  • Combining multiple track segment models into a single addon, called an Item Pack

To expand on that last one, I'm treating user-generated content as something called an Item Pack. Each Item Pack can have many different items in it, that all reuse the same materials. So if you're making a few different rocks that all have the same shader, or a few trees, or track segments, packing them together has multiple advantages:

  • Fewer Steam Workshop addons to manage

  • Reusing materials lets you edit the look of all items in the pack at once

  • Reused materials load faster and have a lower memory footprint

  • You can switch between different items in the same pack inside the item editor, instead of loading a new item every single time

For example, for the Item Pack that contains this track, I'll be adding another item to the pack that's a nighttime version of this track. I'll use Material C in the first material slot of the imported 3D model, which will be a copy of the orange Material A, except it'll have an emissive texture to mimic the lights being cast on the track. You can see tracks like this in Night Loops, for example:

One thing that might be a pain is the material parameters. I'd have to copy everything over from Material A to Material C, all the colors and float values. It'd be a pain to do in the UI by editing a value, scrolling back up to look at the next value, and then setting it to Material A's value.

Fortunately, all the material parameters are exposed inside the material's folder as params.json.

Here's what it looks like:

{

"_Cull": 2.0,

"_StepHighMid": 0.5,

"_FeatherHighMid": 0.001,

"_StepMidShadow": 0.5,

"_FeatherMidShadow": 0.001,

"_LightHardness": 0.5,

"_SpecSize": 0.03,

"_SpecGloss": 0.01,

"_RimPower": 3.0,

"_RimIntensity": 0.41,

"_RimBlending": 1.0,

"_Color": "#FFFFFF",

"_HighlightColor": "#F5A266",

"_MidColor": "#DA5930",

"_ShadowColor": "#8C3616",

"_SpecColor": "#FFDD90",

"_RimColor": "#9CD4BA",

"_EmissiveColor": "#000000"

}

So instead of doing it all in the UI, I can just copy the contents of this file from Material A to Material C's folder, and then just refresh the pack inside the game and modify the Emissive Color value.

I'll be encouraging people who are generating this content to modify the files directly by including buttons to open the parameters/manifest file of the thing you're currently editing and supporting hot-reloading of parameter files when tabbing back into the game.