with all the questions about ogre models I thought I should post some more info on subject. here is the basic "how to" I have used to create models for version MPR++ v0.2.6c
each release this info might change slightly so be sure to check for changes when new versions are released.
DIFFUSED (standard) mapping
This is the same as we always used in hob creation here is an example of a diffused map being used.
I have been also using (texture name).bmp for diffused maps.
BUMP Mapping
Bump (also known as normal) mapping has now been added to the latest non public release of MPR++. I am using NVIDIA Normal Map Filter for adobe CS4 to create the bump map texture. Here is an example of a bump map being used.
I have been also using (texture name)b.bmp for bump maps.
Currently I am just using basic settings to create bump map and applying it to full texture. But we can get a lot more creative on how it is applied by doing overlays of just parts of texture and applying higher/lower values.
LIGHT Mapping
As seen before we can also use light/illumination textures while black and white types can be used the colored ones look much better. Here is an example of a light texture being used
I have been also using (texture name)i.bmp for light maps.
3DS Creation and Mapping
I will not go into any detail on this, But Dr_Breen's tutorial is a great reference.
I will note on mapping any vertical mapping (see below) will display poorly. so use caution to map every polygon.
Note; unwrap can select "Degenerated UV's" so they can be easily remapped.
Note 2; when mirror mapping is used it displays best if mirrored edge is horizontal.
Ship orientation is the same as before as with hob models.
Also it is very important to have only 1 object and 1 material and to keep it simple both should use same name.
Mesh creation/conversion
I am currently using 3ds format for mesh conversion.
First you would need Ogremax for 3ds max (this will install on any version of 3ds max)
I will not even pretend to know everything we need to know about this program, there is still so much to learn.
I will only show you the basics
after you have installed Ogremax you will see a new listing in your toolbar (see image)
After you import your 3ds model you will need to set the Object Settings
The area above in red is what I will set to "YES" other setting are fine. Generate Tangents is very important for bump mapping.
Lod I will not get into this much, but here is the menu.
Currently the Lod levels would need to be created manually and added manully to prevent texture mapping distortion.
The next setting that needs to be set is using the smooth modifier of 3ds max.
In plane on right select modify then in modifier list select Smooth. On most models the "Auto Smooth" should work fine.
Now it is time to export your mesh, here is export dialog.
select location and give name and at bottom be sure to change to "mesh" and save.
This will create 2 files a *******.mesh and a *******.material
The mesh you will need to use the upgrade tool to upgrade mesh to latest version. This is done just by dropping the mesh into the "OgreMeshUpgrader.exe" from the command line tools
Now the material that was generated was only a basic material with only diffiused mapping info, so this will need to be edited.
Code: Select all
// change "galor" to match the material that was generated
material galor
{
technique
{
pass
{
// Comment the specular in order to use only diffuse based normal map technique.
// specular 1.0 1.0 1.0 32 specular 0.8 0.8 0.8 1 51.8
ambient 1 1 1 1
diffuse 1 1 1 1
specular 0.2 0.2 0.2 1 15.0
emissive 0 0 0 1
texture_unit
{
// change "galor" to match the diffiused texture name
texture galor.bmp
tex_coord_set 0
colour_op modulate
}
texture_unit
{
// change "galor" to match the light texture name
texture galori.bmp
tex_coord_set 0
colour_op add
}
// RT Shader system section.
rtshader_system
{
// Override lighting stage with normal map lighting.
// change "galor" to match the bump texture name
lighting_stage normal_map galorb.bmp tangent_space 0 bilinear 1 -1.0
}
}
}
}
Creating a placeholder and phasers
I just started using this method and every placeholder so far has been a perfect match scale.
but some editing of combat distance between fleets may be needed as well as starbase/outpost distance. Also Flocke has added to his to do list, for research screen to auto adjust displayed mesh to allow editting of ship to ship distance of same fleet by using hob file combat distance. This will allow much better placement of ships in combat view.
This is something new but most will know basics.
Open Creator (I know don't say it) open my slot.flt then import the same 3ds used while converting to mesh.
Note; the orientation (X, Y, Z) of a 3ds will change when imported into creator (this is same as always) this just a notation.
To scale model to 1.00 (this is what ever is the longest/widest/height of model) to 1 meter and keep aspect ratio.
first your scale in 3ds does not matter when imported to creator.
With model slot.flt and model 3ds loaded in creator select all and open scale window.
In X Y X area of window select the largest value and change to 0.500000
then copy new value across from value you just entered
then paste it into the other two areas
once all value have been changed press ok
If you want to check scale (size of X, Y, Z) open info/statistics.....
also if you want you can compare it to the 3ds in unwrap after model is "scaled to" 1.0
in hierarchy view on bottom click scroll button to open up objects then you should see this
next move o9 next to slot08 and delete low (in this example) and should look like this
next select the polygons you want for phasers to fire from and place 1 in each slot0* object.
next create a new object and place it next to "o9" object like this.
Next you need to select 1 polygon from each of the furthest point of your model (front, rear, left, right, top, bottom) this will be used for selection box while in combat and keep scale correct.
copy the 6 polygons and paste them, next move them into the empty object you created "o10" then delete o9 and default objects.
now "save as" the hob file name that would be used (hh4_a.flt)
Next you will need to convert to hob. here is a great little tool QD created for me. flt2hob folder just extract to a location with no spaces (C:\) is what I use.
copy the flt you just created to flt2hob folder. Then open a command prompt. Next drag and drop "FLTtoHOB.bat" into command prompt, then hit space bar, then drag and drop your flt into command prompt, then hit space bar again, next just type the 100% of the scale you want for your model in meters (in this case the model is 165 meters so enter 165.0) then press enter. A new .hot and .hob file will be created.
Note; on scale the value used should be the largest part of the model so if model is wider than it is longer use width and so on.
As normal create copies of hob for (hh4_a.hob, hh4_b.hob, hh4_c.hob) to add to stbof.res.
btw no other changes are needed to palette or setting of texture.
Now you have a 14 polygon placeholder/phaser slot hobs.
Creating a "NEW" ship pack
first create a new folder in "install location"\mpr++\data\shippacks name it whatever you want in this case it will be "thunder"
open the new folder and create a zip file with all the meshes, materials, and textures for your model or models. name it "gfx.zip"
next create a new xml document and name it "package.xml" (I will show how to edit this file in editing ship pack section)
next in "install location"\mpr++\data folder you will need to edit the "ElementDB.xml" so ogre will use your new ship pack.
here is what is most commonly in ElementDB.xml
Code: Select all
<ElementDB>
<ref file="database\races.xml"/>
<package file="shippacks\vanilla_ECMpack\package.xml"/>
</ElementDB>
Code: Select all
<ElementDB>
<ref file="database\races.xml"/>
<package file="shippacks\vanilla_ECMpack\package.xml"/>
<package file="shippacks\thunder\package.xml"/>
</ElementDB>
I will only show first part of file that needs to be edited.
before editing (common)
Code: Select all
#Ressources like meshes and materials to load by Ogre
#use either Zip= or FileSystem=, [] marks a categorie
#ShipPacks:
#======================================
[ShipPacks]
Zip=mpr++/data/shippacks/vanilla_ECMpack/gfx.zip
#SkyBoxes:
#======================================
[SkyBoxes]
Zip=mpr++/data/skyboxes/space01.zip
Code: Select all
#Ressources like meshes and materials to load by Ogre
#use either Zip= or FileSystem=, [] marks a categorie
#ShipPacks:
#======================================
[ShipPacks]
Zip=mpr++/data/shippacks/vanilla_ECMpack/gfx.zip
Zip=mpr++/data/shippacks/thunder/gfx.zip
#SkyBoxes:
#======================================
[SkyBoxes]
Zip=mpr++/data/skyboxes/space01.zip
All of these files would need to be edited when creating a new ship pack too.
first the package.xml in "install location"\mpr++\data\shippacks\vanilla_ECMpack
here is what is commonly in package.xml if only 1 ship is part of ship pack
Code: Select all
<package unitScale="2.0">
<data>
<UnitClasses>
<ship id="card_Hideki" name="Hideki" type="Scout" mesh="Hideki.mesh" sizeX="40.9" sizeY="8.6" sizeZ="44.4"/>
</UnitClasses>
</data>
</package>
ship id="card_Hideki" this is what will be most commonly used in most resource files.
name="Hideki" this would be the name of the model as in ship stats of stbof.res
type="Scout" this would be the ship type of the model as in ship stats of stbof.res
mesh="Hideki.mesh" This must match the mesh in the gfx.zip exactly
sizeX="40.9" sizeY="8.6" sizeZ="44.4" This is the size of your scaled model.
here is an example with 5 meshes added
Code: Select all
<package unitScale="2.0">
<data>
<UnitClasses>
<ship id="card_Hideki" name="Hideki" type="Scout" mesh="Hideki.mesh" sizeX="40.9" sizeY="8.6" sizeZ="44.4"/>
<ship id="card_cfighter" name="CFighter" type="Fighter" mesh="cfighter.mesh" sizeX="24.8" sizeY="5.9" sizeZ="47.2"/>
<ship id="card_Keldon" name="Keldon" type="Cruiser" mesh="Keldon.mesh" sizeX="106.8" sizeY="39.1" sizeZ="195.3"/>
<ship id="card_Galor" name="Galor" type="Cruiser" mesh="Galor.mesh" sizeX="106.8" sizeY="30.9" sizeZ="195.3"/>
<ship id="card_Hutet" name="Hutet" type="Command Cruiser" mesh="Hutet.mesh" sizeX="230.9" sizeY="95.4" sizeZ="272.3"/>
</UnitClasses>
</data>
</package>
next "HobMappings.xml" located in "install location"\mpr++\data\mappings
This file is simple
Code: Select all
<HobMappings>
<hob name="cs_a.hob" target="card_teroknor"/>
<hob name="co_a.hob" target="card_cardpost"/>
<hob name="ch1_a.hob" target="card_Galor"/>
<hob name="ch3_a.hob" target="card_Keldon"/>
<hob name="ch2_a.hob" target="card_gildron"/>
</HobMappings>
target="card_teroknor" this needs to be the same as ship id in package.xml
this list can get very long also.
next the UnitMappings.xml located in "install location"\mpr++\data\mappings
This file is only used by experimental combat but I suggest keeping it up to date
Code: Select all
<UnitMappings>
<unit id="0" target="card_Keldon"/>
</UnitMappings>
target="card_Keldon" this needs to be the same as ship id in package.xml
this list can get very long also.
I am sure I missed some info so you might want to check back from time to time to see if info has been updated.
thunderchero