Street Fighter: A Max Payne 2 Modification
    


 
Street Fighter: A Max Payne 2 Modification
NAVIGATION
Home
Level Pics
Character Tutorial
About
The characters
Blanka
Evil Ryu
Juli/Juni
Guestbook
Trimesh Tutorial
Feilong
Media
Links






    
Trimesh Tutorial - By Aztec

Trimesh Tutorial.

 

Introduction.

 

Trimeshes are objects created in 3dmax for use within Maxed2. Trimeshes are normally used for complex level geometry or complex objects that are either impossible or not appropriate to be made in maxed2. There are several examples in MaxPayne 2 that use trimeshes in favour of maxed2 made geometry, things like statues, some vehicles and others are all trimeshes.

 

It is widely believed that the excessive use of trimeshes in a level can decrease the fps (frames per second) and the overall performance of the game. In my experience (and I’d rather use a trimesh over any maxed made geomentry any day of the week) this is not the case. In fact the largest factor of poor fps in a level is the lack of optimisation and layout on the level makers part. 

 

A well-built trimesh would be the most optimised part of your level full stop; again this is because of 3dmax’s better optimisation tools.

 

Here is a quick run down of the advantages and disadvantages of using 3dmax trimeshes within your level.

 

Advantages:

 

* The creation of complex objects that are either impossible/extremely difficult or time consuming to create in Maxed2 can be created easily in 3dmax.

* Greater texturing abilities and mapping tools for objects

*Better optimisation methods available than those in Maxed2.

 

Disadvantages:

 

Trimesh objects can’t be edited in anyway once they are exported from 3dmax, think of them as an unlockable prefab. Any adjustments need to be made in 3dmax then exported again.

Poorly built models can cause collision and physics problems if they are intended to be dynamic objects (this is really a problem down to the model maker really, and I’ll explain about this in more detail later on).

 

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

 

Now that little bit is out of the way on with the tutorial.

 

1) Before starting off you’ll need to make sure that you have the Remedy plug-ins installed correctly and that you have created a tool bar to access the tools. The toolbar should look similar to the pic below.



 

2) The next step is preparing the model itself. Once the model is completed you may have several sections or parts that make up the geometry of the model. You can either attach the model to form 1 mesh (useful for static meshes) or you can leave the sections/parts as they are if you intend to have them as dynamic objects so you can animate them in maxed2 for example (I’ll go into this in more detail later). Either method will work fine when exporting; it just comes down to personal preference and what you would like the object to do.


 

 

 

TEXTURING

 

a) Once your model is complete, its time to add some textures to it. If you’re familiar with 3dmax texturing then this step is fairly straightforward. If you’re unsure about texturing in 3dmax, refer to your help documentation.

 

Unlike characters, you can use a standard material type and simply add a .dds texture as you would any other texture. You can use multiple textures so don’t be afraid of adding more than 1 to an object.

 

IMPORTANT:-  Any textures that you use in 3dmax must be located in the maxpayne2dev textures directory (typically C:\MaxPayne2Dev\Textures\Indicators). If the textures aren’t located here you will receive a C++ error in maxed2 regarding the location of the textures when importing your trimesh. You can overcome this problem by manually editing the asi file and changing the texture location, but if you prepare everything correctly there is no need. 

 

b) Once the texturing has been completed its time to move onto the next step.

 

Fully modeled and textured crane model.
 

FINALISING THE MODEL AND ADDING MAXED PARAMETERS

 

a)At this stage you should have a nice clean and textured model ready to be exported. There are a couple of small steps required just to add certain maxed2 requirements to the model so it’ll import correctly.

b) Before the next step right-click on your model and select convert to an editable mesh. This will collapse the existing modifiers and leave you with the editable mesh. Select the editable mesh and proceed to the next step

c) The first step is to apply TRISOUP.

 

 

 

This will add the extra maxed2 parameters. With editable mesh selected in the modifier rollout, scroll down the parameters until you see the Maxed Trimesh section. Expand it if it isn’t already and your get these options. (See below)


 

 

Mesh type = you can define whether the trimesh will be either a static mesh or dynamic here.

Cast No Shadows = Pretty self-explanatory. If the mesh is static, during a GIS render the object won’t cast any shadows. If the mesh is dynamic, no shadows will be cast from dynamic point lights.

Do Not Render = The mesh is not rendered during GIS rendering.

Collisions

DO_BulletCollisions = Projectiles collide with the object.

DO_CharacterCollisions = Characters (player, enemy, npc) can interact with the object and becomes a solid mesh (as in they don’t move through it).

