NWmax Documentation
From NWN1 Custom Content Guide
Contents |
[edit] Nwmax Documentation
This documentation is based on NWmax v0.8 b46 .
THIS SECTION IS ---- UNDER CONSTRUCTION ----
[edit] General
NWmax is designed along the same lines as the Aura scripts from Bioware and the MDL Suite. In fact those original works provided some of the original code that started NWmax off many months ago. Anyway, the point is NWmax uses Helper Objects and Modifiers to hold all the Aurora Game Engine data the NWN needs for a model.
It is worth while reading about the concepts of modifiers in the gMax/3dsMax user guide and the gMax/3dsMax tutorial files. The key concept is that each modifier performs something on the mesh's data and passes the resulting mesh up to the next modifier in the stack. Some modifiers actually do nothing to the mesh other than provide a means of holding extra data against that mesh. This is what the Aurora modifiers do. They do not change the mesh in any way. All they do is hold Aurora Engine specific data against the mesh for use by the NWmax export functions.
Note that a lot of the text herein is directly copied from Bioware's Aura Export documentation and their Tileset Tutorial because NWmax and Aura are identical in many aspects.
[edit] Compatibility
NWmax is a plugin script for use with either 3dsMax or it's free Version Gmax. There are versions available for both 3dsMax and Gmax. Please make sure you have downloaded and installed the right one for your application. It is known to work on 3dsMax versions 5,6 and 7. 3dsMax 5 needs to be updated to 3dsMax 5.1 , while 3dsMax6 needs the ServicePack1. For use with Gmax you have to have version Gmax v1.2 installed.
NWmax will cause conflicts with Bioware's Aura export scripts, you cannot have them both installed at the same time in the same installation. (You can install Aura for use with 3dsMax5 and NWmax for use with 3dsMax6, though) There are no known conflicts with MDL suite.
As a general rule, you cannot use objects from one scriptset and export it with another. So if you have NWmax + MDL suite installed for example ( for whatever reason), you have to make sure not to use any MDL-suite modifiers or objects in a model you want to export using NWmax.
[edit] Setting up NWmax
[edit] Installation
There are three installation packages available ( atm - v0.8 ) .
- Gmax - which can be used with the free Gmax v1.2, this will also install the Snoop application which is needed for exporting, as Gmax doesn't have any file creation functionality otherwise.
- 3dsMax 5 - for 3dsMax 5 , you should have the 5.1 update installed, too
- 3dsMax 6 - for 3dsMax 6 , you MUST have SP1 installed, else NWmax won't work due to script function errors in the 6.0 version of 3dsMax.
This installation package will also work with 3dsMax7 and 7.5
The installer should usually find the correct place for the installation. If it doesn't find it, point the installer to the main folder of your application, eg c:\Gmax\ or c:\programs\3dsMax6\ .
[edit] Preferences
For basic setup see here: Setting_up_3dsMax_and_Gmax_for_NWN
[edit] Gmax & NWmax
- A key element of the NWmax (gmax) package is NWmax Snoop. This is the little windows program that sits in the system tray and gets all that information out of the gmax Listener window. This program has been written under Win2k and tested under Win2k/WinXP. It does not work on Win9x.
- Version 3.0 of the Custom Content Guide (CCG) and the video tutorials by Danmar are out of date with respect to NWmax. They refer to Wayland's discontinued script. All references to copy/paste from the gmax Listener are obsolete. Please be aware of this when using these otherwise useful resources.
[edit] The Snooper
- during export the Snoop icon should turn green. If you're using Gmax and don't have the icon in the tray, make sure you have installed the correct version and use the desktop shortcut that is created in the installation, as this will also start Snoop.
[edit] Basic Useage and Workflow
[edit] Model Basics
In order for the engine to see a model made in 3DSMax/Gmax, it has to be linked hierarchically to a base node called an AuroraBase. To make one of these objects, go to the create panel, and into helpers. You'll see it there. When you create this object, it shows as a small box in the view port. The position of this AuroraBase with respect to the model is important, as the AuroraBase becomes the action point of any parts that are linked to it. The name of the Aurabase is important as it becomes the name of the exported model. Also, it should be noted that it's best to make all your Aurabases in the top viewport or in a user view, so that there's no rotation on the Aurabase, as this might cause some confusion. In the engine, we define all the objects that were linked to the Aurabase as "parts" and the Aurabase and all it's hierarchy as a "model". In order to export a model, go to the modifier stack of the AuroraBase, and find the "Export Model" section. Once you press this, go to the directory you had as the export directory (in your Configure Paths roll-out), and you should see the .mdl for your model. Again, more will be explained on this later. (NB: Un-textured objects will appear white by default in our engine.)
The model that gets exported is a simple text file which has information on the model as a whole, then information about each part, then animation data. Please feel free to open an exported mdl with a text editor to see what I mean.
One of the first things you may notice about making models for the BioWare Aurora Engine is that the scale transform is never exported. The simple work-around for artists on this problem is to reset the X-Forms of an object before exporting it. This relates to mirroring as well, as max defines an object mirror as a -100% scale on a certain axis… a scale that the engine cannot reproduce. Again, a reset of the X-forms (in the tools panel) will set things straight. As well as this, any scaling that is done on a sub-object level (verts, faces, and elements) will work, as will the use of the mirror modifier.
The AuroraBase is the place where you can adjust specifics of a complete model, as you can see by the modifier roll- out. For most of the specifics of a single part, we have a modifier called AuroraTrimesh. In the advanced section, this is the modifier that will be used a great deal.
[edit] Pivot Points
Similar to the scale issue, (G)Max handles the movement of the pivot point strangely. When you move the pivot point in the hierarchy panel, max simply stores the offset to the geometry, so the model will still export as if the pivot was never moved. We have to make sure that the origin of the object is the same as the pivot point location; otherwise there will discrepancies between the max view and the in-game model. Again, the solution is to reset the X-forms in the tools panel. For objects that have already been animated, resetting the X-forms really screws things up, so I would advise sorting out and locking the positions of the pivot points before animation starts.
Also, NWmax rounds the position of static objects to the nearest cm, so to avoid seams it's best to make sure that your pivot points in Max are square on cm values. This is only really necessary for static mesh, characters and other general things will work fine. If you see seams, this will most likely be the problem.
[edit] Shadows
The real-time shadows are especially nice to watch in the game, but sometimes they can be a little painful to make work the way you want them to.
The first rule of these shadows is that they HATE non-manifold edges. If a single edge has more than two faces built on it, then the in-game shadows will "tear" (you will know a "tear" when you see one). It's best to make sure you do not model this way, as it will just cause you much anguish (unless you can write a maxscript that finds them and solves them for you!). STLCheck is a useful modifier to have around to check for problems too.
The second rule is quite fussy. It's our experience that the problems associated with this rule normally only occur with "larger sized" objects, bigger than 0.5m3 in my estimation, so normally on the landscape pieces. For me to explain the second rule, it's best to explain how the shadows are made. This is how the programmers get the shadow to the screen. First they try to fill the volume of a whole object using the pivot point of that object as a connecting position. With this shape, they then trace these polygons at a tangent away from the light (called shadow volumes). Wherever these polygons touch another object, they re-draw the shape… only at the plane of the camera. They then draw the final shape from all these volumes as a ‘darken' over the entire scene (called screen buffering). Anyway, for all this to happen correctly, the pivot point of the object has to be in the correct place… in general, all triangles have to be facing AWAY from the pivot point. With some objects this will prove a very difficult job… and they will either have to be split into a couple of pieces, or remodeled so that they work in a more desirable way. It's not pretty to work with, but when all the dust settles, it makes a huge difference to the look of the game.
NB: if you're having other problems, check the height of your object as there is a "ShadowDepth" value in the game that cuts off all projected shadows below this point.
[edit] Material Basics
In the BioWare Aurora Engine we assign one targa (.tga) map to one part. Multi-sub objects are not supported by the graphics engine (except for walkmeshes) NWmax allows Multimaterials, but each part still can have only one bitmap assigned. In this case NWmax will use the material of the first face on the object.
Create a simple material in the max materials window, which has white in the diffuse, ambient and specular color slots. Then assign one "bitmap" to the diffuse texture slot, and you can then apply this material to any object in your scene. Fairly simple, just try to avoid any other options at this time. In terms of mapping, any type of object mapping works fine.
In order to see the texture in game, the texture does have to be copied into your Override directory with the model file, or placed in a hak. You can also reference textures that come with the game, without the need to put these into a hak. To do this export the texture(s) as tga using NWNexplorer and apply/map them to your parts.
The name length of the targa file and material must be under 16 characters (15 to be safe), but the export checks will let you know if names do go above limits.
[edit] Animation Basics
Animate your model the way you'd normally expect, but do remember to bracket your animation (keyframe at the start and end) if you expect it to loop properly, as only keyframe info from the start to the end is stored. Any position/rotation animation that comes from a previous keyframe will not be seen. Under the modifier panel for the AuroraBase of that model, you will see a box that can store a long list of animations, and their frame ranges. It should be quite easy to make a new animation, just ignore the trans-time value for now, and leave it at its default.
With the above information, you should be able to export a simple model… at least a moving box or sphere or something.
[edit] Exporting a Model
All objects of a model need to be linked to an Aurora Base helper object, either directly or indirectly. To export a model you can either use the export buttons on the base, which will only export the selected model or the mass export functions on the NWmax tab. The mdl files will be created in the directory given on each Aurora base. This defaults to the /meshes directory of the (G)max installation.
If you're using NWmax for Gmax, make sure the snooper is running and it's flashing green (showing the export process) when you press the export button. The green flashing shows that the snooper is grabbing the exporter's output from the listener and is creating the file.
[edit] Sanity Checks
NWmax has a build-in error check system called 'SanityChecks' that check for common problems in a model that would create an invalid or problematic model. When one of the sanity checks fails NWmax will pop up a message. You can check the origin of the sanity check by pressing the 'ShowSanity Check Results' button on the AuroraBase. A text file will come up with a list of exported resources, some will show an error message if a SanityCheck failed on it.
Follow this link to a detailed description of the sanity checks: NWmax SanityChecks
-- NOTE -- Since NWmax v0.8 b52 the AuroraBases don't have individual sanity checks anymore. Instead you set the checks you want to apply during export on the NWmax panel, in the 'General' Section.
[edit] Importing a Model
[edit] The Objects
| Image:Nwmax doc sumobj.png |
|
[edit] The Modifiers
To tag objects with properties used in the NeverwinterNights engine NWmax uses a set of modifiers.
| Image:Nwmax doc summods.png |
|
[edit] The NWmax Panel
| Image:Nwmax doc panelall.png | When you start Gmax/3dsMax with NWmax installed a large window will either
pop up or be docked to the side of the viewports. This is the NWmax Panel. It contains a great amount of tools you will use in your work. Many of those are for very specific uses (like Cryomesh) and may require indepth knowledge of NWmax and/or the NWN engine, while others are of general use (like the import/export functions). The current panel has the following rollouts which allow access to the various tools :
|
[edit] NWmax.ini
[edit] Tutorials
There is a large number of tutorials available for NWN. But only a few are made using NWmax, but other earlier released exporters such as MDL-Suite and Waylands Gmax exporter. Many users complain about that fact, but these tutorials are still very useful for learning the concepts of NWN.
All the modelling basics stay the same, no matter what scriptset you use, and the concepts of making a model nwn-ready are (almost) always the same. You can still use these tutorials with a little 'translation' - there's a 'dictionary' here: Translating_Existing_Tutorials
I'll try and compile a list of NWN-modelling tutorials that are available.
[edit] List of Existing tutorials
[edit] On-site Tutorials
- Making_a_Snow_Owl (NWmax)
- Placeable:Tutorial (3dsMax, NWmax)
- Robes:Tutorial (3dsMax/Gmax, NWmax)
- Head Fix (NWMax, NWN 1.66)
- NWmax Basics #1 - Exporting - A tutorial in flash format showing the basics of creating and exporting a model with NWmax.
You should enable your browsers full screen option for this (usually by pressing F11) .
[edit] Off-site Tutorials
- LOK Video Tutorials (by Danmar)
These are a series of videos made by community member Danmar, they cover every basic aspect of modelling and getting a model into NWN - These are a MUST HAVE for beginners. Remember, even if some of these use 3dsMax or Gmax, MDL suite or Wayland's export scripts - the concepts are the same, no matter what scriptset (like NWmax) or application (3dsMax/Gmax) you use.- LOK Quick Tutorial 1 a tutorial on creating basic walkmeshes
- LOK Tutorial 1 : Create Placeable Model (3dsMax,MDL-Suite)
- LOK Tutorial 2 : Create placeable in GMax (Gmax,Wayland's Export)
- LOK Tutorial 3 : Export Models (3dsMax/Gmax, MDL-Suite/Wayland's Export)
- LOK Tutorial 4 : Texturing (3dsMax/Gmax, MDL-Suite/Wayland's Export)
- LOK Tutorial 5 : Adding Animations
- LOK Tutorial 6 - Weapons
- LOK Tutorial 7 - Creature Creation
- LOK Tutorial 8: Texturing
- A Guide to Texturing or Retexturing Skins in Gmax
- Comprehensive Custom Door Tutorial (3dsMax,Aura) The most complete door tutorial ever! Translates easily to NWmax as it uses Aura.
