Author Topic: Unique Armoury Flanged Mace Tutorial (24th Oct.08)  (Read 17894 times)

0 Members and 1 Guest are viewing this topic.

Talak

  • Sergeant Knight
  • *
    • View Profile
    • White Anvil Games
  • Faction: Neutral
  • M&BWB
Unique Armoury Flanged Mace Tutorial (24th Oct.08)
« on: October 15, 2008, 10:21:19 AM »
Flanged Mace tutorial
by Talak
24th October 2008

This is a tutorial for an item I'm going to add to my Unique Armoury mod.

Sections:
Modelling - done
UVMapping - done
Texturing - done
Getting it ingame - done

Reference image:


Final untextured model:


Final textured model (specular not applied):


Tools:
3D modelling program
Image editor
BRFEdit
Item Editor

Note:  This is an overview type tutorial.  I'm not describing every specific technique.  I'm also not an expert, I'm self-taught, so there may be better ways to do things.  This is how I do it.  This tutorial is not for absolute beginners; it assumes you have some basic modelling skills.


STEP ONE - MODELLING
I'm using 3D Studio Max, but you should be able to apply the same basic techniques in other 3D programs.  I'll try not to go into program specific details.

First work out the basic shapes you want to start with.

This mace seems to have 8 flanges, a diamond shaft, and a roundish hilt.  Hard to work out exactly, but that's what I'm going with.

When making models for games, always try to put as many details in the texture instead of the 3D model.  For instance, the lines in the handle can be textured instead of modelled; a simple cylinder will do fine for the actual model.

I'll start with the hilt, and turn the cylinder into a diamond where the shaft begins.

Note:  Do not worry about proportions yet, as they can be easily adjusted later.  You also don't need to get every detail exact.  Just do what looks good.

I've created a 8 sided cylinder: | Beveled and extruded: | And the other end: | Some more extruding and beveling:


Now is a good time to save if you haven't already.  Remember to save regularly.
Now I need to convert from 8 sides to 4, so I've extruded then collapsed the left and right sets of 3 vertices. 
The left side is done here, the vertices to be collapsed are red (front view):


I've then scaled the vertices to get an even diamond shape: | Extruded and beveled (side view): | And again:


Now to create the head of the mace.  I could extrude and divide to get the required number of sides, but I'd rather just create a new cylinder.
To create the 8 flanges, I'll create an 8 sided cylinder as the core.  Each polygon needs to be extruded outwards to create the star shape as seen from the end.

8 sided cylinder with all polygons selected except for the ends: | Beveled and extruded by polygon:


Now I want to extrude the entire shape another 5 times: | Then, referring to side view, uniformly scale the vertices to match the shape of the mace head:


I've scaled up the mace head to approximately the right size, and scaled up the end polygon to about the same size as the handle:


And some more beveling and extruding: | I've beveled the inner polygon outwards, then collapsed the 3 left vertices:


I'll do the same with the righthand 3.
It's difficult to tell from this mess, but I've scaled the diamond to match the shaft diamond (front view):


I've attached the two objects and deleted the two facing polygons:


Now I can collapse the adjoining vertices.
It is now one solid object, and I can scale it properly by moving or scaling the vertices to get the proper shape:


Hopefully that was clear enough.


STEP TWO - BASIC UVMAPPING
This can be a complicated process, and often specific to the program you are using.  What it is, is unwrapping the 3 dimensional object into 2 dimensions, so that it can be textured.  Once again this is only one way to do it, there may be better ways.

The first thing I do after applying an Unwrap UVW modifier is select all faces and apply box mapping:


The green lines on the model show the seams.
The idea is to have as few seams as possible.  I divide the model up into sections, such as the handle, mace head, bronze rings etc, that will use different textures.

The handle selected and box mapped:


Now I need to join all the sections of the handle together.  By selecting the vertices of a row (in red), I can see that they join up with the vertices in blue.  The line that the vertices create is also blue.

So I've moved it down to align with the blue line: | I've then selected the overlapping vertices and welded them together:


