LoLJester Posted January 12, 2018 Share Posted January 12, 2018 Hello,I need help with this resource on GG's website: http://www.garagegames.com/community/resource/view/6538/ and the ported one on GitHub: https://github.com/Azaezel/Torque3D/tree/player_hitboxes_rev2Only problem that I have with this resource is that, although the hitbox is recognized on preload, the rayCast won't hit (during runtime) a shape exported to COLLADA that has a "-1" (or any) level of detail mesh attached to an animated bone.My hitbox is named HBa-1 and weighed to an animated head bone. I chose the "-1" level of detail so that the hitbox remains invisible during the game.I know about the stock hitbox feature that uses the shape's divided bounding box as hitboxes, but it is not useful for big enemies that have one or two small vulnerable spots.I use Unwrap3D to export to DAE or DTS. Quote Link to comment Share on other sites More sharing options...
Happenstance Posted January 15, 2018 Share Posted January 15, 2018 Does raycast return a hit if you don't use a detail level? Does the shape editor show all of the hitboxes when you inspect the model? Quote Link to comment Share on other sites More sharing options...
Duion Posted January 15, 2018 Share Posted January 15, 2018 Are you planning on open sourcing the implementation? I'm really interested in having it in the engine as well. Quote Link to comment Share on other sites More sharing options...
Azaezel Posted January 15, 2018 Share Posted January 15, 2018 Have you accounted for the castRayEA defintiion, https://github.com/Azaezel/Torque3D/blob/player_hitboxes_rev2/Engine/source/ts/tsCollision.cpp#L255 ? Animated bone attachments should work... half the reason I chose to leave that as a visible LOD and just set the things to transparent our end was so it was easy to change the material back and check that 'yeah, these things are indeed moving, and yeah, that hit did hit... Quote Link to comment Share on other sites More sharing options...
LoLJester Posted January 17, 2018 Author Share Posted January 17, 2018 @Happenstance: How do you mean? The function requires a detail level. Zero (0) for visible meshes and one (1) for the collision and hitbox meshes.@Azaezel: Yes I did that. The hitbox convex shape is there and gets animated... it is just not hit by the rayCast. If I detach the same hitbox shape from the bone, the rayCastEA hits.@Duion: To whom is that question directed to? Quote Link to comment Share on other sites More sharing options...
Azaezel Posted January 17, 2018 Share Posted January 17, 2018 Will do some more digging around our end. Quote Link to comment Share on other sites More sharing options...
Duion Posted January 18, 2018 Share Posted January 18, 2018 @Duion: To whom is that question directed to?You of course. Quote Link to comment Share on other sites More sharing options...
LoLJester Posted January 18, 2018 Author Share Posted January 18, 2018 It is already open sourced. See the links provided. This is not my resource. It's a resource I'm using from GarageGames website. Also, the second link is a port to T3D MIT. Quote Link to comment Share on other sites More sharing options...
Duion Posted January 19, 2018 Share Posted January 19, 2018 So does it work or not? Quote Link to comment Share on other sites More sharing options...
LoLJester Posted January 19, 2018 Author Share Posted January 19, 2018 That's what we're trying to figure out. It's not working for me. Quote Link to comment Share on other sites More sharing options...
Duion Posted January 19, 2018 Share Posted January 19, 2018 Question is, is it the C++ code that is not working or the scripts or the model formats.Isn't it working at all or isn't it working in the specific model format you want to have? You don't need the meshes to have -1 detail for not being visible, I think you can just make meshes without a material, then they will be invisible as well. Just as an example. Quote Link to comment Share on other sites More sharing options...
LoLJester Posted January 19, 2018 Author Share Posted January 19, 2018 The resource works; but, the castRayEA function in C++ only hits when the hitbox is not attached to a bone; it doesn't matter whether the hitbox is visible or not - I've tried them both. And this is for all meshes, not just for one or two. Quote Link to comment Share on other sites More sharing options...
Duion Posted January 19, 2018 Share Posted January 19, 2018 What do you mean with "attached to a bone" you mean probably being a child of a bone node.Can you provide your player model? So we can have a look.I assume you did it wrong since the way you normally do a player character and the way the default soldier is build, is that you have an armature and then below that your models including all LOD levels, so that each model ends up having an armature modifier that transforms the mesh according the the bone movement.So at no point there is any mesh attached to a bone, there are only bones attached to bones which then can have bones or nodes for mount points, eye points etc.Well its hard to explain, but just import the default soldier of the template and you will.I did not try it but I think the hitboxes are supposed to be like a LOD version, since it is an LOD version like a collision level, so you would make it as a LOD version and place it to the other LOD versions, so it will get affected by the same armature modifier as everything else. Quote Link to comment Share on other sites More sharing options...
Azaezel Posted January 19, 2018 Share Posted January 19, 2018 No @Duion. @LoLJester means attach to bones. Does look like there's a bit of oddness going on that I'll need to doublecheck with my head artist about as far as setup goes... (not exactly a modeling guru): Quote Link to comment Share on other sites More sharing options...
Azaezel Posted January 19, 2018 Share Posted January 19, 2018 Followup: Still not sure what's up with the blender setup, but yeah. did confirm the resource as-uploaded functions, though not in conjunction with a few other tweaks, like the lazer one, or the tinkering with per-material effects we're working on internally via castrayRendered... @LoLJester using anything like either of those, or it pretty much down to a setup migrane? Quote Link to comment Share on other sites More sharing options...
Duion Posted January 20, 2018 Share Posted January 20, 2018 @AzaezelWill this be merged into the main branch? With like a switch so people can choose if they want the new system or the old one, the current system could use an upgrade. This would help working with it, since it is always a hassel to maintain lots of different versions. Quote Link to comment Share on other sites More sharing options...
LoLJester Posted January 26, 2018 Author Share Posted January 26, 2018 @Azaezel: Sorry for the delayed response. What is your question exactly? I use Unwrap3D to setup my characters and not Blender. Quote Link to comment Share on other sites More sharing options...
Azaezel Posted January 27, 2018 Share Posted January 27, 2018 Apologies. for clarity, 3 potential issues sping to mind1) some additional alterations I've done this end can break it, like in the vid, left a note to myself to correct it not handling castrayRendered. You using anything similar? 2) In addition, that 1 to -1 does touch a few spots that I'll need to dig out of the original commit. might be one of those. 3) If neither one of those seems to be causing the issue, It could be the tool you're using to export to dae not understanding meshes mounted to bones but not applied to em. (I know for instance my head artist uses max. Can't import most of his rigs to directly check because blender wigs out on the armatures. Though pretty sure the blender export form me in that first vid with the screwed up hitboxes was strictly an issue between keyboard and chair there that I've yet to hunt down...) Quote Link to comment Share on other sites More sharing options...
LoLJester Posted January 29, 2018 Author Share Posted January 29, 2018 Ok. I'll see which, or if, any of those issues you point out are the culprits here. Quote Link to comment Share on other sites More sharing options...
LoLJester Posted January 31, 2018 Author Share Posted January 31, 2018 @Azaezel: Were you able to get some information from your artist on how he set-up that character? What software did he export the model from and in what format? Is there a specific set-up that the model has to have? I believe the problem stems from how the character is exported to T3D. By the way, I'm using T3D 1.2, but I don't think that should matter. Quote Link to comment Share on other sites More sharing options...
irei1as Posted February 2, 2018 Share Posted February 2, 2018 I think the problem comes from mixing collision and nodes (armature bone is a kind of node).See, when looking for a node transform you get the root value and not the position it should take from the current animation.I think that can be fixed using in the servermShapeInstance->animateNodeSubtrees(true)but I'm not really sure if that can be used in this resource. I'm still stuck with 3.8 so I can't help right now, sorry.Also, no idea what are the side effects... If anybody knows a detriment of its use I would be grateful to know, thanks.If you want to check if this is your issue, make a model being a single bone going up and down. Then attach the col-mesh to it and try the cast ray a)aiming to the visible position of the animated bone and b)aiming to where the bone is at the root.As an extra, this is the code I've for the node experiments. Feel free to use it if you find it useful (but, not sure if it's usable for the new versions).Inside source/T3D/shapeBase.h add before the end of the definition of class ShapeBase: public: MatrixF getNodeTransformN(const String &nodeName); MatrixF getNodeTransform(const S32 nodeIdx); Inside source/T3D/shapeBase.cpp just at the end: MatrixF ShapeBase::getNodeTransformN(const String &nodeName) { S32 nodeIdx = mShapeInstance->getShape()->findNode(nodeName); return getNodeTransform(nodeIdx); } MatrixF ShapeBase::getNodeTransform(const S32 nodeIdx) { MatrixF returnValue = MatrixF::Identity; if(nodeIdx != -1) { if (isServerObject() && mShapeInstance) mShapeInstance->animateNodeSubtrees(true); returnValue = mShapeInstance->mNodeTransforms[nodeIdx]; } MatrixF objectTransform = getTransform(); Point3F nodeObjPos = returnValue.getPosition(); nodeObjPos.convolve( getScale() ); returnValue.setPosition(nodeObjPos); returnValue.mulL(objectTransform); return returnValue; } DefineEngineMethod( ShapeBase, getNodeTransform, TransformF, (const char* nodeName),, "Get the transform of a named node in the shape.\n" "@param nodeName Name of the node to check.\n" "@return The current transform of the node.\n" ) { return TransformF(object->getNodeTransformN(nodeName)); } --------------------------------------------------------------------------------------------------------------------- In source\T3D\shapeImage.cpp look inside of void ShapeBase::getMountTransform( S32 index, const MatrixF &xfm, MatrixF *outMat ) for MatrixF mountTransform = mShapeInstance->mNodeTransforms[ni]; And add these lines before: if (isServerObject() && mShapeInstance) mShapeInstance->animateNodeSubtrees(true); Quote Link to comment Share on other sites More sharing options...
oXYnary Posted February 4, 2018 Share Posted February 4, 2018 @Azaezel: Were you able to get some information from your artist on how he set-up that character? What software did he export the model from and in what format? Is there a specific set-up that the model has to have? I believe the problem stems from how the character is exported to T3D. By the way, I'm using T3D 1.2, but I don't think that should matter. 3DS Max using the OpenCollada plugin.https://github.com/KhronosGroup/OpenCOLLADA Quote Link to comment Share on other sites More sharing options...
Atomic Walrus Posted February 22, 2018 Share Posted February 22, 2018 Hello,I need help with this resource on GG's website: http://www.garagegames.com/community/resource/view/6538/ and the ported one on GitHub: https://github.com/Azaezel/Torque3D/tree/player_hitboxes_rev2Only problem that I have with this resource is that, although the hitbox is recognized on preload, the rayCast won't hit (during runtime) a shape exported to COLLADA that has a "-1" (or any) level of detail mesh attached to an animated bone.My hitbox is named HBa-1 and weighed to an animated head bone. I chose the "-1" level of detail so that the hitbox remains invisible during the game.I know about the stock hitbox feature that uses the shape's divided bounding box as hitboxes, but it is not useful for big enemies that have one or two small vulnerable spots.I use Unwrap3D to export to DAE or DTS. Because of this line:mShapeInstance->castRayEA(start, end, info,0,mDataBlock->HBIndex)in player::castRay,the hitboxes must always be in the highest (first) detail level. Detail zero, as passed in the function above before the hitbox index.If you wanted to do something like define a specific detail size as the hitbox detail you would have to loop through the model's details, mShape->details (for (U32 i = 0; i < mShape->details.size(); i++)) testing mShape->details.size until you found the one you wanted to use, then send that detail level's index instead of zero. If you didn't want to run that loop on every raycast, you could search for and store the hitbox detail level index during preload.Alternatively, I used to just make the boxes invisible with a material. Quote Link to comment Share on other sites More sharing options...
LoLJester Posted February 22, 2018 Author Share Posted February 22, 2018 Thanks Atomic Walrus; but, if you read above, that was not the problem. The problem seems to come from how the model is exported. It is CRUCIAL that the DAE or DTS exporter of the modeling program you use is FULLY compatible with the version of T3D you're using. I'm using Unwrap3D to export most of my models, but it is not 100% compatible with T3D. Instead, I used Milkshape3D's DTS Exporter Plus to export the models with HitBoxes. It works quite well, but not perfectly. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.