Classic Battlefield Modding Wikia
Advertisement

AImesh Error Checking

Based on a tutorial by Ballard44, edited and expanded by Dnamro

Tools:

  • 3ds Max 9 is used, which was the last version for which BF2 plugins are available.
  • 3dsmax scripts referenced are available at the

BFMeshView website: http://www.bytehazard.com/bfstuff

Level: Advanced - assumes basic skills with 3ds Max

This tutorial will explain how to check an AImesh for accuracy, which is the col3 mesh, before exporting. This will explain the checks that should be done to help validate that an AImesh is ready for exporting, however, these will no guarantee a working AImesh, but will help eliminate known issues. Creating AImeshes can be very frustrating because the mesh has to be pristine. Even going through all the 3ds max checks listed here. It is a matter of cleaning and testing until you get a working AImesh. Unfortunately, the COL3\AImesh is usually based on another collision mesh, which are not required to to follow the strict rules for AImesh development, so a lot of clean up work is normally required. A detailed explanation of the AImesh rules are explained in detail here:

Understanding the AImesh (COL3)

For this tutorial, a building from the Forgotten Hope mod is used.

  • Import the collision mesh of the problem static in Max using the colmeshimp.ms script from the website link listed above.

clipboard10b.jpg

Clipboard10b
  • Select the script when the window pops open

clipboard11rq.jpg

Clipboard11rq
  • Hit the 'Import' Button at the scale of 10.0

clipboard12cc.jpg

Clipboard12cc
  • Search for the collisionmesh file that you are

looking for to open it up Note: This will import all the collision meshes for the model into Max. More importantly, it will list if there was even a col3 already created for this static.

COL3 mesh exists but does not work

If there is an existing col3 that is not working it is probably a copy of one of the other collision meshes. If your lucky, it might just need a few adjustments.

COL3 mesh does not exist

If there was no col3, use a col2 mesh as the base for creating the col3. This can be time consuming, but necessary.  Just go to work making sure you follow all the rules of a viable col3.

Testing the COL3 in 3dsmax

Now that you have a col3\AImesh, it's time to test in Max to see if they pass.

clipboard31s.jpg

Clipboard31s

NOTE- In this case, the col3 was given a _nav extension for the name. This way it will export with that name. This is used when the col3 will be used temporarily just to create a navmesh and not added to the main model file to be added into the game. This is common practice since the AImesh is only needed to create the navmesh and not used in game. The new name helps to identify the model as having a completed AImesh. The static will need to be swapped out in the map, but just for navmeshing.

Weld Vertices

Start by welding vertices together. This is a good start to cleaning up the mesh. This happens during model development when the a new part of the model is created, but the attachment was not as clean as intended.

  • Switch to 'vertex' selection and select all your vertices
  • Under the 'Edit Vertices' box select the box to the right of the 'Weld' button This brings up the 'Weld Vertices' options box as shown

Make sure the threshold is set to 0.01...If you use anything higher it can weld vertices that you might not want welded creating issues

  • Click 'Apply' In this case they were already welded, but if they weren't the 'before' number would have been higher than the 'after'.

clipboard08g.jpg

Clipboard08g


Remove any unnecessary vertices

These will be vertices that are not attached to anything. The are usually left during the model development process when parts are deleted.

  • Select the 'Remove Isolated Vertices' box.
  • Select the 'Remove Unused Map Verts' box (directly below and not highlighted in the pic)

clipboard09gi.jpg

Clipboard09gi
  • Switch to the 'polygon' selection and select all the polys

Also, make sure they all use ID1 in the Polygon Properties screen  If they don't, select all the polys and set them to ID1 using the Set ID box clipboard01cu.jpg

Clipboard01cu


clipboard02fy.jpg

Clipboard02fy

STL Check

The STL Check modifier checks an object to see if it's correct for exporting to an STL (stereolithography) file format. Stereolithography files are used in 3d modeling to produce physical models, such as with a 3d printer In this case it is used to check that the model is 'manifold', which is a requirement for your COL3/AImesh. 

  • use the dropdown menu and scrolldown to select 'STL Check'

You first need to check the 'check' box as in the example. In this case it shows 'No Errors' as the 'Status' box confirms. .You can also check the different types of errors that your mesh could have. Recommend to check, 'Everything' as shown below:.

Stl check lg

clipboard03pq.jpg


Let's delete a face to show what happens when there is an error. So, rerunning STL Check now shows 3 errors.

clipboard05h.jpg

Clipboard05h

In this case it is pretty obvious where the error(s) are. Most of the time they are buried deep inside the mesh. You need to be able to see inside the mesh. If you switch to 'wireframe' view, this will highlight the problem area(s) in red.

clipboard06vf.jpg

Clipboard06vf

Note that every time you move the screen even slightly, the error(s) 'disappear'. This means that the errors will not be highlighted anymore. You just have to keep rechecking the 'Check' box.

Also, never correct the errors with the STL Check 'on'. Note where the error is and delete the STL Check. Leaving STL Check modier enabled while editing can cause issues in the STL Check working correctly.