After doing the same with the others, there is only one seam on the handle: | I've done the same thing with the two sections of the shaft:


I've gone through and selected each bronze ring and applied box mapping to it, in order to separate them:


Then the same with the leftover, which is the mace head:


I now have all elements properly separated.  Now each individual element needs to be stitched together, so there is only one seam.  How to arrange things can be very subjective.  It's best to keep things as straight as possible.
For example, here I've stitched together this band of polygons:


One way I could do the rest is to keep the circular shape and stitch one edge on, like here:


But a better way would be to lay it out along with the band, which can be tedious but gives better results.  I've started by moving the vertices to join up:


I'll need to break apart the ones in red, like this: | Then I can weld the vertices and reposition them:


And the same with the rest: | Now the other side.  I've separated out this polygon, as it can't be joined completely with the rest.


I've joined an edge on to the rest:


Now this needs to be repeated with the rest of the rings.

That was a basic overview of uvmapping.  I will continue the tutorial with the rest of the uvmapping soon.

UVMAPPING PART TWO
Ok, I got completely lazy and used simple flatten mapping.  At least this means there won't be any stretching, and this is a fairly simple item to texture. 

The important thing is to properly unwrap areas that will have lots of texture detail.


Now I need to resize everything to fit inside the blue square which represents the final texture.  The idea is to make everything as large as possible to use all available texture space.  I've made the handle bigger as it will have more texture detail:


Now I render the uvmap to a bitmap texture (mace_uvmap.bmp) at 1024x1024.  This will be the guide for texturing.
Now, this is not a great example on how to properly uvmap, but it's workable for this item.


Here is a better example of one of my items.  From left to right, the uvmap, the texture, and the finished item:


Open your image editing program (I use Photoshop) and open the texture you just saved.  I invert it, so the lines are black.  Then save it under a different name, eg mace.psd.  Now in the 3D program, assign mace.psd as the material for the mace:



STEP THREE - TEXTURING
Note:  Once again this assumes you have basic knowledge of image editing.

Time to edit the texture.  I create different layers based on the different sections of the item.  So, I've created the following layers:
Handle, Shaft, Head, Bronze.
I've also created a layer from the background (which was the uvmap texture) and called it Mesh.  I've moved it to the top of the layer list and changed the blending mode to Darken.

Now I'll select each area and fill it with a base colour (any colour will do), in order to keep the groups separate. 
I've given them different colours to see how it matches up with the model:


Now I can turn the Mesh layer off, save, and see how it looks in the 3D program:


Everything is looking right, so on to the details.  I usually won't use the layers I've just created at all, they are there for easy selection and duplication.
I'll start with a simple metal base.  I like the cross-hatched metal effect, so I'll do that.  Create a new layer, fill with 50% grey, and apply about 20% noise:


Now apply a 45 degree angled motion blur with a distance of 35 pixels:


Now duplicate the layer and flip it horizontally.  Then change the blending mode to Overlay:


I keep the effect exaggerated at first to test how it looks on the model:


Looks ok, so I'll add some render clouds to break the pattern up a bit.  Create a new layer, choose black and white as your fore- and background colours, and apply render clouds.  Change the blend mode to Overlay:


I've moved the Bronze layer to the top and changed it to Overlay:


Now I'll create a new layer just below the Bronze layer and fill with black.  I've set the opacity to 75%.  This gives me control over how dark or light I want the metal:


I don't want the bronze dark, so I'll delete that area from the black layer.  Use the wand select tool to select the bronze area, then select the black layer, and press delete:


I've also added a small amount (2.5%) of noise to the black layer.

Now the handle.  I've inverted the Mesh layer and set it to Lighten so I can see where to texture, and I've created a vertical black line on the handle (lower left):


Now I've copied and pasted, merged the results, copied and pasted that etc to end up with this:


I've turned the Mesh layer off, then applied an Outer Bevel effect (under Blending Options when right-clicking a layer in Photoshop):


Progress so far:


