Archangel35757 Posted March 12, 2017 Share Posted March 12, 2017 So has there been upgrading of the code for Bounding Boxes (used for collision detection)? If I recall, JK uses the Axis-Aligned Bounding Box (AABB)... on the simple side ...but not the most optimal sloution. Link to comment
Tempust85 Posted March 12, 2017 Share Posted March 12, 2017 I will be adding my bounding box fix that allows you to set the length and width seperately, I just have to remember what I did and to what part of the code. The reason I originally did it was due to oddly shaped npcs like dragons having crap bounding boxes. While my fix might have issues with MP, in SP it should be fine. Link to comment
minilogoguy18 Posted March 12, 2017 Share Posted March 12, 2017 Couldn't we just set the lowest LOD as the models collision like it already does with weapon detection? Link to comment
Archangel35757 Posted March 12, 2017 Author Share Posted March 12, 2017 @@DT85 - Oriented Bounding Box (OBB) would be better, yes? There is code online for it. @@Xycaleth - how difficult would it be to replace AABB with OBB (or something better-- i.e., Convex Hull)? Is the class and code for it modularized? Link to comment
Xycaleth Posted March 12, 2017 Share Posted March 12, 2017 There are no classes for it. Pretty much all the code assumes AABBs are used so it's not going to be an easy replacement. Btw, in terms of anything being modularised in jka, answer is always "it's not modularised" unless you're asking about large systems like rendering, or server code etc. Link to comment
Archangel35757 Posted March 12, 2017 Author Share Posted March 12, 2017 @@Xycaleth- But if the game code is always calling the same function or method to compute the bounding box, or get the bounding box from a method, or check against a supplied bounding box, then maybe it could be replaced without too much pain, no? I've not honestly looked at the code... Link to comment
Xycaleth Posted March 12, 2017 Share Posted March 12, 2017 There's no central place that bounding boxes are fetched from. There's a single set of functions that do the collision detection but you still need to find all the places where the bounding boxes are stored and manipulated. Link to comment
Tempust85 Posted March 12, 2017 Share Posted March 12, 2017 Couldn't we just set the lowest LOD as the models collision like it already does with weapon detection? Could, but I have NFI how lol. Link to comment
Ramikad Posted March 13, 2017 Share Posted March 13, 2017 I read something about collisions in Rust (old devblog, but still might offer some insight on how things could work): We’re not using hitboxes anymore. For those that don’t know what hitboxes are.. they’re this.See those boxes? Well when you shoot a character in TF2, it traces a line forward from your eyes until it hits something. Characters in TF2 are made up of thousands of triangles, so it would be stupidly slow to test against all of those. So they stick some boxes where the head is, where the arms and legs are, where the torso is, and test against those instead. And this works great.But it’s 2014 and putting hitboxes on stuff is hard work. So we’re using a skinned mesh collider. So check this naked guy out.We already have a really low poly version of the player character thanks to LOD’ing.So we can use that for collision!It’s a skinned mesh, so each vertex is weighted to up to 4 bones. When the mesh is ‘shot’, we use the triangle ID to get the vertices, then we use the vertices to find the bone. The bones have multiple attributes. For example, the head and neck bones have multipliers, so that headshots to more damage (this is indicated by the red spheres in this picture).This gives us a lot of benefits moving forward beyond just being more accurate to the render mesh. For example, if we were to add a helmet on the player we could make it so that getting shot in the face still killed them. This is something that’s not impossible with hitboxes, but it would be kind of clumsy. Link to comment
Tempust85 Posted March 13, 2017 Share Posted March 13, 2017 Still need someone who wants to and can code this. Link to comment
minilogoguy18 Posted March 14, 2017 Share Posted March 14, 2017 I tried to do some googling but my terminology probably wasn't right. I was trying to find if there was an open source modular option to do this. Sort of like how we've added in a different render engine, same would go for collision/physics. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now