You are here

Tutorial - Creating Custom Tiles

Author: 
Mr. X

Tutorial: Creating Custom Tiles

Intro

This tutorial will walk you through creating an individual tile and adding it to an existing tileset. While everything below is the same for creating a tile for an entirely unique tileset, it's much more feasible to add tiles to an already existing one or a duplicate of an existing one (LabTek's tileset duplicator is great for this.) Bioware gives a good base to start from and as there are literally hundreds of iterations of terrain tiles in any given tileset, it's best to build on/change what already exists.

This tutorial includes such features as creating a raised walk mesh and using textures with transparency on simple models to fake fine model detail. In branch-off tutorials, we'll look at the SET and ITP files in more detail, cover changing elevation, and paintables (walls, streams, etc...)

Tools

To complete this tutorial, you should have the following tools:

  • Neverwinter Nights
  • 3ds MAX 4.2x or 5
    • I use MAX 5 for this tutorial. Some functionality in 4.2 may differ.
  • Scooterpb's MDL Plug-in Suite 1.0 for MAX
  • The Chilliskinner plug-in for MAX
  • Zoligato's NWN Viewer
  • Chanteur and SegFalt's ITP Tool
  • A text editor
    • I suggest UltraEdit, but any will work. Even Notepad.
  • Bioware's DDS Compression Tool

Contents

 

Part 1: Getting It Down On Paper

Define a Need

In a community effort environment like Neverwinter Nights, one of the most important things in tileset creation (or any custom content creation, for that matter) is to define a need. If you need a specific tile for your module, that's one thing. But if you're making it for the community in general, be sure they need it. Will people use your hot dog stand tile? Probably not. Will they use a custom clock tower? Most likely.



In this case, we're pretending there's a large calling for an old wooden platform stage in the city exterior tileset. So that's what will make...

Refine the Idea

This is less important when we're working on a single tile. It's still good to get a little focus, though. We want to keep the poly count low. So, I'm imagining a sort of square, raised stage with a small ramp up the back. In the front, some support beams holding up a big, sweeping open curtain.



After doodling it out a little, though, it's clear that a traditional curtain draping from the center out would require a large texture and would block a lot of the stage given the standard NWN camera angle. I decide on more of a "pulled directly up" curtain approach. This way, we only need to make one draping segment texture and can repeat it multiple times across the length of the curtain.

Conceptualize the Tiles

Grab some graph paper if you have it handy and draw out your tile(s) really quick. While a simple one like this doesn't require a lot of planning, it can never hurt.

      
  Sketch of the desired tile

 

Part 2: Build the Geometry

Alter MAX's Setup for Tile Creation

Under the Customize menu choose Units Setup. Click the Metric radio button and set the drop-down to centimeters.

Setting the system units depends on what version of MAX you're using. In MAX 5, press the System Unit Setup button in the Units Setup box from the step above. Set 1 Unit = 1.0 Centimeters. In MAX 4.2x, under the Customize menu choose Preference Settings. Under the General tab set 1 Unit = 1.0 Centimeters.

Be sure to download the latest version of Scooterpb's MAX plugin and install it as per the instructions on his website. Download Chilliskinner from the link above in Tools and extract the MAX Script file to MAX's scripts directory.

The Tile Base

Open MAX. For starters, let's make a ground plane. It'll give us a reference fo rthe rough size we should make the Model Helper Object.

Click the Create tab. Click the Geometry button and make sure Standard Primitives is selected in the drop-down. Click the Plane button in the roll-out below. Move down the roll-out to Keyboard Entry. If it's closed, simply click the + next to it to toggle it open. Under Parameters, use these values below. Be sure to change the Length Segs and Width Segs as indicated. They are not under Keyboard Entry, but are below under Parameters. Once these values are in, press the Create button.



Length: 10cm

Width: 10cm

X: 0

Y: 0

Z: 0

Length Segs: 1

Width Segs: 1

      
  Creating a plane.

Click the Zoom Extents All button in the lower right-hand corner to zoom all viewports in on the (what will right now be a fairly small) plane.

The Model Helper Object

The Model Helper Object provides the MDL Export plug-in with your model's name, any animations, and it will act as the ultimate parent for all nodes in your tile.

