BL4 : creation and exportation

1) Design
2) Mapping
2.1) Creation of the material
2.2) Application
2.3) Mapping coordinates
3) Parameters
3.1) Luminosity
3.2) Surface Properties
3.3) Sectors visibility
4) CP and start positions
5) Summary

1) Design
- We will not talk about design techniques into 3Dsmax4 here. We will simply talk about the constraints :
A Pod track is composed with one or several objects called meshes. (we will call them sectors : you can look at the original tracks dxf files to make you a better idea of tracks cutting up).
The exporter (see below) allow you to select : the scene's sectors you want to export (1) , a TGA file for the background (2), a TGA file for the sky (3), a TGA for the lens flare (4), eventually a ITA file for animated textures (5), the 16 car start positions (6) and the 8 checkpoint positions (7), and finally an option "Quadrilaterals Optimization" (8).
* If this option is marked off, all exported sectors will have to be composed with ONLY triangles or quadrilaterals. A polygonal with more than 4 sides will provoke an error. This option (greatly recommended!) ask some rigour into the track design but it allow to greatly improve the exportation (the number of faces will simply be divided by two).
* If this option isn't marked off, there will be no design constraints at all.

2) Mapping
- Textures to use are 256*256 pixels TGA 24 bits. There are no theorical limit on the number but over 20, graphic bugs risk to appear in Glide mode.
- You have to create only ONE material composed with sub-objects. Each of these sub-objects will represent one texture. This main material will then be applied to all sectors to export.
2.1) Creation of the material
- Into the material editor, create a new material (0) (or choose a free slot and click on the "Standard" button (1) ) then in the new window pick the "Multi/Sub-object" type.

- Define the number of sub-objects (it mean in fact the number of textures you will use) (2). Of course you will be allowed to modify this after if needed.
- Then affect different colors to each sub-objects. It isn't needed but it's really usefull to see them clearly and select them easily into the scene (3).
- Click on one of the sub-objects button (4) to edit this sub-object.

* Look on the right of the sub-object color affectation (3), if these spaces to fill aren't marked off, you will not see the textures appear into the scene but just the color you assigned to them. So, if you want your textures appearing into the scene when you're designing, you have to mark them off.

- At first, the submaterial is standart grey (huh...here it's textured but make as if it was grey, please...I don't want to do this screenshot again ;)
- Note that this arrow (5) allow you to go back to the sub-objects list. For this you have to be in the "Material Editor" window and not as on the screenshot into the "Material Map/Browser" one...that's why the arrow is grey on the screenshot...sorry..again ;)
- Below, unroll the "Maps" thimble and click the button on the right of "Diffuse Color" (6).
- In the new window, select the "bitmap" type and validate it.

- A new window appear then to ask you to choose the bitmap file. Pick one of your TGA 256*256 texture and validate.
- The TGA texture is now associated with this sub-object. Click twice on the "previous" arrow (5) to go back to the sub-objects list ).
- Now you just have to edit all the other sub-objects in the same way than first one. Each sub-object with a different TGA...of course...
- When this is finished, select your sectors and affect them the main material you created (either by dragging it into the scene or with the appropriate button (7) ).
- Now you will have to precise, for each polygonals of each sectors, wich sub-object (=texture) to use. We'll see how to do this now.
2.2) Application
- Select one sector of your track.
- In the thimble "Modify" (8), unroll the menu "Modifier List" (9) and choose "Edit mesh".
- Select "Polygon", either in the tree of the "Edit Mesh" modifier (10) or with the appropriated icon in the "selection" thimble (10).

- You are now able to select one or several (with the Ctrl key) polygonal of your sector.
- Look for and unroll the "Surface Properties" thimble (it's the last one).
- The "Material ID" square allow you to choose a sub-object ID that's you defined in point 2.1. Set it up. If you assigned different colors for each sub-objects you should see them appearing on the selected polygonals.

- Set up these ID's for all the polygonals of the sector.
- That's it !! Each polygonals has now his own texture. You will now have to define the orientation and the disposition of the texture on the polygonal. It's the mapping coordinates.
2.3) Mapping coordinates
- In the "Modify" thimble (8), unroll the menu "Modifier List" (9) and choose "UVW Mapping".
- In the "Parameters" thimble, mark off "Face" (12). As you do this the texture height will fit with polygonals's one. Now you can render the scene a first time to have a first look before starting the textures orientation.

