Author Topic: Basic Gmax Tutorial  (Read 528 times)

Legacy_Randomdays

  • Sr. Member
  • ****
  • Posts: 336
  • Karma: +0/-0
Basic Gmax Tutorial
« on: June 28, 2014, 04:42:30 am »


               

This was requested, and while I'm probably not the most expert user on the forums, I think I can cover the basics for those who no experience at all.


 


NWN uses the Aurora 3d engine. All items, creatures, buildings, etc are 3d objects within the game. A 3D model is also known as a mesh. With editing tools, you can change the items in the game or create new items to enhance/ expand what's available out of the box. The base file type for a NWN 3D object is in the mdl file format.


 


 


Gmax is a free 3d model editing tool that, along with the higher quality and expensive versions of Max, is the most common program used to make new items for NWN. Other popular free editing programs are Blender, Milkshape and Sketchup. All 3 of these can output a model in the obj file format that Gmax can import with the right script.


 


Gmax is a stripped down version of Max and knowing how to work with one is a good base for working with the other. Gmax hasn't been updated since 2005 with the latest version being 1.2.


 


A safe download site for it is at turbosquid, which also has support files and tutorials for it. You'll have to activate it with a code given after you make a free account on the site. Write down the code or copy the webpage somewhere safe so you don't have to repeat the process later.     http://www.turbosquid.com/gmax


 


After downloading and setting up Gmax, you'll need a custom set of scripts created for NWN called NWMax. These scripts have different versions as they've evolved and are available both for Max and Gmax. Make sure you download and setup for the right programs. I'm using an older version so your setup might be slightly different than mine


 


http://forum.bioware...x#entry16699773


 


http://forum.bioware...ileset-creator/


 


 


Both Gmax and NWMax should create shortcuts after install. Both will look the same after starting up with the NWMax floatbar in place, but using the Gmax shortcut won't run all the NWMax scripts and you won't be able to export NWN models. Always try to run from the NWMax shortcut. The NWMax "snoop" icon should be in the bottom tray if things are running correctly.


 


gmax01_zps54193f09.jpg


 


 


After Gmax/ NWMax is running, you should see the main Gmax screen with a movable NWMax floatbar on top. The Gmax screen is divided into 4 views of the 3d item you're working on. There should be a row of icons up top and a command panel on the right with tools to edit your work.


 


The 4 view windows should each have a description of what view they're showing in the upper left corner. Right clicking with the mouse on the description will bring up a menu of options. Default setup is front, top and left side views, showing the grid and in wireframe format. The fourth view shows the item in "perspective" 3d view from the front, as it should appear in the game.


 


You can change the views or how they're displayed from the menu. Moving the mouse to the edge of one of the views will allow you to grab the edge and change the size of each window if you want.


 


The active window will have a grey outline around it. On the far bottom right corner of the screen are a bunch of buttons. Leaving the mouse pointer on any button on the screen will bring up a small popup box for that button. The last button on the bottom right is the "min/max" button. Clicking on this will enlarge the active view box to full screen and a second click will resize it back to normal.


 


Creating a simple object


-------------------------------


 


On the right side of the Gmax screen is a control panel. Moving the mouse pointer again over any button will bring up a popup box. If not already selected, click on the "geometry" button on the bottom left of the two rows. There should be a scroll box below the buttons with "standard primitives" in it and some buttons and other info choices below.


 


Primitives are basic 3d shapes that you can build more complex items from. We'll start off making a simple box in the 3d world.


 


Select the box button. The name and color choice lets you name the item and what color in the editor, not in the game, the item will be. With no name selected it will auto assign a name. In this case "Box01".


 


The creation method choices are cube or box. Cube is a one step method to create square boxes. Box is a two step method that can crated any shape rectangle type boxes.


 


The parameters for length, width and height will change as you create the box. The segments buttons below will make the box more complex to make more involved items when editing. Leave those at 1 for now.


 


gmax02_zpse75f96d0.jpg


 