Under the Create tab, press the Helpers button. Select MDL Plug-in Suite in the drop-down. Press the Model button and then click and drag in the top viewport to create the model helper object. Don't worry too much about what size it is, as that doesn't matter. I like to make mine about half the size of the ground plane. Select your new Model Helper Object and press the Select and Move tool button. Then right-click on that same button to bring up the Move Transform Type-In dialog box. In all three fields on the left-hand size of the box, set 0 as the value. This will center your Model Helper Object perfectly. With the Model Helper Object still selected, click on the Modify tab and type the name for your model into the field directly under the tab. This will depend on what tileset you intend this new tile for, but for the purposes of this tutorial we'll use tcn01_o30_01 as our name.

      
  The Move Transform Type-In box

The Base Geometry

To create the basic stage, we'll start with the rough shape first, which is a box.

The logic behind all the numbers below is this: We want a simple, boxy stage. Slightly wider than it is long, and not too tall. We're going to need a ramp to get up to it. To make the ramp creation easier, we'll segment the width of our stage into three parts. Later, we'll extrude that middle part forward to help create a quick, simple ramp. The reason we make the box higher than we want and lower it with a negative Z value is three-fold. We want to use the existing ground plane to slice off the bottom of the box as it would be worthless, unseen geometry in the game (and we want to remove that whenever possible.) We want to use a copy of it to punch a hole out of the ground plane (again, removing unseen geometry... this time, however, we're adding a few polygons in favor of removing an unseen area that would normally sport a texture.) Finally, we'll merge copies of both the sliced stage and the ground plane as a basis for our walk mesh.

Create another Standard Primitive, but this time choose the Box button instead of Plane. Under the Keyboard Entry and Parameters set the following values, then click the Create button.



Length: 4.0cm

Width: 6.5cm

Height: 2.0cm

X: 0

Y: 0

Z: -1.0

Length Segs: 1

Width Segs: 3

      
  Doesn't look like much now, but it'll be a stage someday...

Now that we have our base stage, let's create a basic ramp. At this point, you should right-click on the word "perspective" in the perspective viewport and make sure Edged Faces is checked.

Select the box. Under the Modify right-click on box in the modifier stack and choose Editable Mesh. Now we'll be able to manipulate the box's individual components.

      
  Converting to an Editable Mesh

Under Selection in the roll-out, click on the Face button. This will toggle MAX into a mode where only the elements (in this case, the faces) of the selected mesh can be edited.

      
  Face Selection button

Select the two font, middle triangles that make up the middle square of the front face. Move down the roll-out to teh Extrude button. Set the Extrude distance to 3.0cm and press the Extrude button.

      
  The selected faces


      
  Extruding part of the mesh

Change from face selection mode to vertex selection mode by pressing the Vertex button in the Selection area of the roll-out. Select the two verticies on the upper, outer edge of the face we just extruded.

      
  Selected verticies that need to be moved

Click the Select and Move tool, then right-click it to bring up the Move Transform Type-In dialog box. Change the Z value from 1.0 to -1.0 to drop the vertices down. Now our ramp is starting to take shape.

      
  Verticies moved to produce a ramp

Click the Vertex button again to exit element editing mode.

Now load the Chilliskinner plugin script. Under the Utilities tab, click the MAXScript button. Chose Run Script from the resulting roll-out. Browse to where you extracted the Chilliskinner MAX script to. Once selected and opened, the Chilliskinner interface will appear. Select your ground plane and then press Chilliskinner's Clone button. The script will clone and auto-hide a copy of your ground plane. It also selects all the elements of the scene in the process, so deslect them all. Selet your box that makes up your stage and press Chilliskinner's Clone button again. Once again, deselect all the elements.

      
  Chilliskinner's Clone button

Select the stage. Under the Create tab press the Geometry button. Choose Compound Objects from the drop-down menu. Press the Boolean button. In the roll-out under operation, select the Cut radio button and the Split radio button. Towards the top of the roll-out is the Pick Operand B button. Press it, then select the ground plane. The ground plane will disappear. The stage is now sliced ant ground level.

      
  A boolean operation