TEXTURING PART TWO
Usually I like to create my textures from scratch.  Sometimes though, it's better to find a photo for certain effects.  I want to add a subtle patina effect to the bronze, so I've searched for "bronze texture" on Google images.

I've pasted a bronze texture 4 times and merged them into one layer.  Then I've selected the bronze layer area:


I've selected the new bronze texture layer, inverted the selection, and pressed delete:


Blending mode changed to exclusion and opacity set to 50%:


Now I've duplicated the new bronze layer and changed the blend mode to Lighten and the opacity to 100%:


Now for some shading.  I want to add some shadows where the bronze meets the rest of the metal, to tie it together a little better.  So I'll create a new layer called Shadows.  I've also selected a 65 pixel brush at 75% opacity, with black as the colour.  I've also turned the mesh layer back on:


Now I'll draw shadows at the ends of the handle and shaft sections.  Notice I'm only placing the edge of the brush on the required areas:


I've also added shadow on the base of the flanges:


Looking better now:


Now for the details to finish it off.  I'll add scratches, by creating a new layer and selecting a 1 pixel brush. 
Then I've drawn randomly over the texture:


Then applied a bevel with the following settings:


Then changed blending mode to Overlay and set opacity to 50%:


Scuff marks next.
I've created a new Scuffs layer and chosen a variety of rough brushes set to a large size, and drawn randomly:


Then I've inverted the layer (to make the marks white) and changed the layer mode to Overlay at 50% opacity:


And finally a few dirt or blood spatters.  I've found some free grunge brushes online for this purpose.  Once again, a new Splatter layer and random drawings:


Then I've changed the layer mode to Soft Light:


And the final result:


One more thing to do - save the texture as a dds file.  I use DXT1 and two maps, one diffuse (the colour) and one specular (for shinyness).
The specular map I make by editing the diffuse texture.  I desaturate it and adjust the Levels:


Anything you don't want shiny should be dark.  Since taking the above screenshot, I've lightened the darkest areas, as I want the dark metal to be a little shiny.


STEP FOUR: GETTING IT INGAME

You'll need BRFEdit for this.  The link is at the top of the post.
First open up Mount&Blade\CommonRes\weapon_meshes1.brf and find a similar weapon, in this case the winged_mace.  Select it and Export as an obj file.
Then import it into your 3D program with your modelled weapon.  Now resize and re-align your weapon to match the imported one:


Now export your weapon as an obj file.
You need to create a new brf file or add the item to an existing one.  In my case I've opened up talak_weapons.brf and imported the obj file (flanged_mace.obj).  The weapon will be black as it has no material or texture assigned:


Copy your items' textures into the Mount&Blade\Modules\*module name*\Textures folder.
Go to the Tex tab in BRFEdit and press the Add button.  Then change the name to match your textures and press the Set button (I also changed the name of the mesh to talak_mace):


Now go to the Mat tab and press the Add button.  In Name, put whatever you'd like to call your material.  Then choose the shader you'd like to use, I usually use specular_shader.  In Diffuse, put the name of the texture you just added, and if you have one, the specular texture in the Spec box.
I usually set Specular to 250, and R, G and B to 600 each.
Now you need to tick Specular Enable, Blend, Blend Add, and Blend Multiply.  This doesn't work for me for some reason, so I enter 1824 in the box next to the Set button instead:


Go to the Mesh tab, select the item, and in the Material box enter the name of the material you just created. 
After you save it (to Mount&Blade\Modules\*module name*\Resource) and reselect your item, it should show up properly:


Now I also want to add a LOD (Level of Detail) model.  This will be a lower polygon model to display at further distances.  I use the Multires modifier in 3D Studio Max to reduce the number of polygons from 884 down to 448, and export (in my case, as flanged_mace_lod1.obj).  Then I reduce it further down to 264 and export it as flanged_mace_lod2.obj.  You don't need to use those exact numbers of course.

Now in BRFEdit I've imported the two lod models.  The meshes need to be named exactly the same as the full model with .lod1 and .lod2 appended.  The Material should be the same as it is for the full model:


