Difference between revisions of "Tutorial: Create your own models"

From Empires Wiki
Jump to: navigation, search
(Create your model: Added Sketchup + Playup)
(added links, examples, warnings and hints)
Line 4: Line 4:
 
== Programms / files you'll need ==
 
== Programms / files you'll need ==
  
1. You need at least one '''textured''' model in the SMD format. [http://developer.valvesoftware.com/wiki/Exporting_a_model Valve developer tutorial - How to export models]
+
1. You need at least one '''textured''' model in the [http://developer.valvesoftware.com/wiki/SMD SMD] format.
  
 
2. Your textures with a power of 2 saved as VTF.
 
2. Your textures with a power of 2 saved as VTF.
Line 20: Line 20:
 
=== Create your model ===
 
=== Create your model ===
  
You can use any modeleditors like  
+
You can use any [http://developer.valvesoftware.com/wiki/3D_Modeling_Programs modeleditors] like  
 
* 3D Studio Max (Commercial)
 
* 3D Studio Max (Commercial)
 
* [http://www.softimage.com/products/modtool/ XSI] (Freeware)
 
* [http://www.softimage.com/products/modtool/ XSI] (Freeware)
Line 27: Line 27:
 
* [http://www.blender.org/ Blender] (Open Source)
 
* [http://www.blender.org/ Blender] (Open Source)
 
* [http://sketchup.google.com/ Google Sketchup] with [http://www.playuptools.com/ Playup Tools] (Freeware) (Untested. Please give feedback or opinions on  the forum)
 
* [http://sketchup.google.com/ Google Sketchup] with [http://www.playuptools.com/ Playup Tools] (Freeware) (Untested. Please give feedback or opinions on  the forum)
but you need to convert your model to a smd file at the end.
+
but you need to convert your model to a SMD file at the end. Try to get plugins if you don't have native SMD support in your editor.
  
Texture your model and save it as smd-file.
+
Create your model and texture all faces. '''Faces without a proper texture mapping will be ignored while compiling and won't occur in game'''. Finally save your model as SMD-file.
 +
 
 +
{{Note| Make sure your modeleditor created a valid SMD file. I had some difficulties with XSI Demo, which saves only 2 textures and 'forgets' all other. Also Blender SMD-plugins didn't work for me. I found Milkshape is the best solution for me, but you have to edit the generated SMD-file by hand and remove the file endings '.tga' (use Ctrl-H) .}}
 +
 
 +
 
 +
'''What your SMD-file should look like:'''
 +
texturename1
 +
0 101.417053 -13.837116 6.270448 -0.673222 0.446155 0.589677 0.000000 1.000000 0
 +
0 106.823196 -11.187776 6.270448 -0.161431 0.795829 0.583607 0.000000 0.000000 0
 +
0 101.342369 -13.836076 2.145702 -0.652646 0.757568 0.012008 1.000000 0.000000 0
 +
texturename2
 +
0 106.823196 -11.187776 6.270448 -0.161431 0.795829 0.583607 0.000000 1.000000 0
 +
0 106.748520 -11.186735 2.145702 0.074252 0.997239 -0.001093 0.000000 0.000000 0
 +
0 101.342369 -13.836076 2.145702 -0.652646 0.757568 0.012008 1.000000 0.000000 0
 +
 
 +
 
 +
'''What your SMD-file look like if your faces have no texture:'''
 +
 +
0 101.417053 -13.837116 6.270448 -0.673222 0.446155 0.589677 0.000000 1.000000 0
 +
0 106.823196 -11.187776 6.270448 -0.161431 0.795829 0.583607 0.000000 0.000000 0
 +
0 101.342369 -13.836076 2.145702 -0.652646 0.757568 0.012008 1.000000 0.000000 0
 +
 +
0 106.823196 -11.187776 6.270448 -0.161431 0.795829 0.583607 0.000000 1.000000 0
 +
0 106.748520 -11.186735 2.145702 0.074252 0.997239 -0.001093 0.000000 0.000000 0
 +
0 101.342369 -13.836076 2.145702 -0.652646 0.757568 0.012008 1.000000 0.000000 0
  
 
[http://developer.valvesoftware.com/wiki/Model_Creation_Overview Valve developer tutorial - Modelcreation]
 
[http://developer.valvesoftware.com/wiki/Model_Creation_Overview Valve developer tutorial - Modelcreation]
Line 104: Line 128:
 
'''explanation of Empires.qc'''
 
'''explanation of Empires.qc'''
  
''$modelname'' is the path and name of your model as mdl. The model nf_radar.mdl will be placed in  \Steam\steamapps\SourceMods\Empires\nf\buildings\radar\nf_radar.mdl after compiling.
+
''$modelname'' is the path and name of your model as mdl. The model nf_radar.mdl will be placed in  .\Steam\steamapps\SourceMods\Empires\nf\buildings\radar\nf_radar.mdl after compiling.
  
''$cdmaterials'' is the path to your materials (VTF 's). Here it's \Steam\steamapps\SourceMods\Empires\nf\buildings.
+
''$cdmaterials'' is the path to your materials (VTF 's). Here it's .\Steam\steamapps\SourceMods\Empires\nf\buildings.
  
 
''$scale'' Scales your model by this factor.
 
''$scale'' Scales your model by this factor.
Line 120: Line 144:
  
 
Execute your created shortcut to studiomdl. studiomdl will read the Empires.qc and compile your smdfile to mdl format and place it in the specified folder. To see the output of studiomdl.exe open the commandshell and drag&drop the shotcut to it.
 
Execute your created shortcut to studiomdl. studiomdl will read the Empires.qc and compile your smdfile to mdl format and place it in the specified folder. To see the output of studiomdl.exe open the commandshell and drag&drop the shotcut to it.
 
Sometimes studiomdl will generate dummy files (filesize 1KB), that are invisible because they have no faces. I noticed that XSI SMD export isn't working correct. XSI forgets to save the used textures, maybe its the demoversion i'm using.
 
  
 
== Links ==
 
== Links ==
 
http://developer.valvesoftware.com/wiki/Compiling_Models_Basics
 
http://developer.valvesoftware.com/wiki/Compiling_Models_Basics
 +
 +
http://developer.valvesoftware.com/wiki/Model_Creation_Overview
 +
 +
http://developer.valvesoftware.com/wiki/Exporting_a_model
 +
 +
http://developer.valvesoftware.com/wiki/3D_Modeling_Programs

Revision as of 15:22, 8 May 2009

Home > Tutorial: Create your own models

Note Note: This tutorial isn't complete yet and can contain errors. Use at your own risk!

Programms / files you'll need

1. You need at least one textured model in the SMD format.

2. Your textures with a power of 2 saved as VTF.

3. A QC file, can be created with any texteditor like notepad.

4. studiomdl.exe , install source SDK to get this file.

How to create your own models for Empires

Setup

Set up a folder to place your projectfiles and materials. I used VTFEdit and converted the .VTF 's to TGA 's, because your model editor may don't know the VTF format. Make sure you used the same filenames (except the ending, like .TGA ). To compile the model you'll need the VTF's !

Create your model

You can use any modeleditors like

but you need to convert your model to a SMD file at the end. Try to get plugins if you don't have native SMD support in your editor.

Create your model and texture all faces. Faces without a proper texture mapping will be ignored while compiling and won't occur in game. Finally save your model as SMD-file.

Note Note: Make sure your modeleditor created a valid SMD file. I had some difficulties with XSI Demo, which saves only 2 textures and 'forgets' all other. Also Blender SMD-plugins didn't work for me. I found Milkshape is the best solution for me, but you have to edit the generated SMD-file by hand and remove the file endings '.tga' (use Ctrl-H) .


What your SMD-file should look like:

texturename1
0 101.417053 -13.837116 6.270448 -0.673222 0.446155 0.589677 0.000000 1.000000 0
0 106.823196 -11.187776 6.270448 -0.161431 0.795829 0.583607 0.000000 0.000000 0
0 101.342369 -13.836076 2.145702 -0.652646 0.757568 0.012008 1.000000 0.000000 0
texturename2
0 106.823196 -11.187776 6.270448 -0.161431 0.795829 0.583607 0.000000 1.000000 0
0 106.748520 -11.186735 2.145702 0.074252 0.997239 -0.001093 0.000000 0.000000 0
0 101.342369 -13.836076 2.145702 -0.652646 0.757568 0.012008 1.000000 0.000000 0


What your SMD-file look like if your faces have no texture:

0 101.417053 -13.837116 6.270448 -0.673222 0.446155 0.589677 0.000000 1.000000 0
0 106.823196 -11.187776 6.270448 -0.161431 0.795829 0.583607 0.000000 0.000000 0
0 101.342369 -13.836076 2.145702 -0.652646 0.757568 0.012008 1.000000 0.000000 0

0 106.823196 -11.187776 6.270448 -0.161431 0.795829 0.583607 0.000000 1.000000 0
0 106.748520 -11.186735 2.145702 0.074252 0.997239 -0.001093 0.000000 0.000000 0
0 101.342369 -13.836076 2.145702 -0.652646 0.757568 0.012008 1.000000 0.000000 0

Valve developer tutorial - Modelcreation

Valve developer tutorial - How to export models

Prepare for compiling

Studimdltut1A.JPG
Find studiomdl.exe, by using filesearch or have a look at <path to steam>\Steam\steamapps\<your steamname>\sourcesdk\bin\ep1\bin.
Note Note: <your steamname> ist your Steam loginname. (ex: bob123 , \Steam\steamapps\bob123\sourcesdk\bin\ep1\bin)
Note Note: <path to steam> is the path to your Steamfolder (ex: C:\Program Files (x86)\ )
Create a shortcut to studiomdl.exe.


Studimdltut1B.JPG
Rightclick your newly created shortcut and select Properties


Studimdltut1C.JPG
Append this to the path in the Target-field:
-game <path to steam>\Steam\steamapps\SourceMods\Empires
click OK.


Studimdltut3.JPG
Now copy your smd file (my is named nf_radar.smd ) to this folder \Steam\steamapps\SourceMods ,right next to the Empires-directory.
The next step explains how to create a new file in the same folder named Empires.qc.
The Empires.qc file tells studiomdl how to handle your model. Use for example notepad to create this file. Open notepad and Copy&paste the example below, modify it, select Save As... *.* and save it as Empires.qc (make sure its not Empires.qc.txt !)


example content of Empires.qc

$modelname nf\buildings\radar\nf_radar.mdl
$cdmaterials nf\buildings
$staticprop
$scale 10.0
$body studio "nf_radar.smd"
$sequence idle "nf_radar.smd" fps 30
$collisionmodel "nf_radar.smd" {
$Mass 20
}

explanation of Empires.qc

$modelname is the path and name of your model as mdl. The model nf_radar.mdl will be placed in .\Steam\steamapps\SourceMods\Empires\nf\buildings\radar\nf_radar.mdl after compiling.

$cdmaterials is the path to your materials (VTF 's). Here it's .\Steam\steamapps\SourceMods\Empires\nf\buildings.

$scale Scales your model by this factor.

$body main-smd

$sequence smd with animation

$collisionmodel smd file with a collisionmodel

List of all QC-Commands

Compile your model

Execute your created shortcut to studiomdl. studiomdl will read the Empires.qc and compile your smdfile to mdl format and place it in the specified folder. To see the output of studiomdl.exe open the commandshell and drag&drop the shotcut to it.

Links

http://developer.valvesoftware.com/wiki/Compiling_Models_Basics

http://developer.valvesoftware.com/wiki/Model_Creation_Overview

http://developer.valvesoftware.com/wiki/Exporting_a_model

http://developer.valvesoftware.com/wiki/3D_Modeling_Programs