With the stage still selected, under the Modify right-click on Boolean in the modifier stack and choose Editable Mesh. Under Selection in the roll-out choose the Face button. In the Left viewport, click and drag to select all the faces below the 0 line (see picture). Press the Delete key. MAX will ask you if you want to delete isolated verticies. Say yes. Click the Face button again to toggle out of element editing mode.

      
  Selecting unwanted faces

Make sure the stage is selected. Under the Display tab, click the Hide Selected button. Then click the Unhide by Name button. Choose to unhide the two objects that start with "Clone".

Select the ground plane in the viewport. Create another Boolean operation as above. This time, select the Subtraction (A-B) radio button instead of Cut. Press the Pick Operand B button and select the stage. The stage will disappear. The ground plane should now have a hole in it the exact shape of our stage's base.

With the ground plane still selected, go to the Modify tab. Right-click on Boolean in the modifier stack and choose Editable Mesh.

Under the display tab, click the Unhide All button.

Repeat the steps for using Chilliskinner to clone both the stage and the ground plane to make and auto-hide new clones of each. We're going to merve one copy to create our walk mesh. The other we'll need for our actual tile geometry.

Select the ground plane and the stage. Press Chilliskinner's Attach Polys button. Then press Chilliskinner's Select and weld ALL Verts button. You should see your verticies flash momentarily in your viewport. This copy of the stage and ground plane have been completely merged into a new mesh. This is the basis for our walk mesh.

      
  Chilliskinner buttons

The Walk Mesh

Select the new resulting mesh if it isn't already selected. Under the Modify tab, choose MDL Walkmesh from the Modifier List drop-down. Under Selection in the roll-out, choose the Polygon button. Selecting by polygons will be faster than selecting by individual faces for the next steps.

Select all the top parts of the stage and ramp. Select Wood in the Suface Materials chooser in the roll-out.

      
  Select the top surface polys

Select all the ground plane. Select Stone in the Suface Materials chooser in the roll-out.

      
  Select the ground surface polys

Select all the vertical edges on the side of the stage and ramp (and be sure to rotate around in your perspective viewport so you get the ones on the other side). Select Not Walkable in the Suface Materials chooser in the roll-out.

      
  Select the side polys

Click the Polygon selection button again to toggle out of element editing mode.

Under the Display tab, click the Unhide All button. Without deselecting the walk mesh object, click on the Modify tab. In the Modifier Stack, click on Editable Mesh. MAX will pop up a large warning. As none of the alterations we will make will affect the walk mesh modifier, click on Yes.

What we're aiming to do now is alter the walk mesh so we can avoid some common tile creation mistakes. Chiefly among these is to have the walk mesh exactly the same as the model geometry. This results in the player being able to click on the spots like the very edge of the stage (leaving the standing half on the stage and half in mid-air) or on the ground right next to the stage (leaving them standing half on the ground and half inide the stage's base.) We can fix these issues by pulling the walk mesh out near the base, and pushing it in on the upper platform's surface. The Ramp will be a special matter, with the walk meshes around it tapering inward as it moves from the ground to the stage.

In the roll-out under Selection, pres the Vertex button.

      
  Ready to Vertex edit the walkmesh

Select all the verticies around the base of the main stage (leave the ones at the base of the outermost edge of the ramp-- see picture). The easiest way to do this is to click and drag in the Yop viewport to select all the stage's verticies. Then, alt-click and drag in the Left viewport to deselect all the verticies at the top of the stage.

      
  Selecting the verticies around the base

At this point, you can use whatever tools you choose to move the verticies at the base to the desired position. Here's the way I did it: Choose the Select and Uniform Scale tool and (in the Top viewport click in the middle and drag up to scale them all out slightly. Then, I drag-select the back row and use the Select and Move tool to move them back a little farther so they were the same distance away from the base as the side verticies. Finally, pull the verticies where the base of the ramp meets the base of the stage away from the ramp a little. (See result in picture)

      
  Selecting the verticies around the base

Now use the Left viewport to drag and select all the verticies along the top of the stage. Use the same method above, but this time move the verticies in, not out. (See result in picture)

      
  Selecting the verticies around the base