* Note that if you marked off the little square to display the texture into the material editor, you'll be able to see them now and work directly without rendering anything. But note too that your hardware should not appreciate this when your track will become a little bit bigger :)

- In the "Modify" thimble (8), unroll the menu "Modifier List" (9) and choose now "Unwrap UVW".
- Unroll the tree of this modifier and select "Select Face" (13). You can now select the mapped polygonals of your sector.
- Select polygonal(s) you want to work on then in the "Parameters" thimble, click on "Edit" (14).

- A brand new sexy window open up. Wow...:)
- Before doing anything else, mark off the icon (15) wich allow you to edit only the informations of the selected polygonals. Check constantly if this button is activated. Otherwise you will do modifications on the mapping of your whole sector and not only to the selected polygonals.
- So this window is displaying the mapping coordinates of the selected polygonal(s) : they are the white points. If you selected a triangle, there will be 3points. If it's a quadrilateral, there will be 6 points (but some are superposed) because a quadrilateral's mapping is decomposed into 2 triangles. The picture below show a quadrilateral's mapping. I voluntary moved the superposed points to show them better. You can move them either with the mouse or directly in modifying their coordinates (17) for more precision. The W coordinate is useless because it isn't exported, so forget it. If this subject remain a lil'bit dark for you, just experiment by yourself in moving the white points around and in looking at the consequence it has on the polygonals selected. To be exportable, mapping coordinates must be in the texture, so the values can only be between 0 and 1.

*To speak simplier : The shapes formed by the white lines linking the white points together represent the part of your texture wich will be applied on the polygonal(s).

- You can choose the background texture (16) to place your coordinates. This is only a little reference mark wich will not affect your previous textures affectations on polygonals.
- Set up the mapping coordinates for all your polygonals. ( this is to my sense the funniest part of the job ! be happy mates ! ;)

3) Parameters
- As a track is more than a simple (Whot!?!) 3D scene, you will have to set up some additional properties :
* The luminosity
* The surface properties
* The sectors visibility
3.1) Luminosity
- In a track, each vertex has to own a luminosity value to define the texture lighting. In a tunnel for example, vertexes will have a low luminosity to make the textures look darker. These values influence only on the track lighting and not on the car lighting.
- In the "Modify" thimble (8), unroll the "Modifier List" menu and choose "Edit mesh".
- Select "Vertex" either in the tree of the "Edit mesh" modifier (18) or with the appropriate icon below in the "Selection" thimble.
- You can now select vertexes of your sector.
- Look for and unroll the "Surface Properties" thimble (it didn't move I think...;)
- Edit the weight of the selected vertexes (19). This will code the luminosity of these vertexes at exportation. 30 is a medium value, good for testing track before setting up definitive lighting.

* Note that you absolutely have to set luminosity values for each vertexes before exporting. Otherwise exporter will not export the scene.

3.2) Surface properties
- There are some properties to define for each polygonals of the track : his type (road, wall, decoration) wich is influencing on the collision parameters between cars and polygonal, the grip, the transparency of the black colour (perfect balck applied on a texture can become transparent), the visibility of the polygonal (two faced polygonal if needed), the mirror effect (Glide mode only), etc...
- In the "Modify" thimble (8), unroll the "Modifier List" menu and choose "Edit mesh".
- Select "Polygon" either in the tree of the "Edit mesh" modifier or with the appropriate icon below into the "Selection" thimble.
- You can now select polygons of your sector.
- Look for and unroll the "Surface Properties" thimble (yes yes always there !)
- Look at the "Smoothing Groups" (20). There are 32 buttons, the last one (n°32) MUST BE activated for all the polygonals. Each of the 31 others remaining represent one of these properties to set up. For example, if the button n°9 is activated, the polygon will be considered as a wall. If the n°10 is activated, it will be a decoration. If only the 32 is activated, the polygon will be a road.
- If none of these 31 buttons are activated, default properties are these : road, maximum grip, texture visible on the normal side, black not transparent, no mirror effect and no dural effect.
- So if you want to only quick test your track, just activate the n°32 button...
- The list showing the propertiy associated to each button is here.

