Jump to content
The Dark Mod Forums

A Question On Collision Boxes


SneaksieDave

Recommended Posts

I wasn't sure if this should be in modelling or programming, but modelling seemed closer. Taken from the 'Weather Effects' thread, with regard to the rain.map.

 

Right, the same happens to me, reproducably. Collision box problem with the red book I think. I'm not going to derail this thread, but making this scene showed me we have quite a few origin and box problems with some items.

 

Btw for those clipping box problems, you know you can type "g_showcollisionmodels 1" in the console and see them, right?

 

First concern: Wow, should our collision models be *that* complex? They're pretty much accurate to the poly, it looks like. Isn't that very expensive? By contrast, AI show rather simplistic models. Why does a func_static endtable need a 300 poly model, when the AI don't even have that? See the first image. Why would a cup need that much collision detail? It only needs a rect around it.

 

Second concern: Anyway, I don't see anything wrong with the book, so I don't know why the problem, and I'm probably using the wrong word anyway. The origins are not aligned with the grid in many cases - that's what I mean. A book will hover 1cm above the table, because it can't be set *on* the table, in other words (in part due to the D3Ed grid size less than 1 acts wacky bug). Many things, like books, vases, tables, etc., don't share common-grid surfaces. So placing them in contact with each other doesn't work too well. See second image. Two books on a table (rain.map), grid size set to 1, and all three objects are floating in the air.

post-58-1151588301_thumb.jpg

post-58-1151588578_thumb.jpg

Link to comment
Share on other sites

Wow, should our collision models be *that* complex? They're pretty much accurate to the poly, it looks like. Isn't that very expensive? By contrast, AI show rather simplistic models.

 

I suspect it's because collision models haven't been made for most of our models, and when D3 has to make one on the fly it just uses the original mesh. Eventually we will have to make simplified collision models, but I think that's primarily an optimization issue (though I could be wrong).

 

 

placing them in contact with each other doesn't work too well.

 

I've noticed that problem too. But how would that cause the player to get stuck? And shouldn't the objects 'fall' down onto the table at map start-up?

Link to comment
Share on other sites

I never really understood collision models, in my view you should just be able to create a model in your 3D app along with the actual mesh, and use it as the collision model - however when I made a mover I had to muck around with drawing brushes and exporting or something like that before the mover would respond properly.

Link to comment
Share on other sites

But how would that cause the player to get stuck? And shouldn't the objects 'fall' down onto the table at map start-up?

 

It's not so much that that's the cause of the player getting stuck (though it could be); just that it looks bad when everything's floating around.

 

They won't fall unless they're moveable with physics.

Link to comment
Share on other sites

I think our first priority for collision models (CMs) should be moveables. Moveables require a .cm in the model, and there is some limit like 16 faces. You might also be able to set it up as a box with the "mins" and "maxs" keywords in the entity def. We need this for a lot of reasons, mainly so we can start testing more custom moveables, assigning mass and density to them, etc. We have all these models for them, but no CMs, so they don't actually work as moveables. Once that is done and more things are made into moveables, we should see less "hovering" problems because they'll fall down to be flush with the surface.

 

@OrbWeaver: Yeah it is pretty confusing, different entity classes handle CMs differently. For some of them it's as simple as setting "mins" and "maxs" in the editor to generate a box, for others I guess you have to export and stuff.

 

Springheel is right that statics use the model as the collision model by default. It seems to perform okay, possibly because you're never moving the static, just seeing if other things collide with it, whereas with a moveable, you're checking to see both if it collides with anything and if anything collides with it.

 

You can put in a simplified CM for a static, just add it directly into the same model file, and texture it with common/collision (or it might be common/clip, I forget which). It seems to run okay as-is, although BT reported getting some performance increase, especially when AI were navigating around it, when adding in simplified ones. You can also put in a simplified clip box for AI (common/monsterclip or something), but not for physics, so the AI will see the chair cm as a box and not eat up CPU time navigating it, but physics will still collide exactly.

Link to comment
Share on other sites

The monster clip is especially important, this should be used everywhere it can. Basically anywhere a monster cannot go can be sectioned off by adding a brush textured with the appropriate clip texture to remove the geometry from the AAS.

 

This includes, for example, putting a clip "wall" over a mesh or patch fence which the AI cannot get past.

Link to comment
Share on other sites

The monster clip is especially important, this should be used everywhere it can. Basically anywhere a monster cannot go can be sectioned off by adding a brush textured with the appropriate clip texture to remove the geometry from the AAS.

 

This includes, for example, putting a clip "wall" over a mesh or patch fence which the AI cannot get past.

 

I agree. If I recall correctly, BlackThief has tried this and reported noticable performance increase in maps with AI when doing this.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recent Status Updates

    • The Black Arrow

      Hey @nbohr1morehow come the zombies in The Dark Mod don't have a "resurrection" mechanic to it, similar to how Thief has it?
      They're quite a weak creature as of right now, it's merely a walking corpse that slashes you, making attacking them to kill them an actual strategy.
      Would be better if they had some cool mechanism to it that truly makes them a danger, such as the resurrection idea itself.
      · 3 replies
    • Ansome

      Query: when was the last time a zombie in a video game was unnerving or scary to you? I'm chipping away at my anniversary submission and I've been trying to gather opinions on the subject. I'm perfectly capable of lighting them well, changing their sfx, and creating effective ambience, but I'm worried that zombies at their core are just too overdone to be an effective payoff to the tension I'm creating.
      · 4 replies
    • nbohr1more

      The Lieutenant 3 is out! Congrats Frost_Salamander! ( raising awareness )
      · 2 replies
    • OrbWeaver

      Has anyone had any luck with textures from Polyhaven? Their OpenEXR normal maps seem too washed out and give incorrect shading in the engine.
      · 5 replies
    • datiswous

      I tried to upscale the TDM logo video. First try:

      briefing_video.mp4 You can test it ingame by making a copy of the core tdm_gui.mtr and place it in your-tdm-root/materials/ , then edit line 249 of that file into the location where you placed the new briefing.mp4 file.
      What I did was I extracted all the image files, then used Upscayl to upscale the images using General photo (Real-Esrgan) upscale setting and then turn it back into a video.
      I might have to crop it a bit, the logo looks smaller on screen (or maybe it's actually better this way?). My video editor turned it into a 16:9 video, which I think overal looks better than 1:1 video of original.
      · 1 reply
×
×
  • Create New...