So, after making the corrections that are needed, and then redo the STL Check process. Repeat the process until there are no more STL errors.

Meshcheck Script

Now it's time to use the meshcheck.ms script. We will use a different mesh that will show up with errors.

What you are looking for with this script are faces that are have become edges. Typically this happens when faces that have become so 'broken up' in the creation/editing process that now all that's left are edges. These open edges can keep vertices from welding together and/or faces from being created properly and need to be deleted.

Before using this script convert static to 'Editable Mesh' This makes it is easier to correct problems that might arise in this 'mode'

clipboard24h.jpg

Clipboard24h

Find it the same place where you opened the colmeshimp.ms script Open it up and hit 'Check'...You can use the 0.1 Threshold for starters Hopefully you will get this screen that says you have no errors

clipboard30q.jpg

Clipboard30q

If this is the case, you can convert your static back to 'Editable Poly'.

But what happens if it does find errors? First, checking it at 0.1 tends to be too much and might give you 'false negatives' This tends to happen if you have some very long and skinny faces. The faces are actually fine (within the col3 parameters), but they still fall under 0.1 This is where you need to use your gut and look at to see if checker is 'wrong'. If they look right, than disregard the error.

In this case it found errors at 0.02 You can always tell when there are errors because it does not give you the no errors messages

clipboard26r.jpg

Clipboard26r

So, now switch to 'wireframe' view and use 'Face' selection This script will automatically highlight the faces in question...

clipboard27a.jpg

Clipboard27a

Since the script had already selected the bad faces and I've decided that these don't look correct, I can just delete them.

Once deleted you can also see what other problem they created. When I select the face (#122) that was attached to it, you can see that that single face should have been 2 faces On the shortest side of the highlighted face (triangle) there is a 'doorway' that should have been factored in.

clipboard28u.jpg

Clipboard28u

The meshcheck.ms script has found errors and you deleted them. Convert your static back to 'Editable Poly'. Guess what? You're not done!!!

Now that you've found and deleted the errors you have to...

4) Go back and start at 3a again!

You need to do this because deleting errors with the meshcheck script will usually cause other errors. I don't have a screenshot, but I originally checked this other static with STL Check and it had no errors. But when I go back, look what was found...

clipboard29o.jpg

Clipboard29o

Not surprising as I knew that the one face (#122) needed to be 2 faces.

Anyways, you go back and forth solving any and all problems that can arise. Sometimes welding and/or deleting erroneous vertices will be all that's needed. Sometimes deleting a face and recreating it making sure to attach each edge to a vertex is the problem solver. Sometimes there are extra faces that needed to be deleted and were forgotten about.

It just takes practice to solve these!!!!

EDIT - also realize that sometimes you need to run meshcheck before you can correct the mistakes found in STL Check. I've had statics that had errors found with STL Check, but no matter what i did, I couldn't fix them. I had to run meshcheck and delete those errors and that allowed me to fix the errors in STL Check.

Before we do that, there is small step I want to add that can stop headaches in the end. 5) You need to make sure the pivot of this base mesh is at 0, 0, 0 Hit the 'Hierarchy' button - It's the 4th one from the left of the hammer icon that is nearest the top right of the screenshots Once in, select the 'Affect Pivot Button' and 'Select and Move' button


If they aren't, make sure the the X, Y and Z coordinates at the bottom are all 0.0

clipboard23s.jpg

Clipboard23s

When you goto 'select all' and then 'replace all' in the BF2 Editor, if the coordinates are not 0, your replacement statics can be off center of the original static its replacing...That's not what we want!

7) Making sure the base mesh is clean for the cols I'm going to use this base mesh for all my cols. If there are errors in the base mesh, when I clone it to make a col0, those errors will transfer. When I clone my col0 to make my col1, those errors will transfer. And so on and so on. Taking these errors down the line can make the static not work when it navmeshes and/or make it impossible to export the static itself.

So, we have already fixed the base mesh to ensure that it works when navmeshing. 7a) Next, we need to make sure there is no more than 1 'channel' being used on the base mesh Select the 'Tools' dropdown menu and go down and click on 'Channel Info'

clipboard33e.jpg

Clipboard33e

What you should see is below...Just 1 channel being used

clipboard34.jpg

Clipboard34

If there are more than one channel, delete them...I'll show you how to do this ***below***

***Here is where I will show you how to delete any extra 'channels' that might have been created*** NOTE - a col can have 1 channel, but having none works just as well. YOU JUST DON"T WANT MORE THAN ONE!!! or the static won't export

Like before, select the 'Tools' dropdown menu and go down and click on 'Channel Info'.

clipboard17o.jpg

Clipboard17o

The info will be identical to the info we saw with the base mesh. Which makes sense since this col0 is its clone. Highlight the line in the pic below by clicking on it

clipboard19k.jpg

Clipboard19k

Once selected, hit the 'Clear' button that is directly above the ID column The row will be deleted and a 'UV Mapping Clear' function will appear to the right Right click on it and select 'Collapse All'

clipboard18n.jpg

Clipboard18n

Your col0 now has the correct material and no extra channels.



Now on to the next steps....

Advertisement