The item is now set up properly for the game to use it, but it needs to be added.  I use jordans Item Editor.  Open up your item_kinds1.txt file with the Item Editor and find a similar weapon (the Winged Mace in this case).  Then go to Edit \ Insert \ End of File.  Select the duplicated item at the very bottom of the list in the drop down box.
I've changed the ID to itm_talak_mace and both Display names to Flanged_Mace.  The Mesh Name needs to match the name of the mesh in the brf file (talak_mace).  Then you can adjust the statistics as you see fit:


Save the file, and the item will start to show up in the stores after a short wait (a day or so).

You will need to check if the position and size is right.  If not, go back to your 3D program and readjust it, export it, and import it back into BRFEdit.  Save and check it again.  In my case, it was a little too big and also needed to be moved upwards slightly.  The bronze was also too yellow, so I adjusted it to be more orange/brown.

So, here's the final product:



Hopefully this tutorial helps a few people.  Thanks for reading.
« Last Edit: October 24, 2008, 06:52:20 AM by Talak »

Dain Ironfoot

  • Grandmaster Knight
  • *
  • No sex please, we're dwarves
    • View Profile
  • Faction: Neutral
Re: Unique Armoury Flanged Mace Tutorial
« Reply #1 on: October 15, 2008, 10:39:34 AM »
Excellent tutorial for those newbies who want to move onto something a little more advanced than a sword. Combined with UV mapping tutorial this should become one of the great newbie tutorials.
Ry'n ni yma o hyd

Talak

  • Sergeant Knight
  • *
    • View Profile
    • White Anvil Games
  • Faction: Neutral
  • M&BWB
Re: Unique Armoury Flanged Mace Tutorial
« Reply #2 on: October 15, 2008, 01:08:08 PM »
Thank you.
I've added a basic uv mapping tutorial.  More uv mapping to come, then on to texturing, and then getting it ingame.

Zaro

  • italiano stallion-o
  • Grandmaster Knight
  • *
    • View Profile
  • Faction: Neutral
