track design and construction - Nicky-Nice-Games/UnityProject GitHub Wiki
Track Design and Construction Contents
- Track Standards
- Track Files Repository and Storage Standards
- Steps To Completion
- Tutorial Master List
Track Design and Construction
This page documents the Level Design team's process and standards for building tracks. If you are a new member of the level design team, make sure to read though the whole page before starting to make a level.
Track Standards
Standard Measurements
- Standard track width of 40m unless when intended to be narrower or wider than normal.
- Beginning stretch 45-60m long to fit all karts and starting line.
- 5-10m of rough terrain on either side of the track.
- Mark the edges of the track with the red and white Side Bump model to denote where the track ends and rough terrain begins.
- More detailed instructions Here.
- Mark the edges of the track with the red and white Side Bump model to denote where the track ends and rough terrain begins.
Track Guidelines
Each track must contain the following:
- 1 shortcut only accessible via a minimum tier 1 boost item.
- 1 shortcut accessible via a minimum tier 1 offensive item.
- 1 minor and short alternative path.
- Path A is X seconds long.
- Path B is 2X seconds long, but includes item pickups.
- At least 1 Golden Brick spawn location.
Completion Times
Completion | With Items | Without Items |
---|---|---|
Full Track | 2-3 Min | 3-4 Min |
Per Lap | 40-60 Sec | 60-80 Sec |
General Rules
- Gravity faces downwards so no vertical loops or sharp elevation changes.
- Turns should be doable on the main track without the need to drift.
- Skips should only be intentionally placed in order to avoid the possibility of missing checkpoint triggers.
- In the case of branching paths, work to prevent players from going the wrong way after the paths re-merge.
Track Files Repository and Storage Standards
Repository Information
All tracks are to be stored in the Track Files repository for the convenience of the entire team. Push any progress to that repo at the end of the work day at the bare minimum. For best practice, push every couple of hours. You never know when a teammate may need a file you have been working on. Old versions are stored in this repository for ease of returning to an old version without having to dig through old commits. It is very helpful to copy an old version and start from there when making changes. It is much easier than restarting from scratch or trying to force a finished track into a new shape. It is important to perform a Save As after completing a major milestone of the track. If something were to go wrong, you can return to a previous version of the track to fix it when it is most efficient. Follow the naming convention below.
Folder Structure and Naming Conventions
The folders in the repository are listed as follows:
- A folder for each track
- containing 3 folders called Blender_Files, FBX_Files, and Sketches
- each containing the latest version at the base level, and a folder called Old_Versions holding an archive of previous versions.
- containing 3 folders called Blender_Files, FBX_Files, and Sketches
- A folder called MiscGreyboxingModels to store models made by the Level Design team for the purpose of greyboxing. It is sorted in folders for Blender Files and FBX Files. It is less important to save each version of these models, as
- Any more finalized models should be stored in the Content team's repository.
- A folder called PrototypeArchives that holds files for tracks that were used to learn track building, but did not get greenlit.
Naming Convention
- For Blender Files:
- TrackName_VX.Y_LastCheckpoint.blend
- Example: GolisanoCollege_V1.4_BankedCurves.blend
- For FBX Files:
- TrackName_VX.fbx
- Example: GolisanoCollege_V1.fbx
- There is no need to keep as many versions of FBX files, since they are an export of the completed versions. If you wish to save a different version, call it "-VX.Y.fbx" to differentiate it as newer.
- For Sketch files:
- TrackName_VX.png/jgp/pdf
- Example: GolisanoGollege_V1.png
- The file type is less important for sketch images, just make sure it is one that Windows and Mac machines can open by default.
- All naming conventions use underscores to separate components and CamelCase for words to keep names shorter.
Steps To Completion
Below are the steps to turn a racetrack from an idea into a usable game piece.
1: High Concept
- Start with a general idea of what the track should be. At MINIMUM this should be at least one of the below. For best results, fill out as many as possible.
- A general shape
- I.e. a simple loop
- A specific mechanic to highlight
- I.e. speed bumps to show off suspension physics, spirals for drifting
- A location to adapt:
- I.e. Golisano Hall
- A general theme
- I.e. Final exams
- A general shape
- Plan for a difficulty level to assign to each track. Read more about difficulty levels in Track Standards. A cup should ideally have one track of each difficulty.
- Note that this does not force the track to be of a given difficulty level. It may change later in the production process, especially during playtests.
2: Research
- For real locations, start by looking at maps of and around that location. Try and visualize where a racetrack might start, and how it laps back to that start. If there are any landmarks in that location, make sure they fall into this plan.
- Look at maps for other kart racing games. They are generally tried and true, and may help to spark some inspiration for the track you are working on. You may be trying to figure out a problem that has already been solved.
- Play a kart racing game! The best way to learn how to design tracks is to drive around some. Pay close attention to where you can find power-ups, shortcuts, and speed boosts.
- Mario Kart series
- LEGO Racers
- Crash Team Racing
- Sonic Racing Series
- Nightmare Kart
3: Level Sketching
- Adhere to graph paper if available, otherwise follow a consistent measurement following the Track Standards.
- If using graph paper, note the scale of the squares.
- Otherwise, mark the distance of each track segment.
- At minimum, sketch the top and side views.
- The top view is important for the general layout of the track.
- The side view is important to help gauge verticality and general side profile.
- Label the forward direction of the track, as well as the start/finish line.
- When adding track modifications, such as boost pads or ramps, use a legend to label the modifications.
4: One-Pagers
- Add some sketches for the track and use reference mood images to specify certain aspects of the track.
- Give a brief description of the feel of the track, any themes involved, and specific mechanics in mind.
- Label an intended difficulty.
- While the Dorm Room one-pager is the ideal layout, do not try to force your designs into that template.
- Multi-level tracks, such as Golisano College, can be put into a slideshow to give each level some space.
- The RIT Outer Loop track One-Pager is more of a moodboard with a map, which is also effective for communicating its intent given the amount of content.
5: Building in Blender
Getting Started
- Tracks are built in Blender using a plane with the Generate: Array and Deform: Path modifiers.
- Since a plane is flat and only has 1 face, it is easier to start working with. When needing to connect different track pieces, there are only one set of vertices to connect. The track will be extruded later to have some depth.
- Add a plane and modify it to be 40m in the X direction and 5m in the Y direction.
- Select the plane, open Edit Mode and use the Loop Cut tool to make 8 subdivisions. Return to Object Mode.
- Adding subdivisions is important for keeping the track smooth. Without subdivisions, lifting the track results in a blocky shape that functions like a ramp. This sends the kart into the air, preventing any steering or drifting.
- (INSERT IMAGE OF SUBDIVIDED PLANE NEXT TO ONE WITHOUT)
- Create a Path, open its Data panel and change the Twist Method to Z-Up.
- Scaling the path is optional, it mostly just helps to see it better. If you choose to scale it, make you scale the Z-axis as well. Otherwise, the track will twist in on itself.
- Setting the Twist Method to Z-Up prevents the track from bending in unforeseen ways when it lifts off of the base level.
- Open the modifiers menu on the plane. Click Add Modifier, and under Generate, click Array, and check the Merge Checkbox.
- The Array modifier will duplicate the plan a specified number of times, to reach a specified distance, or to fit a curve. All of these options are viable.
- Checking the Merge checkbox ensures that the track will be a single piece after applying this modifier later. Otherwise, you will have several identical pieces.
- Click Add Modifier again, and under Deform, click Curve. Place your Path into the Curve Object slot.
- This modifier will bend your duplicated track segments into a desired shape.
- Finally, you are ready to start extruding your path into the desired shape. To make a new point, select the path, switch to Edit Mode, select the farthest end and press the ‘E’ key. Drag this point to the desired location, click, and repeat until you have made your track. Tips and best practices on more specific elements will follow this section!
- Lastly, any points in the path can be selected and moved with the ‘G’ key.
STOP AND READ THIS TIP: If there are a lot of items in your Blender File to organize, do not use Blender’s Collection system. Collections will not be read by Unity, and your organization will be undone! Unity will sort all objects alphabetically. Instead, create empty objects to be the parents of any objects you want to be sorted. These empty objects will be recognized by Unity, and will keep your organizational structure intact.
Making Curves: Best Practices
- Do not make a path that goes directly from a straightaway into a curve. Always add another point just before the curve starts. This prevents the curve from inadvertently bending the straightaway segment.
- Curves should be banked towards the inside. Select the points that make up the curve and use CTRL+T to tilt them. Do not tilt more than +/- 7.5 degrees to keep the curve easily traversable and to prevent extreme track steepness.
- Some curves will bank in the positive direction, others in the negative. The correct direction is always towards the inside, with the narrower part of the curve lower than the wider part. (INSERT IMAGE HERE)
- After banking, the points that were tilted may need to be lifted upwards by a meter or so to stay level with its original position.
- Curved track that moves upwards can end up with difficult to fix overlapping sections after banking, as pictured below. The best way to fix this is by banking the points more so that the top and bottom are more level before applying the modifiers. Then, it will be much easier to merge the vertices to ensure a smooth track.
- After merging, track pieces may intersect each other. The quickest fix is to enter edit mode, select vertices of intersecting faces, press ‘M’ to open merge options, and merge to center. This should smooth the track back out, and the vertices can always be manually adjusted.
- (INSERT IMAGES OF BEFORE AND AFTER).
- As mentioned in Track Standards, turns should be doable without needing to drift or leaving the main road.
6: Export and Import into Unity
Exporting from Blender
- Select all track pieces in Object Mode and enter Edit Mode.
- In Face Select Mode, select all faces (shortcut 'A' key).
- Extrude the faces (shortcut 'E' key) downwards 0.25m-0.5m (i.e. -0.5m Z-axis).
- Select all faces again and open the Normals window (shortcut 'ALT + N') and select Recalculate Outside.
- This ensures that all faces point outwards. Otherwise, they will be invisible and not receive the proper collider in Unity.
- Return to Object Mode, save the file, go to File -> Export -> FBX, and follow the tips below.
- If there are objects you do not want to export, Blender has options to export a limited number of objects.
- Hide the objects you do not want to export and check the Visible Objects box in the export window.
- Select the objects you DO want to export, and select the Selected Objects box in the export window.
- Move the objects you want to export into a separate Collection, select the Collection object, and select Active Collection in the export window.
- In the Squadaloo tutorial, he recommends changing the scale of the export to 0.01. You can still do this, but Unity does this by default. In Unity, you will have to uncheck the box that says "Convert to Scene Units".
- If there are objects you do not want to export, Blender has options to export a limited number of objects.
Import into Unity
- Drag and drop the FBX file into the Unity project folder named Tracks.
- The track model will be imported as a Packed Prefab containing all of the individual pieces in the FBX file. These pieces cannot be reordered in Unity's hierarchy, but they can still have their own unique Unity components like scripts, materials and colliders.
- To unpack the prefab, it must first be added to the hierarchy. Then, right-click and select Unpack Prefab. The track can now be reordered, but will no longer update when changes are made to the original prefab.
- To add the track to the scene, drag it from the Tracks folder into the hierarchy.
- This way, the track model will be at position (0,0,0) without requiring further action.
- Begin working on your track in the LD (for Level Design) scene. The GSP scene for implementing gameplay. This way, work can be done in both scenes without causing merge conflicts.
7: Greyboxing
-
Add any notable structures as basic geometry to the track
- Give these structures basic Unity colliders if the player is expected to touch them
-
Ensure measurements are appropriately scaled for unity in the tracks import settings
-
Apply dev textures to the road and applicable structures (see Texturing below)
-
Greyboxing can be done in either Unity or Blender, whichever works best for you.
Greyboxing in Blender
Blender offers more precision for modeling than Unity due to its measurement tools. Blender is especially helpful for greyboxing indoor spaces on tracks. All greyboxed elements can be exported in the same FBX file as the track, or in their own file(s). Below are some tips and guidelines to use Blender effectively for greyboxing.
General
- To organize assets, parent them to empty objects in Blender. Blender's collections do not transfer over to Unity, but empty objects do. Unorganized assets will be sorted alphabetically in Unity by default.
- Greybox flooring and/or ground should be approximately 0.2m lower than the track. This prevents the track and floor from clipping through each other. It is safe for the floors to cut through the middle of the extruded track, the colliders will not cause issues in Unity.
- For best results, set your Blender view settings so that Clip Start is 0.5m. This way, it will be more obvious where the floor and track are clipping through each other.
- For the sake of your future self and others, use a more explicit naming convention than "Wall 1", "Wall 2", etc. Name an object what it is supposed to represent, and potentially include the name of the material it should have in Unity.
- In Unity, components inside the prefab imported from Blender will remember their Z-axis as up.
Indoor Spaces
- First off, note how tall the space should be. The kart is about 5.5m tall, and you will want at the bare minimum 2m between the top of the kart and the ceiling. 10m is a safe height, even if the track lifts a few meters off the ground.
- Flat surfaces like walls, ceilings and floors can be made out of a plane if they can only be seen from one direction. Otherwise, it is best to use a rectangular prism over multiple planes to represent one such surface.
- Example: In the Golisano Gridlock track, the ceiling tiles around the open atrium are rectangular prisms because the player can see them from several angles and expects them to have some thickness. But most of the outer walls are planes because the player cannot see them from any other angle.
- Note that in Unity, planes can only be seen from one side. For example, if the camera moves into a wall, the player's view will not be obstructed. However, you should ensure the camera does not show only the skybox should this happen.
- Also very important to note that mesh colliders on planes tend to be one-sided, so players can pass through the invisible back. It is best to use box colliders to prevent this unwanted behavior.
- For multi-level tracks, ceiling tiles should be 0.01m lower than the bottom of floor tiles. This distance is small enough that players will not notice, but large enough that Unity will not try to render them on top of each other, resulting in visual glitches.
- Since these floors and ceilings are in close proximity, only put colliders on the floors when in Unity. Giving the floor a box collider will allow it to handle the above ceiling's collisions while lowering resource usage.
Placing Side Bumps
The red and white Side Bumps are used to mark where the main track ends and rough terrain begins. It is most efficient to place them in Unity using the following method, but they can be placed in Blender using the same method as building the track (via Generate Array and Deform: Curve).
- Locate the Arrow Barrier Prefab in your version of the Unity Project.
- It should be in the Prefabs folder, under Greybox Prefabs
- Start by Building a Spline by following This Tutorial.
- Tip: Do not try to get the Spline Knots placed exactly where you want them, the snapping is not precise enough for that. Start with the general shape and adjust them later. Holding CTRL will allow for more precise snapping.
- Add a Spline Instantiate Component to the spline. Under Items to Instantiate, click the '+' and put the Arrow Barrier Prefab into the slot.
- For best practice, also set the percentage to '100', but since this is the only mesh, Unity will default to 100 instead of the printed value.
- Set the Instantiate Method to be Spline Distance and set the value to 1.
- A larger distance value will increase the distance between meshes, but this asset works at 1.
- Add position offsets at your own discretion to help the side bumps along with the track.
- X-offset will move the bumps closer or farther from the track.
- Y-offset will move the bumps above or below the track. You may want an offset of 0.1m on some splines.
- Z-offset will move the bumps further along the spline, helpful for getting pieces to line up properly.
- Lastly, double check around the spline to ensure that there is minimal to no space between the arrow barriers and the track.
Placing Guardrails
Guardrails are used to prevent karts from falling off the track in unintended places. They can be built with a Spline Instantiate Component and by following the same process as placing the side bumps above.
- Important Note Splines can have multiple Spline Instantiate Components if you found it more efficient to place guardrails and sidebumps at the same time. You will not have as much control over either, but you will save time.
- Do NOT try to add them to the same Spline Instantiate Component, as the models will alternate rather than both fully populating the spline.
8: Texturing
- Final texturing should only be done when you are 100% sure that no more changes will be made to the track or environment.
- Until then, only use dev textures on all parts of the track.
- Dev textures should follow the specifications of Content Team, typically 64px64p, with an associated name, such as road or grass.
- Dev textures can be as simple as a solid color background with centered text describing the material (ie. tan background with the word “Apartment”)
9: Test and Iteration Loop
- A level is never truly “finished”, it can always be improved. However, there comes a point when the improvements are so minor, they are no longer worth the effort. The goal of a level designer is to reach that point. This happens by testing, both internally and externally.
- For details on setting up the track to be playable, consult the GSP team's instructions here.
Tutorial Master List
Blender Tutorials
Building a Track in Blender Tutorial Thank you to Squadaloo for making this video! UV Unwrapping in Blender 4.3 Fixing Blender "Slow Zoom"
Unity Tutorials
Unity Draw Spline Tutorial Unity Convert Spline to Mesh Unity Populate Models Along Spline GSP's Tutorial on Track Setup