It's time to do a little clean up work on our walk mesh. The game is very particular about the walk meshes being just right. As it stands now, the one we've created so far isn't. Two problems. The first problem is that the bottom edge of the ramp didn't merge with the same edge on the ground plane portion. If you zoom in you'll see that there's a vertex in the middle of the ground side, but not the ramp side. We'll move that over to the corner of the ramp edge and weld it, thereby unifying the edges.

      
  This vertex could cause us some issues, so best to take care of it now

Select the aforementioned vertex at the center of the ramp's base edge. Press the Select and Move button, then right-click it the button to bring up the Move Transform Type-In dialog. Under Absolute World on the left side, set the X value to 1.083 and press the Enter key. The vertex will jump over to the same position as the one on the side of the ramp's edge. Using the Select tool, click and drag the small area around that vertex to select the one you were just working with and the one it is currently covering. In the roll-out under Weld press the Selected button. You shouldn't see anything happen. That means it worked. If a "No verticies within threshold" alert pops up, you either already just welded them successfully and tried again or (if that's the first time you pressed the Selected button) didn't select both the verticies or didn't move the center vertex into the correct position.

Our second issue is that the ramp has a steeper incline than the walk mesh because we pulled in the two top verticies when we altered the top surface. In the Top viewport, select the two verticies at the top of the ramp. Click on the Select and Move tool, then right-click on the button to bring up the Move Transform Type-In dialog. Under Absolute World on the left side set the Y value to -2.0 and press the Enter key.

      
  These two vertexes need to be moved back to their original position

Click the Vertex selection button to toggle out of element editing mode. Under the Display tab, press the Hide Selection button to hide the completed walk mesh.

Dividing a Mesh

Select the stage. Under the Modify tab in the roll-out, press the Polygon selection button. Select the top and sides of the ramp.

      
  Ramp ready for detaching

Scroll down the roll-out until you see the Detach button. Press it. MAX will ask you to name the new object. Type "ramp" and press OK.

In the roll-out, press the Polygon button again to toggle out of element editing mode.

Under the Display tab, choose Unhide All.

You should now have five objects in the scene. The model helper object, the ground, the ramp, the stage, and the walk mesh.

Linking to the Model Helper Object

Press the Select by Name button in the top toolbar and choose the all (four) elements except for tcn01_o30_01 (our Model Helper Object). Press the Select button.

Press the Select and Link button. Then, return to the Select by Name button and press it. The only available option to select should be tcn01_o30_01. Double-click that name. You'll see the Model Helper Object flash momentarily in your viewport. Your nodes are now all parented to the Model Helper Object. Click on the Select Object tool. It's best not to leave the Select and Link tool as the active tool as it's simple to accidentally re-link a mesh to something it shouldn't be linked to.

Exporting the Model

Choose File -> Export. In the Save as type drop-down, select the Neverwinter Nights ASCII Model type.

Navigate to wherever you'd like to save your model, type in the name as "tch01_o30_01.mdl" and press the Save button. Another dialog will open. IT IS VERY IMPORTANT that you UNCHECK the Use Scaling Factor here. Once that's done, press Export.

A quick note regarding having to uncheck the Use Scaling Factor box. Since this is a custom tile created totally from scratch, in order to not have to use numbers in multiples of 100 to match up with other tiles, this is the way I do it. If you'd ever like to cehck to make sure you exported it correctly, simply reset MAX, import one of Bioware's tiles (using the standard scaling factor of 100), then import your new custom tile right on top of it (be sure to use the same scaling factor). They should match up perfectly. If you ever need to import you custom MDL tile into MAX and export it again, you can re-check the Use Scaling Factor at the time of export and have it set to 100 as long as you're sure you originally imported the MDL with a scaling factor of 100 also.

Save your MAX file (let's hope you were doing this throughout the entire process ;) ) and close MAX.

Part 3: Getting It Into the Toolset (and the Game)

Extracting Files with NWN Viewer

Open Zoligato's NWN Viewer. File -> Bif -> Neverwinter Nights. Scroll down the Bif List until you see "data/aurora_tcn.bif" (it'll be right near the top) and click on that. Below in the File List, locate "tcn01" with SET file type. Right-click on that and choose "Extract files(s) to..." and save it where you saved the custom tile from above.

Scroll down the Bif List until you see "data/templates.bif" and click on that. Below in the File List, locate the "tcn01palstd" with ITP file type. Right-click ont hat and choose "Extract files(s) to..." and seave it where you saved the custom tile from above.