DO_BlockExplosions = In my experience this affects how explosions are affected by the object. For example if a Molotov cocktail is thrown at the mesh while this option is enabled, the resulting explosion will react with the object correctly including the pfx. If not enabled the explosion and pfx seems to go through the object and seems unaffected by it.

 

NOTE – These extra options can be added within maxed2, same with changing the mesh from a static mesh to a dynamic one.

 

d) From here you can now assign the textures to maxed2 categories. Open up the material editor and scroll all the way down. Here you will see this section (see Below).

 

 

 

e) Under ‘Database Material Category’ select the category you wish to have the textures assign too. For example if you have a metallic texture on your model, you’ll want to choose one of the metal categories, etc etc.

 

Ignore the alpha blending options as this won’t affect the look of the model in 3dmax and you can do this easily in maxed2 if needed.

 

f) Once you have done all of this there is 1 more vital step to make before you can export it. This is the scaling of the object. Regardless of the model, how it was made and what unit setup you’re using, the scaling seems to be hit and miss. The best way and easiest way is to import your level from maxed2 to 3dmax. This way you can easily scale the model to the size you need for your level.

 

To import you map into 3dmax you’ll need to do the following; (special thanks to Lunar Blue and Froz for the info)

 

1)      Save or move your lv2 file to your maxed2 directory (typically C:\MaxPayne2Dev\MaxEd2).

2)       Open up a command line prompt (dos prompt). For those that don’t know how to do this, click on startmenu>run and then typing cmd. Hit enter and the prompt will appear.

3)      From here you can export your level to .asc format that you can use to import into 3dmax. First, change the prompt so that is reads “C:\MaxPayne2Dev\MaxEd2” (without quotes). This is where the program ldbexport is located.

4)      Type in the following;

 

Ldbexport C:\MaxPayne2Dev\Game\data\database yourlevelname.lv2 yourlevelname.ldb –a

 

Once you have completed the above hit enter and the exporter will run through the motions and export the level to your \maxed2 directory in an asc format.

 

Please note :- The level must have the basic requirements to be exported (ie two rooms separated with an exit etc etc) otherwise the exporter will report the problems found.

5)      Once the level has been exported, open up 3dmax and click on the Utilities tab (hammer icon) from the top right hand side of the screen. Select ‘Maxscript’ from the list and click on the ‘run script’ button that appears. Select the script called ‘AscImport’ and click on open. In the drop down box labelled utilities, select the ASC Importer v0.21 from the list and a new set of options will appear underneath.

6)      Click on the .ASC Import button and select the asc file of your exported level and click open. Your level will now appear in a basic and untextured form.

 

From here you can place and scale your prefab to size according to the enviroment.

 

EXPORTING

 

Once all of the above steps are completed and you are happy with the size of your model, its time to export.

 

First apply the normal modifier to the model (apply it individually to separate parts if the model if made of multiple meshes). When the normal modifier is applied you will notice that the faces are flipped on the model.

 


Faces have been flipped using the normal modifier.
 

NOTE:- Sometimes what will happen is that when importing into maxed2 the faces will remain flipped, if that is the case, simply click on the ‘flip normals’ tick box which will correct this and export again.

 

FINAL STEPS

 

Now you are ready to export. Select the mesh/meshes in the viewpoint and click on the EXP ASI button. Give it a filename and hit save. Providing you’ve covered everything in the steps above, the model will be exported fine. After the file has been exported, you may receive warnings in a dialog box, regarding size, flipped faces etc etc. You can simply ignore this and click ok.

 

MAXED2

 

Open up your map in maxed2 and in ‘Build’ mode (F3), click the middle mouse button and select new entity. From the list select ‘triangle mesh’ and click ok. Click on your newly exported model and hit open. Your model will now appear in your level with the textures assigned to material groups if you defined them earlier on in the tutorial.


 

The end result.

 

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

A WORD ON DYNAMIC TRIMESHES

 

Dynamic trimeshes act the same as any dynamic maxed2 made object. One thing you should be aware of is only solid meshes should be made dynamic, no 2d planes, faces and broken geometry should ever be used as a dynamic trimesh. You will 99% of the time, encounter an error regarding flipped faces, object is convex etc etc. The reason for this is down to the physics and collisions.

 

As with any maxed2 made geometry, you can sometimes get around these problems by using the ‘Generate Bounding Box Hull’ and adding a collision mesh to the object. But the best bet is to always use solid meshes, or you will get problems of some sort.

 

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

 

Well that’s about it, I hope to see more use of trimeshes being used in future maps! 


Any problems or questions not covered here then please email me at Aztec@blueyonder.co.uk
 

Aztec.




©2006 Asharp

Make a free website at Freewebs.com