Move the mouse pointer to the top view, pick a spot near the center and hold the left button down. This sets the start of the box creation. Moving the mouse will draw the basic length and width of the box. Letting go of the mouse button sets the size of the box base. Now, moving the mouse up will change the height of the box. Clicking the left mouse button again will set the height and complete the creation.


 


gmax03_zps947d43e4.jpg


 


On the right panel, You'll now see the name "Box01" and a color box next to it. Clicking on the color box will bring up the color choices and you can change the box color if you want.


 


gmax04_zpsb9420387.jpg


 


On the view panels, the two black lines that cross in the middle are the axises. You'll want the object close to the middle on the top view. On the front and side views, for the Z axis, this will be "ground" level in the game. Any part of the object below the line during creation will be below ground in game.


 


On the top menu bar, there's a few buttons we'll look at now. Click the "Select and Move" button that looks like two crossed arrows. This works with the X,Y,Z and XY buttons to the right. Select the "X" button and then the box in any view. The box will turn from its color to light grey to show its selected. Holding the mouse button down, you can move the box to the left or right. Moving the box left and right changes its local X. In top or front view, you're moving it left or right, but in left view, you're actually moving it forward and back in the 3D world.


 


 


Right clicking on the "Select and Move" button will bring up a popup box where you can input your XYZ positions to find tune the items location by numbers. 0/0/0 will center the box.


 


gmax07_zpsad309846.jpg


 


The buttons next to "Select and Move" are the "Select and Rotate" button and "Select and Uniform Scale" buttons. These will allow you to rotate or enlarge the item in any of the 3 axises/ dimensions. In game, you can only rotate an item in the z axis. These are usually more easily changed with the popup box than by moving the item itself.


 


Editing the object


-----------------------


 


Right click on the box in any view and bring up a popup menu. Select the "Convert To" line and the "Convert to Editable Mesh" sub option. This will allow you to work with the box to shape and change it.


 


gmax05_zps8e0ea33c.jpg


 


The right menu bar has now changed to the "Modify" button allowing you to edit the box.


 


Every 3D item in the game is made of small dots called vertexes. The vertexes connect to each other to make lines or edges, and the lines will connect to each other to make triangles or squares.. Each triangle is called a face or polygon, "poly" for short. When an object is called low poly or high poly, its referring to the number of polys making the object. NWN items are considered low poly compared to whats being created today. The more polys in an object, it might look better in game but puts a greater load on the engine to draw it.


 


gmax06_zps04081bf3.jpg


 


Select the "vertex" button on the right toolbar and you'll see blue dots appear on the object in all views. these are the vertexes that make up the box. Select a vertex in a view in it will turn red showing that its selected. Holding down the "ctrl" key will allow you to select more than one vertex.


 


With the "Select and Move" button you can move the vertex and change the shape of the box.


 


gmax08_zpse26dd142.jpg


 


To undo any change, the "undo" button on the upper left of the bar will revert you 1 step. You can do multiple undos to go back a number of steps ("Ctrl Z" will do the same)


 


All the changes you've done to an item will not show on your export until you confirm and lock them in. To do so, click on the "mesh tools" button on the NWMax floating toolbar to expand it.Click on the "ReseTXForm" button to lock in your changes.


 


gmax09_zps6e84128b.jpg


 


Textures


-----------------------------------------


 


Textures are pictures that are pasted on the the faces of an item to change its appearance. A good texture can make a low poly item appear much higher in quality.


 


NWN uses tga type files for their textures.Textures are applied to the faces of an item similar to wallpaper. You can change an applied texture for another one and change the item to a completely different one, IE changing a wooden wall to a stone one.


 


Its important to know that textures are applied to only one side of a face. The other other side will usually appear completely invisible in game. To have the textured item show on both sides you'll need to double the sides with the texture showing on the outside of each. For an item showing only one side, like a building with no openings showing the inside, this isn't important. But a double sided item like a tree branch will need this.


 


For the box example its not important, but textures are "mapped" to the items faces. Each area of the texture is assigned to a mesh face.


 


Below is a character from another game, a texture mapping wireframe outlining where each part of the texture would be assigned, and the texture used for the character. Each game applies the textures differently so you won't be able to just take a texture from another game and apply it to a NWN mesh without work. Some textures only show half a character, mirroring one half onto the other side of the mesh.


 