Close Zoligato's NWN Viewer

Edit the .SET File

Open the tcn01.set file in a text editor.

The specifics of custom .set entries will be covered fully in another tutorial. For now, find a tile that most closely matches our new tile. In this case, we want a simple square of cobblestone. That is tcn01_a20_01. Do a search for that and you'll find that it's [TILE159]. Copy the entire [TILE159] entry. Scroll to the end of the tile entries (the last tile is 319) and below the last tile entry paste in a copy of 159's entry. Alter the entry you just pasted in to look like this:



[TILE320]

Model=tcn01_o30_01

WalkMesh=msb01

TopLeft=Cobble

TopLeftHeight=0

TopRight=Cobble

TopRightHeight=0

BottomLeft=Cobble

BottomLeftHeight=0

BottomRight=Cobble

BottomRightHeight=0

Top=

Right=

Bottom=

Left=

MainLight1=1

MainLight2=1

SourceLight1=1

SourceLight2=1

AnimLoop1=1

AnimLoop2=1

AnimLoop3=1

Doors=0

Sounds=0

PathNode=A

Orientation=0

ImageMap2D=MICN01_O30

The only changes made above were to the TILE number the Model entry, and the ImageMap2D entry.

Find the [TILES] entry and change the Count=320 to Count=321 to reflect the newly added tile entry.

At the bottom of the .set file, copy the last GROUP entry and paste it at the bottom to create a new entry. Alter the entry you just pasted in to look like this:



[GROUP84]

Name=Stage

Rows=1

Columns=1

Tile0=320

The changes made above were to GROUP number, the StrRef line was deleted, and the Name was changed.

Find the [GROUPS] entry and change the Count=84 to Count=85 to reflect the newly added group entry.

Save the .set file.

Edit the .ITP File

Open the tcn01palstd.itp file in Chanteur's ITP Tool. Double-click the first Element = 0 then double-click LIST MAIN to open it up. There are three folders to choose from. Individual tiles are in the first folder. So, double-click the first Element = 0 out of the three folders in the list to open it up. Click once on the LIST LIST folder to make it the active folder (it's necessar in this application to make the folder active before right-clicking on it.) Right-click on the LIST LIST folder and choose to Add new element. Leave the Element Item ID blank. Type in 2 for the Number of Element Data Items.

In the Add Element Data Item 1 dialog, enter the following and then click OK:



Data Item Type: RESREF

Data Item Name: RESREF

Data Item Value: tcn01_o30_01

In the Add Element Data Item 2 dialog, enter the following and then click OK:



Data Item Type: STRING

Data Item Name: NAME

Data Item Value: Stage

Save the .itp file.

Testing the Files

Copy the following files into Neverwinter Nights override directory:



tcn01_o30_01.mdl

tcn01_o30_01.wok

tcn01.set

tcn01palstd.itp

Open the Neverwinter Nights Toolset. Make a new module. Use the Area Wizard to make a new City Exterior tileset. In the Paint Terrain palette under Features notice that the new tile is listed: Stage. Paint it down near the middle of the area and save the module as "stage test". Close the Toolset.

      
  The test tile in the Toolset

Start Neverwinter Nights. Start a new adventure and click on the Other Modules option. Choose "stage test" from the list. Select a premade character. Once the module is loaded, walk over to your brand new stage. Doesn't look like much right now. No texture and no fancy geometry. However, it serves our purpose perfectly for testing. Try clicking all around it and walking up and down the ramp. Move around the top of the stage. While on top, click on teh ground below and make sure your PC doesn't run right off the edge. Does it ook like the walk mesh is working good? Great. Does it look like it's not? Then you need to head back into MAX and check your walk mesh to make sure you set the surface material correctly.

      
  The test tile in the game

Close Neverwinter Nights.

Part 4: Adding Detail to the Basic Custom Tile

Additional Model Elements

Open your saved MAX file.

Select the walk mesh material. Under the Display tab press the Hide Selected button.

Now it's time to create our curtain support posts. Under the Create tab, make a new Box with the following settings and then press the Create button:



Length: 0.2cm

Width: 0.2cm

Height: 2.5

