Home Technical Talk

Help with advanced HL2 collision mesh

polycounter lvl 19
Offline / Send Message
TorQue[MoD] polycounter lvl 19
Hey guys!

So I'm trying to make a tower model for use in my mod and for some reason I can't get the collision mesh to work properly. Regardless of what I do I get the errors "Bad collision mesh, check your smoothing groups" and "Truncating model".

All of the meshes that I've used to create the collision mesh are sharing the same texture, with material id set to 1 and smoothing groups set to 1 as well. The only thing I can think of is that either the collision mesh is too detailed, or that deleting the unseen faces makes the collision mesh not work properly.

Does anyone know if collision meshes have to have all faces for each individual mesh? I deleted the unseen faces to ensure that the mesh would be as optimized as possible so maybe this is my problem?

Thanks in advance for any help.

Replies

  • Vailias
    Offline / Send Message
    Vailias polycounter lvl 18
    generally speaking collision meshes should be untextured, convex and must be made of closed solid pieces to be properly parsed. (not sure of HL2's specific features available for collision meshes) No holes in the mesh, no folds on itself.
    what would really really help

    is a PICTURE of the model (the collision model that is) that you are having trouble with. wireframe please.
  • Szark
    Offline / Send Message
    Szark polycounter lvl 12
    As Vailias said, you shouldn't have holes in the pieces of your collision model, you'll want every piece textured as well. If you're using Max each piece of the collision model has to have a seperate smoothing group assigned to it, so piece 1 will have SG 1, piece 2 will have SG 2, etc... If you're using Maya it does it a different way.. not sure how though. Also, the collision model can only have a maximum of 20 pieces in it or it will truncate into a single piece, you can make it have more by adding a command to the compiler.. not sure what it is though.

    Hope that helps smile.gif
  • Mark Dygert
    If you are using 3ds Max it helps to apply a "STL Check modifier" to your collision mesh it checks the mesh for errors like holes, double faces ect... Just make sure to collapse the history stack before skinning or exporting.
  • tremulant
    Offline / Send Message
    tremulant polycounter lvl 17
    triangulate it, and make sure that it is not Concave---ie make it convex as the others have said/
  • TorQue[MoD]
    Offline / Send Message
    TorQue[MoD] polycounter lvl 19
    Thanks for the help guys...
    Ok well I've made some progress of a sort. Actually, collision meshes for HL2 don't need to have a separate smoothing group for each piece, they can all share the same smoothing group. Caping the holes fixed the compile error, but now I'm getting a new one that says
    "WARNING: COSTLY COLLISION MODEL!!!! (63 parts)
    Truncating model!!!!"

    Is there any way to bypass this limit and does anyone know what the limit actually is for collision models?

    Otherwise if worse comes to worse I guess I could always make the mesh passable and just build the collision data in hammer, but I'd rather not have to do that.

    here's a pic of the collision mesh. (excuse the phalic look, its a temple tower)
    tower_collision.jpg

    The reason I need to have so many pieces is because I'm trying to make it so players can actually get inside the tower.
  • Mark Dygert
    Buried in the valve wiki, there is a command to enter into studiomdl so it builds without a limit. The other way to get around it is to break your model into easy to digest props. If you skin the pieces to one bone or keep the pivot point in the same place for all the bones they will align perfectly in Hammer. The best way I've found to place complex pieces like that, is to place the first, copy it and switch the mdl, wash rise repeat until you have all the pieces in.

    Also you could collapse those separate rock meshes into just two.
  • warby
    Offline / Send Message
    warby polycounter lvl 18
    C:\games\steam\SteamApps\your email address\sourcesdk\bin\studiomdl.exe -fullcollide

    that should do

    but your model collision looks way too complex anyway there is still plenty of room for optimization
  • TorQue[MoD]
    Offline / Send Message
    TorQue[MoD] polycounter lvl 19
    Thanks warby. I'll try that command and see if it works.
    Right now I'm just trying to get it to work, then I'll worry about optimization.
  • Mark Dygert
    ahh but see warby's point will make it much easier to get it working. meh, its your forehead and your keyboard to use/abuse as you please.
Sign In or Register to comment.