Making tracks
This guide will try to completely cover making and editing tracks in an organized and easy to follow way.
Contents |
Separate sub-articles
These articles contain additional information you might want to use.
For STK 0.6* a high-level track editor can be used, without the need to do any 3D modeling. The track editor is unsupported, and will not work for the irrlicht version of STK:
Modelling :
- Style_Guidelines
- Blender_track_modelling_tutorial
- How_Steve_Baker_makes_his_tracks (somewhat outdated)
Other languages :
Getting ready for 0.7 : 0.7 will feature somewhat different track formats; this should soon become the official way to do things, but meanwhile look at :
Planning
You might be tempted to skip planning, but they take little time, little effort, and you will get much better results! Unless you have a scanner or camera, you should make your design on the computer.
- First, decide if you are going to work on an existing track or create a new one:
- Working on an existing track has the advantage that everything is already in place so it is easier to get started. Usually, there are quite a few bits and pieces in existing tracks that need to be improved or fixed, which would be a good start for you. It is best to contact the mailing list to make sure no one else is currently working on the tracks you are interested in.
- We are always interested in new tracks, so if you are confident in your abilities go ahead and create a new one. However, please consider the guidelines here on how to create a high quality track.
- If you are making a new track, decide on a theme for your track. It's a good idea to share textures and objects between tracks, especially if they have similar themes. For example, palm tree models for a beach track could also be used for a jungle track.
- For each track, sketch the actual roadway - showing bridges, tunnels but little else. This will give a rough idea of scale, track length, etc.
- Avoid making the tracks too narrow. In these tracks it's very hard overtaking other players.
- Avoid very high slopes (and even moderate slopes). Those are boring to drive since you go slowly. They also cause problems with the physics engine. (Tracks don't need to be flat of course! Just don't overdo it)
- Good tracks should have some long straights, so leading karts can be attacked on a high distance. A track that turns all the time is not fun.
- For each track plan, mark out major areas and where they are (e.g., for the beach theme - where is the ocean, where is sand, where are there cliffs, etc.)
- Make sketches of how the major areas would look on the screen.
- Make a list of the textures and 3D objects (like palm trees).
- Announce your plans in the mailing list. See the Contact us page to find the e-mail address. If you want to share your design with us we might even want to put it in the wiki to aid other artists. Contacting us first will avoid disappointment in case someone is already working a track with your theme (and we might decide that each track should have a unique theme). We might consider offering an additional track package with more (and potentially duplicated) tracks, but that is not fully decided yet.
Notes:
- Avoid the possibility of unwanted shortcuts. Any shortcuts or alternate routes should be planned by you, not accidental, the player should not discover a way to take a shortcut that you didn't create on purpose (like jumping small obstacles).
- It should be easy for the player to know at all times which is the direction of the road; try to avoid making all the parts of the track look alike. That is part of the reasons to have different major areas.
- Be aware that textures are only visible from one side. Avoid having objects or karts floating in mid air when watching the race from a different point of view.
Get the tools
- Check the Tools page
- You will need at least a 3D modeler and the track export script.
Track modeling
- Article Blender track modelling tutorial will get you started with modeling in Blender.
- Alternatively, article How Steve Baker makes his tracks will introduce you with a different method. This article is a little outdated but can nonetheless be useful.
- If you wish to use another modeling tool you probably can, but in the end you will probably need to import your model into blender because SuperTuxKart uses a blender export script to generate the necessary files. We have experienced problems with importing/exporting models from Wings3D, so for now it does not seem possible to use this modeller.
- As a default karts start at X = 0, Y = 0 (FIXME: I'm not sure this is still true!) and they are dropped from a small distance to the ground; so at the beginning of the track, it must always be a little below Z = 0; For 0.7 you will be able to change the starting positions and headings of karts, but if you align your track like this it will generally be less work and trouble.
- Objects with local transformations may get exported weirdly (FIXME: I'm not sure this is still true!), it's best to apply the transforms to the mesh before exporting (select all, then do space >> transform >> clear/apply >> Apply scale/rotation)
Texture information
All textures have to be in either png or jpg format. Please favour quality over size - so usually use png, but especially for larger textures if the difference is not really visible in the game use a higher compression (e.g. jpg).
All images and textures have to obey the rules for OpenGL texture maps - they must be even powers of two in size (i.e. the X and Y dimensions must be 2,4,8,16,32,64,128,256,512). You can have rectangular texture files (e.g. 128x64).
Whilst the limit to the size of a texture map is fairly large on modern hardware (most can support 2048x2048 or even 4096x4096), we try to make STK runnable on older computers, too. So try to limit the texture size to 1024x1024 or even smaller if possible.
Textures are ALWAYS MIPmapped and displayed using the highest quality settings.
- Textures have special properties in STK, which can be edited in the file materials.xml, but if you only want the default values you don't have to add your texture to that file. FIXME: we still have to document the attributes used.
Making drivelines
For the AI, the mini-map display and to determine the current ranking of the karts STK needs to know the "shape" of the road. This is what is provided with drivelines. The drivelines concept and how to create them in blender are described on a dedicated new drivelines page.
- The AI tends to drive very close to drivelines, so if near the side of the road there is a wall it could bump on or a hole it could fall in, it is recommended to move the drivelines about 0.5 units towards the center of the road.
- It is important that the drivelines' height is the same as the real track's model. If the game detects that a kart is under the driveline, it will think it's under the road, which among other things, can seriously screw up the artificial intelligence's driving.
- However, putting the driveline under the road will cause other kinds of issues. It's often best to put each driveline point very slightly above the ground.
Exporting the track
After this, you need to use the track export script.
FIXME: all of this needs to be updated for the new script!
- In blender, switch a pane to Text Editor view (it is often convenient to create a new view for that so that you can quickly switch from model to export script)
- Load file Track_export.py.
- Alternatively, just install the script in your .blender/scripts directory, then it will be available from the export menu (please consult the blender documentation to find where the script should go on your system).
- Execute it by hitting alt+P (or using menu Text > Run Python Script)
- Use the Browse button to go to the directory where you want to export the files
- Hit the Export button to generate the files
Special case : arenas
STK 0.6 (and current SVN) introduces a battle mode which takes place in arenas rather than race tracks. Arenas are done very similarly to tracks, except that you do not need to create drivelines. Also, add a few empties named 'START' around the arena, they will mark places where karts may start. Once you exported the model(s) and .loc file, create the .track file as you would do for a regular track, but add the line "(arena #t)" to it FIXME: not relevant anymore, we're not using LISP, update for our new XML files