X: 3.15

Y: 1.9

Z: 1.0

Length Segs: 1

Width Segs: 1

      
  Adding a support post to our stage

Repeat the step above with these settings:



Length: 0.2cm

Width: 0.2cm

Height: 2.5

X: -3.15

Y: 1.9

Z: 1.0

Length Segs: 1

Width Segs: 1

Repeat the step again with these settings:



Length: 0.2cm

Width: 6.5cm

Height: 0.2

X: 0

Y: 1.9

Z: 3.5

Length Segs: 1

Width Segs: 1

Under the Create tab, make a new Plane with the following settings and then press the Create button:



Length: 1.0cm

Width: 6.1cm

X: 0.0

Y: 1.9

Z: 3.0

Length Segs: 1

Width Segs: 1

Press the Select and Rotate button in the top toolber, then right-click the button to open up the Rotate Transform Type-In dialog box. Under Absolute World on the left, set X to 90.0 and press Enter. Close the Rotate Transform Type-In dialog box.

Repeat the previous creation set by making a new Plane with the following settings and then press the Create button:



Length: 1.0cm

Width: 6.1cm

X: 0.0

Y: 1.9

Z: 3.0

Length Segs: 1

Width Segs: 1

Press the Select and Rotate button in the top toolber, then right-click the button to open up the Rotate Transform Type-In dialog box. Under Absolute World on the left, set X to -90.0 and press Enter. Close the Rotate Transform Type-In dialog box.

      
  Rotating the new Plane