gmax10_zps73aa832e.jpg


 


male_basic_WIRE_zpsbbef86f5.jpg


 


male_basic_zps1c59f3a2.jpg


 


To apply a texture to the box, open the Gmax material editor, either using the round ball icon on the top bar, second to the end, or hitting the "M" key.


 


gmax11_zps9592ff86.jpg


 


The box has no texture assigned to it, so select the "new" button to create one, then select "standard" for material type.


 


gmax12_zpsf5494e3c.jpg


 


Under the "Blinn Basic Parameters" , click the small grey box to the right of the large grey "Diffuse" box. This will open up the "Gmax Material Navigator" window. Left click the "Bitmap" button twice to open up a directory window where you can browse thru any of the tga textures you have on your computer. You'll now see the texture in the "Bitmap Parameters" area.


 


gmax13_zps2229ddde.jpg


 


To put the texture onto the box, select the "Apply" button near the top of the material popup box, and then the blue checkerboard cube below it to see it on the box.


 


gmax14_zps3773636f.jpg


 


Edit - For some reason, The box won't show the texture for me sometimes if I convert to an editable mesh first. Setting up the texture first and then converting to the editable mesh always seems to works.


 


 


For some textures, check out the following ; http://forum.bioware...e-stock-images/


 


                                                                     http://forum.bioware...res-on-the-web/


 


 


For NWN


-------------


 


The easiest items to make for NWN are placeable items. To get the stone block into NWN takes a few more steps. Every item in NWN has a base. The base has the information of the model in it. For a character or creature, the animation sequences for that creature are in the base. The easiest way to get the box in game is import an existing similar item into gmax and remove everything but the base and NGon01 pieces, adding your new item to the imported base.


 


A finished model ready for use in game should have the following. ;


 


In GMax - the model will have the 3d model itself with the Aurora Trimesh modifier added to it. This will let it be seen in game and, if not too complex, give it a shadow.


 


                The NGon01 and Base needed for the game game engine. The 3D model is tied to the base in Gmax.


 


                If a shadow is desired and the model is very complex, the shadow can crash the game. A separate, simpler, shadow mesh can be setup and added if needed


 


                If the model is loaded in game as above, the character will be able to walk thru it like it wasn't there. For items like small bushes or grass, etc, this is fine. For a tree or large rock you'll need to add another item to the model.


 


                The pwk part of a model sets up the walk mesh for the item where the character can and cannot walk. A separate mesh is created and tied to the pwk to set this up.


 


                The last part that might be needed is a use node. When a character clicks on a useable item, it will try to move to the item to interact with it. The character is actually using the base part of the mesh. If the object is not walkable and is bigger that the base, the character will not be able to reach the base and the item can't be used. Making a small use node and attaching it to the pwk will move the character to the usenode instead of the base and the item will be used from there.


 


 


Once exported from the GMax, the entire model will consisted of 3 parts usually - The mdl file - the 3D model


                                                                                                                                The pwk file - Walkmesh for the model if setup


                                                                                                                                One or more tgas - the textures for the model.


 


 


A lot of this is gone thru in another walk thru for Gmax I did awhile ago on importing an item into Gmax to make into a NWN placeable . Found here -


 


http://forum.bioware...kthru-for-phod/



               
               

               
            

Legacy_Tarot Redhand

  • Hero Member
  • *****
  • Posts: 4165
  • Karma: +0/-0
Basic Gmax Tutorial
« Reply #1 on: June 28, 2014, 10:44:49 am »


               

Thanks for this. Although early warning I may start asking questions later once I've actually read through it.  '<img'>


 


TR



               
               

               
            

Legacy_MerricksDad

  • Hero Member
  • *****
  • Posts: 2105
  • Karma: +0/-0
Basic Gmax Tutorial
« Reply #2 on: June 28, 2014, 02:42:29 pm »


               

I haven't read more than a quarter of this, but I like what you are doing. Have you already put a clone of this up on the new vault? If not, please do so! You never know when this forum will get screwed, like everything else, and duplication is key with NWN.