3.3) Sectors visibility
- If your track is composed with only one sector this section is useless for you.
- But if it is composed with several sectors, you have to indicate wich sectors are visible form the sector where the player's car stand. It's the point of the cutting off of a track. All sectors aren't visible at the same time. (That's why in nellaF's scut you don't see the upper road from the lower one, but it appears as soon as the car enter the upper sector, and disapears as soon as the car leave it). It's a very good way to improve framerate in Pod too. A big track with no sector cutting off will slow pod engine.
- Select a sector and right click on it into a view port of 3Dsmax. In the pop-up menu pick "Properties".
- Select then the thimble "User Defined" (22).
- In this text-zone you can give the list of all sectors visible from the sector you're editing. You can write the name of all the sectors you want to be visible in separating them by single spaces or by return to the line. You can also use the "ALL" keyword to make all sectors visible form the edited sector. And finally there is also the "DECOR" keyword if the edited sector is a decoration where car will never drive on.

- Define this for all your sectors

4) CP and start positions
- Setting checkpoints and cars positions up is very easy. In the plugin's zip file you should find a "test2.max" 3Dsmax file. This is a test scene wich contain all the objects needed to do this setup : 16 car position objects (8 for normal mode and 8 for reverse mode) and 8 CP position objects (4 for normal mode and 4 for reverse mode). Here's what must be done to insert them in your track and place them correctly :
* Go into the 3Dsmax "File" menu and click on "Merge"
* Select then the "Test2.max" file where you stored it on your hard drive.
* A list of all the objects contained into this "Test2.max" file is now appearing. Select the objects you are interested in (if it's just for quick testing an unfinished track, just select the 16 car position objects. Place CP only when your track will be finished) and validate.
* Now the objects you selected are into your scene. Red boxes are normal way car positions. Yellow boxes are reverse way car positions. Pink square shapes are normal checkpoints and yellow ones are reverse checkpoints.
* You have just to position them where you want to place your start positions and your checkpoints.

* IMPORTANT notes : Car position objects must be placed right on the floor, at the same level ! There is a little error margin but not much so be careful when doing this. On the CP side, there's one important rule to respect : DON'T rotate them even if your road is twisted. Here's a picture showing explicitly what I mean :

* Last note on this side : be careful to place these objects in the right way. You all should be able to do it correctly when you'll see the objects...Sik made them...explicit ;)

5) Summary
- Here's what must be done to quickly create an exportable scene for a first test :
* Design your track as one single object
* Map it and set all mapping coordinates (cf §2).
* Check if all coordinates are set between 0 and 1 (to do this really easily, select all the faces of your objects and unmark the icon (15) into the mapping coordinates editing window (cf §2.3).
* Select all the vertexes and give them a weight value to set the luminosity of the textures (cf §3.1).
* Select all the polygonals and unmark the 31 buttons of the "Smoothing groups", just let the n°32 activated (cf §3.2).
* If you cut up your track into several sectors, don't forget to set the visibility lists. (cf §3.3).
* Set up the 16 car start position objects. (cf §4).
* Export the file as "test.bl4" if you want to use it instead of the test track in the game. Pick any other Pod track name if you want...

This tutorial was first written in french by Sik, the programmer of the plugin. I translated it as I could. I hope all this is clear for you...or at least that this isn't the language wich made it hard to understand ! ;)

I'm creating a Pod track too. It's already in good work and I encountered some little troubles, sometimes really annoying. Sik has corrected the plugin to avoid you most of these troubles but some little stuffs against wich we can't do nothing are remaing. To avoid you these troubles, I wrote them down. You can read them here

Sik and Rob