Re: Unique Armoury Flanged Mace Tutorial
« Reply #3 on: October 15, 2008, 06:04:06 PM »
Very nice. Will the texture be similar to the pic, or polished steel (I'd love to see the light catching the surfaces).

Talak

  • Sergeant Knight
  • *
    • View Profile
    • White Anvil Games
  • Faction: Neutral
  • M&BWB
Re: Unique Armoury Flanged Mace Tutorial
« Reply #4 on: October 15, 2008, 07:02:49 PM »
It'll be shiny.  Usually looks better ingame.

Cromrall

  • Recruit
  • *
  • There comes a time when a man has to kill.
    • View Profile
  • Faction: Swadian
Re: Unique Armoury Flanged Mace Tutorial
« Reply #5 on: October 16, 2008, 01:37:14 AM »
It'll be shiny.  Usually looks better ingame.
That is good to hear!
A man will kill, with his sword, his spear, his axe, his bow... or with his hands.

Talak

  • Sergeant Knight
  • *
    • View Profile
    • White Anvil Games
  • Faction: Neutral
  • M&BWB
Re: Unique Armoury Flanged Mace Tutorial
« Reply #6 on: October 20, 2008, 09:34:56 AM »
Been busy lately, sorry for the delay.  Tutorial updated with basic texturing.

ealabor

  • Grandmaster Knight
  • *
  • Faction: Carthage
    • View Profile
    • Hegemony 268 B.C.
  • Faction: Neutral
  • WB
Re: Unique Armoury Flanged Mace Tutorial
« Reply #7 on: October 20, 2008, 02:14:47 PM »
Been busy lately, sorry for the delay.  Tutorial updated with basic texturing.

Talak, I'm handily waiting to see the alpha channel to game implementation steps, and selection of shaders.

I've tried various times with various methods to work in alpha's to textures, to discern glossy and non glossy sections, all to no avail. At this point im nearly convinced theres something wrong with my BRF.

If you have DDS converter 2, i'd like to see the selections you choose for the conversion (I chose DTX5).

Will be very helpful, and these simple steps are holding up great texture sheets to come, so you can rest assured that you are helping at least one modder, and the folks that play the mod with this tutorial.

Continue on, and thanks in advance.

Talak

  • Sergeant Knight
  • *
    • View Profile
    • White Anvil Games
  • Faction: Neutral
  • M&BWB
Re: Unique Armoury Flanged Mace Tutorial (20th Oct.08)
« Reply #8 on: October 20, 2008, 04:57:15 PM »
I was originally using DXT5, but I found it best to use two DXT1 files, one for diffuse (the colour) and the other as specular.  If I wanted alpha, I believe I could use DXT5 for the diffuse with the alpha channel set how I want it, and set the shader to tex_col_mul_alpha or something similar.  I'll include an alpha section as well as specular in the tutorial.

Edit:  Added sutton hoo helmet example in the uvmapping section, compressed some lines down to one line to save space.
« Last Edit: October 20, 2008, 05:20:01 PM by Talak »

Bommel

  • Knight
  • *
    • View Profile
  • Faction: Neutral
Re: Unique Armoury Flanged Mace Tutorial (20th Oct.08)
« Reply #9 on: October 20, 2008, 05:44:55 PM »
Nice tutorial, but I have two questions.

Regarding the mace:
Why don“t you overlap the model parts in the UVMap which got the same shape and will use the same texture. And why do you leave so much space between the polys? You waste a lot of pixels/resolution this way.
You use a 1024x1024 pixels Texture sheet, but only around 50% of the pixels are even needed and will be seen on the model, they way it is shown above.

Is it only meant as example?
Just asking out of curiosity.




Talak

  • Sergeant Knight
  • *
    • View Profile
    • White Anvil Games
  • Faction: Neutral
  • M&BWB
Re: Unique Armoury Flanged Mace Tutorial (20th Oct.08)
« Reply #10 on: October 20, 2008, 05:51:38 PM »
Yes, I already stated it wasn't a great example.  That's why I posted a better example earlier.

Edit:  The other reason is that I like to put small details on the items, such as scratches and scuffs.  If I overlay polygons, these will be repeated on every overlapping face.
« Last Edit: October 20, 2008, 06:10:21 PM by Talak »

Bommel

  • Knight
  • *
    • View Profile
  • Faction: Neutral
Re: Unique Armoury Flanged Mace Tutorial (20th Oct.08)
« Reply #11 on: October 20, 2008, 07:15:45 PM »
Fair enough. ;)

Talak

  • Sergeant Knight
  • *
    • View Profile
    • White Anvil Games
  • Faction: Neutral
  • M&BWB
Re: Unique Armoury Flanged Mace Tutorial (24th Oct.08)
« Reply #12 on: October 24, 2008, 05:23:36 AM »
Been busy lately, but I've finished texturing, the tutorial is updated.  Next is getting it ingame, I'll have it up shortly.

Edit:  Tutorial completed.  ealabor, sorry I haven't included an alpha section.  I may add one later.
« Last Edit: October 24, 2008, 06:33:14 AM by Talak »

Banelion

  • Recruit
  • *
    • View Profile
  • Faction: Swadian
Re: Unique Armoury Flanged Mace Tutorial (24th Oct.08)
« Reply #13 on: October 24, 2008, 07:21:32 AM »
Great, great stuff, I'll definatively use your guide many times in the future, haha.

DC10

  • Recruit
  • *
    • View Profile
  • Faction: Neutral
Re: Unique Armoury Flanged Mace Tutorial
« Reply #14 on: October 30, 2008, 11:00:29 AM »
It'll be shiny.  Usually looks better ingame.

Great tutorial Talak!

I created a katana and i want the blade to be reflective like the no_dachi in the game. What shaders must I use?

I've tried shiny shader and environ_vmap shader like in your unique weapons and specular shader but none of them works. I also use earthenvmap which made the sword translucent.

Please Help!