Marcousik Posted February 22, 2021 Share Posted February 22, 2021 Quote When I run the ragdoll with SetParen, assigning as parent of the bone the rigid body. The ragdoll looks decent. The thing is that when I finish the ragdoll, I can't use animations like standing up. The skeleton is already related to the rigid body. Ok. Did you try to unparent with SetParent(nil) ? Quote Link to comment Share on other sites More sharing options...
Yue Posted February 22, 2021 Author Share Posted February 22, 2021 7 hours ago, Marcousik said: Ok. Did you try to unparent with SetParent(nil) ? Yes, I have tried to use SetParent, nil, but it happens that the skeleton seems to be unhooked from the mesh, and from the character controller. The most viable would be to use SetPosition and GetPosition, but in what I have tried it is impossible. Quote Link to comment Share on other sites More sharing options...
Yue Posted February 22, 2021 Author Share Posted February 22, 2021 Looking at the hierarchy of the bones, when we use SetParent(nil), what happens is that those bones are orphaned. In the hierarchy some of them are related and that is what breaks the skeleton. For that reason the most viable is to use SetPosition, GetRotation, but for some reason the update is imperfect, and you have death cramps which is not natural for the ragdoll effect. More likely for a horror scene, yes. Translated with www.DeepL.com/Translator (free version) Quote Link to comment Share on other sites More sharing options...
Yue Posted February 22, 2021 Author Share Posted February 22, 2021 Another drawback I have is that the joints rotate around the global coordinates, so no matter how much care I put into setting up the joints, the character in one direction executes the joints correctly, but if it is facing the other way, we have problems with one leg rotating in the opposite direction than normal. Perfect. Error. Quote Link to comment Share on other sites More sharing options...
Josh Posted February 23, 2021 Share Posted February 23, 2021 I suggest uploading an example. There’s always a way to do things. 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Yue Posted February 23, 2021 Author Share Posted February 23, 2021 Mars.rar @Josh R key to activate Ragdoll, E key to reset the character, rotate the character with the mouse. Exposed Scripts directory to see its content. 1 Quote Link to comment Share on other sites More sharing options...
Josh Posted February 25, 2021 Share Posted February 25, 2021 Calling SetParent on bones in an animated model seems like a very bad idea to me...still looking at this... Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Josh Posted February 25, 2021 Share Posted February 25, 2021 On 2/21/2021 at 6:32 AM, Dark Yue said: The war with the ragdoll goes as follows: it is impossible to restore an animation when the character is hit by a vehicle and gets back on its feet. This is because the commands SetPosition, GetRotation in LE 4.6 produce a death shudder, like a déjà vu in the best style of the matrix, I do not know if to say that it convulses, or is possessed. For that reason it is better to use SetParent, this implies not being able to make the restoration in the best style of GTA V. This cannot be done. https://thumbs.gfycat.com/FlickeringOrderlyAplomadofalcon-size_restricted.gif https://thumbs.gfycat.com/HeartyMistyIberianmole-max-1mb.gif Then, the ragdoll, it will only be possible to unleash the death of the character. And you can reset the character without problems, to return it to a checkpoint to continue the game. Is this video meent to demonstrate a problem? It looks quite stable to me. Why would you not just create a new model when the player is reset? Why bother trying to restore it when you can just create another one and delete the old one? I think it is probably best to first create a ragdoll with visible boxes for testing, rather than trying to show the animated model use the physics before the physics are finished. Right now it is confusing because you are still trying to test the physics and make a skinned model match the physics model. Those are two separate problems that are being mixed together, which makes it hard to solve. 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Josh Posted February 25, 2021 Share Posted February 25, 2021 While physics are still in development, I would expect to see this: The animated model moves around. When the ragdoll is activated, the animated model is hidden or deleted, and a ragdoll made out of boxes is visible. When the player is reset, the ragdoll is deleted and a new copy of the model is loaded / created. 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Yue Posted February 25, 2021 Author Share Posted February 25, 2021 When you execute the ragdoll with the initial orientation it is executed correctly, its joints work correctly, the knee bends at the correct angle, but if you change the orientation of the model, to the right for example, the leg bends in the opposite position, because the joints have global rotations. Quote Link to comment Share on other sites More sharing options...
Yue Posted February 25, 2021 Author Share Posted February 25, 2021 Quote Link to comment Share on other sites More sharing options...
Josh Posted February 25, 2021 Share Posted February 25, 2021 41 minutes ago, Dark Yue said: When you execute the ragdoll with the initial orientation it is executed correctly, its joints work correctly, the knee bends at the correct angle, but if you change the orientation of the model, to the right for example, the leg bends in the opposite position, because the joints have global rotations. Right, but when we try to improve this it is confusing to have multiple layers of stuff to deal with. I think we need to separate the visible mesh and the physics ragdoll next so we can debug it more easily. When I try to change your code it behaves in unpredictable ways and I can't tell what is happening. 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Yue Posted February 25, 2021 Author Share Posted February 25, 2021 The first video refers to when I use SetParent, this second one I am using SetPosition and SetRotation, because that would provide the possibility to run an animation after the ragdoll effect, but it does not work correctly. Regarding what you mention, I think I could make a simple example of a hinge joint doing the ragdoll effect on a worm. I think me without knowing that possibly the joints are missing a rotation value if it is global or local. And the position and rotation updates I have no idea. Translated with www.DeepL.com/Translator (free version) I will make a simple example of a union. Quote Link to comment Share on other sites More sharing options...
Josh Posted February 25, 2021 Share Posted February 25, 2021 I will spend some more time on it tomorrow and see what I find. For some reason, if I move the SetRotation() / SetPosition() calls after the joint creation, the program crashes. That is the way I would expect to implement this, because you want to create the joints in the starting orientation to get the right angles. 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Josh Posted February 26, 2021 Share Posted February 26, 2021 Making progress. I am going to run it from the Leadwerks source code next and see if we can make the positioning work after the joints are created... 2 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Yue Posted February 27, 2021 Author Share Posted February 27, 2021 @Josh Thank you for your interest in this, I appreciate it very much. I've been looking at the standing animations depending on whether it lands on its back or with its chest against the ground. Quote Link to comment Share on other sites More sharing options...
Yue Posted March 1, 2021 Author Share Posted March 1, 2021 @Josh Any progress? Quote Link to comment Share on other sites More sharing options...
Josh Posted March 2, 2021 Share Posted March 2, 2021 Yes, but at the moment I have a weird Steam error preventing me from running the program...stay tuned... 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Yue Posted March 2, 2021 Author Share Posted March 2, 2021 Quote Link to comment Share on other sites More sharing options...
Josh Posted March 3, 2021 Share Posted March 3, 2021 The decision to use Vulkan means I have to spend today working on some weird obscure error messages instead of helping you. That's just part of the deal when people said I had to use Vulkan. 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Josh Posted March 3, 2021 Share Posted March 3, 2021 Okay, sorry, I have got a handle on it now. That was pretty difficult. So maybe I can continue on this tomorrow. 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Josh Posted March 5, 2021 Share Posted March 5, 2021 I am now able to examine your project in the debugger and there is some kind of floating point error occurring. I am checking with Julio about this. BTW, it is possible to report bugs directly to the developer of Newton since the physics library is an external DLL that can be debugged or replaced. 2 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Josh Posted March 5, 2021 Share Posted March 5, 2021 I am updating the engine to the latest version of Newton first... 2 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Yue Posted March 5, 2021 Author Share Posted March 5, 2021 23 minutes ago, Josh said: I am updating the engine to the latest version of Newton first... You give me a lot of encouragement, it's been a nice long road with Leadwerks, since the Blitz community disappeared, then I'm getting closer and closer to create a video game. And this ragdoll effect is very nice to implement the character death and standing up after the ragdoll effect. And my daughter is happy and gives me a lot of encouragement to make her video game where the character is her. Translated with www.DeepL.com/Translator (free version) Quote Link to comment Share on other sites More sharing options...
Josh Posted March 6, 2021 Share Posted March 6, 2021 Okay, now I have Newton updated and I am trying the application... 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without. 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.
Note: Your post will require moderator approval before it will be visible.