** Tutorial ** - Lightwave 3D to Freelancer
Things you will need:
Lightwave 3D v6.0+ (I'm using 7.5 for this tutorial, but most of it should work with older versions back to 6.0)
Photoshop (Or similar image editing software)
Milkshape 1.6.5+ (Or any version that will work with the LWO 5.x and 6.0+ importer/exporter plugins by CCCP.)
Milkshape FreeLancer CMP exporter
FreeLancer UTF Editor (With MFC)
A ship to import to Freelancer
Brief Outline of what we'll be doing:
- Model Preperation 1
- Creating the Game Texture
- Model Preperation 2
- Adding Hardpoints
- Converting to CMP
- Making the Ship's MAT file
- Making the Ship's Commodity Button
- Installing your Ship
What this Tutorial will NOT do:
- Deal with Levels of Detail (LOD)
- Deal with INI editing (We'll touch on it so that your model will be used, but nothing more.)
Now that we have everything together, let's begin.
-------------------------------------------
Model Preperation 1
Step 1: Open Modeler and load your model. It can be a photographic version of your ship, as we are about to lower the poly-count. NOTICE! It IS important that none of the textures be on UV maps, as this will create major problems as we lower the poly-count of the ship for the game.
Step 2: Using your favorite method, lower the poly count of your model to under 3000 Polys. Don't feel the need to add polys though. Levels of Detail (LODs) are NOT something we deal with in this tutorial.
Step 3: Add a new UV map for the entire model. The name is un-important, but make sure it's Map type is set to "Atlas". Save the model.
Creating the Game Texture
Step 4: Open Layout and load your model. Position your camera so you can see the ship rather well. Make sure to set the camera's width and height to 64. Light the ship as you see fit, but make sure that it shows up well when rendered.
Step 4.5: (Optional) Open Modeler back up, and create a simple square in the top view. Give it a surface of "Ground", with a color of 128, 128, 128 and save it. Add it to your current scene, and lower it so that it's underneath the ship. Turn off all your lights so that none of them effect the ground. Add a Spotlight, set it's intensity to 100% and position it so that the light shines onto the ground, in the bottom left half of the ground. Set the Ambient Light to 0%, and position the camera so that it sees all of the ship from the left side, and slightly up. Render it, and it should look like one of the ship icons in the game. When you are happy with it, continue to the next step.
Step 5: Open the Surface Editor, and select a single surface. Click the "Shaders" tab, and add the "Surface Baker" shader.
Step 6: Open the Surface Baker shader. Make sure "Continuous Map", "Bake Entire Object", "Bake Color" and "Bake Diffuse" are all selected. Unselect "Bake Shaders" and "Bake Illumination". Shaders should be off, because it would bake the baking shader, thus crashing Lightwave. We don't want Illumination because that would bake the lighting you currently have set, and we want only the game to effect the lighting. Also make sure the "Bake To" is set to "Image". Set the UV Map to what you created in Step 2. "Image Resolution" can be any multiple of 2. I recommend 1024, however, this creates 3 Meg images, so you might want to stick to 512. Make sure you set your texture name to something like "shipname_baked.tga", and (THIS IS IMPORTANT!) make sure your image type is set to 24-bit! It will not work (well) if it's set 32-bit!
Step 7: Close Surface Baker and the Surface Editor, and save your scene if you have not already done so. Make sure your "Render Display" under Render Options is set to Image Viewer, or Image Viewer FP. Hit F9 to render a frame.
Step 8: When it is done, save the small image as "shipname-commodity.tga". I tend to save everything as a 24-bit Targa (TGA) file, so make sure you do that. It makes things easier later. You can close Layout now.
Model Preperation 2
Step 9: Load up Modeler again. First thing we do now, is we make a copy of out model. (Save it as "shipname-game.lwo".) Add a new surface for the entire model, and call it "a_shipname". Why do we call it "a_shipname"? It is because when we load the model into Milkshape later, it loads groups according to their surface name. Hence, if we called our ship "Zulu", the "Zulu" group would be loaded after all our Hardpoints, and it is documented in the CMP export plugin that the ship's mesh HAS to be the first group. Don't worry though... We will change the name later in Milkshape.
Step 10: Open Surface Editor, and select the "a_shipname" surface. Add a new color texture, and set it's projection type to UV. Select out UV Map, and for the image, load the baked image we just rendered. Click "Use Texture", and close Surface Editor. Your model should now look like a rendered version of your other ship model.
Step 11: Now size your ship so that for a somewhat small ship, the total length is 1km. Why so big? This is the way it is in Freelancer. I don't know why, but it is. For a good sized ship, I'd say no smaller than 1.5km. You might have to play with size later.
Step 12: Once it is properly sized, center your mouse at 0, 0, 0, and in the front (or back) view, hit the E or R button twice. This will rotate the model 180 degrees so that it is upside down. Also, make sure that from the top view, the front of the ship is pointing down. These are requirements by Freelancer. We're almost done prepareing the mesh for Freelancer. All we have to do now is in the front, back or side views, lower the ship vertically. I'd reccomend that the uppermost part of the ship be no higher than -100m. This will keep the ship from looking like it's going through the floor.
Edited by - Admiral Alex on 24-04-2003 02:12:15
Edited by - Stinger on 2/14/2004 7:51:27 AM