One at a time, select one of the five objects you just created and look under the Modify tab. In the modifier stack box right-click on either "Box" or "Plane" and convert the geometry into an Editable Mesh. (Note: You'll have to rotate the Perspective viewport around to get at one of the planes that make up the curtain considering they face opposite directions in the same spot.)

Click the Select by Name button in the top toolbar and highlight everything in the list except for tcn01_o30_01 and press the Select button. Press the Select and Link button in the top toolbar. Press the Select by Name button again. Your only choice should be tcn01_o30_01 so double-click on it to link all your new geometry to the Model Helper Object.

Part 5: Texture the Tile

Extract Textures with NWN Viewer

While we could make a custom texture for everything (and will make a custom texture for one thing) it never hurts to use Bioware's existing textures... especially when you're just starting out.

Using the same directions for extracting the .set and .itp file with NWN Viewer, extract these textures from data\aurora_tcn.bif:



tcn01_bridge02 (TGA)

tcn01_cobb03 (TGA)

tcn01_hrdwd01 (TGA)

Extract the following texture from data\textures_01.bif:



micn01_a20 (TGA)

Apply Textures in MAX

In MAX, select the ground plane and press the M key to bring up the Material Editor. Click on the first grey sphere. Under Blinn Basic Parameters find Diffuse. Click the larger, grey color box right next to it. In the Color Selector: Diffuse Color dialog that pops up, slick the arrow on the Whiteness slider all the way down so it's completely white. Click the close button.

What we just did will not affect how textures look in your basic viewports in MAX. However, if you fail to set the diffuse color to white your models will look much darker in the game.

Next to the diffuse color square is another smaller grey square. Press it. The Material/Map Browser will open. We're adding a graphic texture, so double-click on Bitmap in the list. Browse to where you saved the TGA's we extracted with NWN Viewer, select tcn01_cobb03.tga, and click Open. Press the Assign Material to Selection button and the Show Map in Viewport button. The ground plane will turn grey in the viewport.

      
  Two buttons you should become very familiar with

With the ground plane still selected, click on the Modify tab. In the Modifier List drop-down, select UVW Map. Set these parameters in the roll-out below:



Mapping: Planar

U Tile: 2

V Tile: 2

By using a value of 2 for the U and V tiling, the new tile will match up with the existing Bioware cobblestone tiles perfectly.

Select the stage platform and press the M key to bring up the Material Editor again. Click on the second sphere. Set the Diffuse color to white as before, and apply a bitmap. This time use tcn01_hrdwd01.tga for your texture. Click the Assign Material to Selection and Show Map in Viewport buttons.

With the stage platform still selected, click on the Modify tab. In the Modifier List drop-down, select UVW Map. Set these parameters in the roll-out below:



Mapping: Box

U Tile: 2

V Tile: 2

      
  Applying a UVW Map

Select one of the vertical posts and press the M key to bring up the Material Editor again. Click on the second sphere (it should already have a wood texture on it). Click the Assign Material to Selection button. Apply a UVW Map modifier with these parameters:



Mapping: Box

U Tile: 0.1

V Tile: 1.0

Select the other vertical post and repeat the step above.

Select the top, horizontal beam and apply the wood texture, using these UVW Map settings:



Mapping: Box

U Tile: 0.1

V Tile: 3.0

The texture we just applied to the horizontal wooden beam is pointing the wrong way. To fix this, rotate and re-fit the UVW mapping gizmo by: Under Alignment in the roll-out, click the X radio button. Then click the Fit button.

Click on the ramp to select it. Open the Material Editor and apply the wood material to the ramp. Apply a UVW Map modifier with these settings:Mapping: Box

U Tile: 0.666

V Tile: 1.0

Multiple Resolution Custom Texture

Open Photoshop. Create a new image as follows:



Resoution: 72dpi

Height: 512 pixels

Width: 512 pixels

Fill the background layer with black.

Create a new layer. On the new layer, draw a segment of a pulled up curtain (see picture). Make sure that the sides match up so there will be no obvious seams when it is tiled horizontally.

      
  A curtain segment. (note: your 512x512 image will be larger)

Ctrl-click on the layer your artowrk is on to load its transparency as a selection.

Click the channels tab in the layers palette. Press the Create new channel button to create a new channel (Alpha 1).

      
  The Create new channel button

Press the D key to reset Photoshop's active colors to their default. Alt-Backspace to fill the selection with white. This is the alpha channel that will tell NWN how to define transparency for this texture.

      
  The completed alpha channel (note: your 512x512 image will be larger)

Click on the Layers tab to return to the layers palette. Click on the background layer to toggle out of channel mode.

Save the image as it currently stands in PSD format for backup purposes.

Press Ctrl-Shift-E to collapse your visible layers into one.

Now we're ready to make two version of our new texture. One at high resoultion we will convert to DDS format. Another at low resolution we'll keep as TGA format. The game will automatically toggle between the low-res and high-res versions depending on the PCs relevant position to them in the game.

Under the File menu, choose Save As... Type "curtain" as the file name. Choose Targa in the Format drop-down. Make sure the Alpha Channels box is checked. Navigate to where Bioware's DDS Tool is installed and save the image in the DDS Tool's in folder. After you press the Save button, Photoshop will prompt you to pick a bit depth. Choose 32 bits/pixel and click Okay.

Under the Image menu, choose Image Size. Make sure the Constrain Properties box is checked. Change the Pixel Dimentions so that Length and Height are both 128 pixels.

Under the File menu, choose Save As... Type "curtain" as the file name. Choose Targa in the Format drop-down. Make sure the Alpha Channels box is checked. Save this version of the curtain.tga directly to NWN's override folder. After you press the Save button, Photoshop will prompt you to pick a bit depth. Choose 32 bits/pixel and click Okay.

Open up the micn_a20.tga file we extracted previously with Zoligato's NWN Viewer. Alter it so that it has a little wood-colored shape on it the roughly the shape of the stage. This will be the image for the mini map.

      
  Mini map image

Under the File menu, choose Save As... Type "micn01_o30" as the file name. Choose Targa in the Format drop-down. Save the file directly to NWN's override folder. After you press the Save button, Photoshop will prompt you to pick a bit depth. Choose 24 bits/pixel and click Okay.

Close Photoshop.

In Windows Explorer, navigate to where Bioware's DDS Tools are installed. Double-click the runme.bat file. A couple windows should blink open, then close. Looking inside the out folder, find the curtain.dds file. Copy that to NWN's override directory.

Note that Bioware's DDS Tool doesn't work with all video cards. If after running the runme.bat file there is no curtain.dds in the Out folder, it won't work for you. This isn't the end of the world, as you can simply provide your tiles with only the 128x128 TGA version you saved to the override folder already. One thing you shouldn't do is supply a 512x512 texture that's not in DDS format. It's too large and too many of them will bog down the game engine.

Return to MAX. Click on one of the vertical planes that still don't have a texture.

In the Material Editor, select the third material and set the Diffuse color to white. Apply a bitmap, using the curtain.tga you saved directly to NWN's override folder. Click the Assign Material to Selection and Show Map in Viewport buttons. Apply a UVW Map modifier with the following settings:



Mapping: Planar

U Tile: 5.0

V Tile: 1.0

Depending on which plane you selected to texture first, you may or may not need to check the V Tile's Flip checkbox to get the curtain hanging in the proper direction.

Select the plane on the opposite side of the one you just textured (this will require rotating around in the Perspective viewport) and repeat the step above.

Your simple Stage is now fully textured.

      
  It'll do

Under the Display tab, press the Unhide All button.

Save your MAX file.

Export the Completed Tile

Under the File menu, choose Export. Select Neverwinter Nights ASCII Model as the file type in the drop-down. Type in tcn01_o30_01 for the file name and save directly to NWN's override folder (overwriting your old, untextured testing tile). IMPORTANT: Once again, be sure to UNCHECK the Use Scaling Factor checkbox in the MDL Export dialog box, as we created this as a true 10cm by 10cm tile.

Part 6: Finishing Up

Test the Finished Tile

Run Neverwinter nights again and choose the "stage test" module you made earlier. If you followed the steps above correctly, you'll see that your new model is in the game, fully textured, and working fine.

      
  Now you can put on that Dwarven play. Finally!

Compile the HAK

Open the NWN Hak Editor (nwnhak.exe is in the NeverwinterNights/NWN/utils folder)

Right-click inside the empty resource window and choose Add. Navigate to the override folder and add the following files:



tcn01.set

tcn01palstd.itp

tcn01_o30_01.mdl

tcn01_o30_01.wok

curtain.dds

curtain.tga

micn01_o30.tga

Set the Title, URL, and Description to whatever is relevant to your new tile (in our case, we'll title it "My first-- and last-- city exterior stage tile".

Under the File menu, choose Save As... In NWN's hak directory save your file as stage01.hak

Move the files you added to the .hak from the override directory. The override directory should only be used for testing and you should never leave your work files there for good.

Distribute and Enjoy

Distribute your .hak in any way to see fit to whoever you see fit to distribute it to. I'd suggest making a ZIP file that contains the .hak as well as a ReadMe.txt file that contains a description/instructions for your tile.

Conclusion

Hopefully the above tutorial gave you a good overview of the basics of tile creation. Can you whip out a 100% new tileset just yet completely from scratch yet? No. That takes a little more understanding of the .set and .itp file which we'll cover in later tutorials. You can use LabTek's tileset duplicator to create a "new" tilset with all the contents of contents of the duplicated one, however, and add new tiles to it to your heart's content. So, you're 95% of the way there. If you want to get into more in-depth .set and .itp editing right away and don't have the patience to wait for the next tutorial, check out LabTek's musings on those file types for more information.



As for our stage tile, it's not bad. Could be a lot better. There are some hidden faces on the top and bottom of the vertical posts we could remove (we always want to reduce the poly count wherever possible). We could apply trimesh modifiers to our meshes and tweak things like the shadow and tilefade properties to get our tile a little more functional. We could add scene lights, daytime/nighttime animations to vary elements of our stage depending on the time of day. We could even add a flex modifier to the curtain and set it so that it'll flap if the wind blows.

For now? It'll do.

Email me if you have any suggestions on additions to this tutorial or portions which need to be made clearer. Unfortunately, my work schedule does not allow me to answer every e-mail along the lines of "I tried your tutorial and my tile doesn't work. What am I doing wrong?" When it comes to tile creation, as you can see from the novel-length tutorial above it's a very complex process (and we barely scratched the surface). There are literally hundreds of things that could go wrong through the entire process. The best advice I can give is to go through the tutorial again from scratch, don't stray or do anything different, and you should be a-okay. Once you get more comfortable with the process, then start getting creative. Import existing NWN tiles into MAX to see how they're built and how simple they keep their geometry (I can't stress low poly count enough.) Look at some times with varying walk heights and see how simple they keep the walk meshes.

X

Migrate Wizard: 
First Release: 
  • up
    50%
  • down
    50%