1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

summoning/spawning a ragdoll.

Discussion in 'Programming' started by Fraz, Jun 29, 2004.

  1. Fraz

    Fraz New Member

    Joined:
    Mar 15, 2003
    Messages:
    8
    Likes Received:
    0
    Is there a way to spawn a ragdoll that will stay there permenantly? One of the ones that your character switches to when you die. Or is there any mutators out there that allow the ragdoll to stay put when someone dies? Thanx!
     
  2. Volt9000

    Volt9000 New Member

    Joined:
    Aug 28, 2002
    Messages:
    43
    Likes Received:
    0
    I could be mistaken, but I think you would have to subclass the code that tells the ragdoll to "evaporate" after a while, and just keep it there permanently.
     
  3. BinarySystem

    BinarySystem Banned

    Joined:
    Jun 10, 2004
    Messages:
    705
    Likes Received:
    0
    It's quite possible. Try placing an actor subclass of some type, give it DrawType of DT_Mesh, Physics PHYS_KarmaRagdoll, and the appropriate Mesh. You will also need to give it an appropriate KParams.
     
  4. Fraz

    Fraz New Member

    Joined:
    Mar 15, 2003
    Messages:
    8
    Likes Received:
    0
    Yeah, i know how to do it this way. But what i want to do it to be able to spawn/summon an default ragdoll that appears when you die. Cos these have sound effects, and the default params seem to work much better for what i am wanting to do.
     
  5. [SAS]Solid Snake

    [SAS]Solid Snake New Member

    Joined:
    Jun 7, 2002
    Messages:
    2,633
    Likes Received:
    0
    It is possible. But I don't recommend it. There is a reason why they dissapear and that is because each ragdoll takes a certain amount of resources and there is also a hardware limit on the number of ragdolls. In any case, subclass the xPawn and find the code which does the derez ...
     
  6. BinarySystem

    BinarySystem Banned

    Joined:
    Jun 10, 2004
    Messages:
    705
    Likes Received:
    0
    Actually the limit on the number of Ragdolls is somewhat optional. Creating them does not actually check to see if there are too many. There is a function that you can call that returns a boolean elling you if you have "too many," so you can "enforce" the limit within Unrealscript if you so desire. The xPawn code, for instance, checks this function. I've tried making ragdolls without checking that function and have had dozens of ragdolls without any problems. But you are right, having a ton of ragdolls everywhere does impact performance.
     
  7. Max_Damage_uk

    Max_Damage_uk New Member

    Joined:
    May 20, 2002
    Messages:
    75
    Likes Received:
    0
    :rolleyes:

    Yes, I made a quick mutator to have 24 ragdolls lying around. The maxragdolls in levelinfo of a map is set to 4.
    Could'nt get it to work well in net play though. :mad:
     
  8. [SAS]Solid Snake

    [SAS]Solid Snake New Member

    Joined:
    Jun 7, 2002
    Messages:
    2,633
    Likes Received:
    0
    Ragdolls are client only. The server does not care at all about ragdolls, thus ragdolls can even look different on clients since they do not impact the game at all.
     
  9. Fraz

    Fraz New Member

    Joined:
    Mar 15, 2003
    Messages:
    8
    Likes Received:
    0
    Do u have it uploaded anywhere? Id like to give it a try. Thanx!
     
  10. dataangel

    dataangel New Member

    Joined:
    Apr 11, 2004
    Messages:
    184
    Likes Received:
    0
    It is theoretically possible to change this though, is it not? I'm just guessing, but bTearOff is probably set to true for you when you die, then the client takes over simulating the ragdoll. Commenting out the line that does this would do the trick I think.
     
  11. BinarySystem

    BinarySystem Banned

    Joined:
    Jun 10, 2004
    Messages:
    705
    Likes Received:
    0
    You can't really replicate ragdoll movement. The reason is simply that there's a lot of information to pass (location, rotation, velocity, and "angular velocity" for every part of the ragdoll) and it's somewhat impractical to update that much information. It would be theroretically possible to simulate the ragdoll server-side, "harvest" information about it's position and stuff, and send it to the clients. However, because of the large bandwidth required for this it would probrably be somewhat choppy on the client-side.
     
  12. Bonehed316

    Bonehed316 New Member

    Joined:
    Oct 15, 2001
    Messages:
    208
    Likes Received:
    0
    it would be best to replicate the ragdolls via native code. doing so in uscript would be hacky and nasty, and otherwise unwanted.
     
  13. BinarySystem

    BinarySystem Banned

    Joined:
    Jun 10, 2004
    Messages:
    705
    Likes Received:
    0
    Well, the CPU hit of doing it in UScript would be no problem. Karma objects like vehicles are replicated through UScript. The issue is you simply have too much data to cram down the network with a reasonable number of updates per second.
     
  14. dataangel

    dataangel New Member

    Joined:
    Apr 11, 2004
    Messages:
    184
    Likes Received:
    0
    Couldn't you only replicate any forces that affect the ragdoll, and let the client simulate from there? So if a grenade goes off, the server would just send the position of where the ragdoll was, where the grenade exploded, and the magnitude of the force created. That seems like a pretty minimum amount of info.
     
  15. BinarySystem

    BinarySystem Banned

    Joined:
    Jun 10, 2004
    Messages:
    705
    Likes Received:
    0
    Yes, but due to latency, the ragdoll will not be simulated the same. For instance, if there's 200 ms latency, the ragdoll may have fallen down stairs for that 200 ms and thus been in a different position on the client when the client recieves the info about the grenade than the position it was in when the grenade event happened on the server.

    Depending on what you want the ragdolls for, you might not have to replicate them at all. If they're non-colliding and just for show, maybe replication wouldn't be an issue.
     
  16. dataangel

    dataangel New Member

    Joined:
    Apr 11, 2004
    Messages:
    184
    Likes Received:
    0
    That's how it works now and I don't think replication is an issue for normal ut2k4.

    Hmm... does the engine know how long it's been since the server sent it info? Because then you could use your ping to account for the latency difference. i.e. the servers says a force was applied when the ragdoll was here, the latency is X, simulate what the ragdoll went through in X and then start normal simulation again. I suppose that could still be stuttery though.
     
  17. dataangel

    dataangel New Member

    Joined:
    Apr 11, 2004
    Messages:
    184
    Likes Received:
    0
    I thought about this some mroe and I think the best way to replicate a ragdoll would be to spawn an invisible actor at the center of the ragdoll, and attach the ragdoll to it. The intricacies of the ragdoll movement would still be up to each client, but anyone hitting the invisible box actor would collide and thus appear to collide with the ragdoll.
     
  18. poorsod

    poorsod Londoner

    Joined:
    Jul 16, 2004
    Messages:
    2
    Likes Received:
    0
    The only way of spawning a ragdoll in a network game would be to recreate the ragdoll without using ragdoll physics, which is impossible to do without redevelpoing Karma itself, which would be quite hard.

    It's just too complicated, there are so many factors governing the ragdoll and to recreate it would take up all the system's resources and everyone's computer would have to restart...
     
  19. Max_Damage_uk

    Max_Damage_uk New Member

    Joined:
    May 20, 2002
    Messages:
    75
    Likes Received:
    0
    ;)
    Yes, i think this will be possible in a few years but atm it could destabilize the world economy, and have serious implications on the temperature and spin speed of my washing machine.

    :eek:
     
  20. dataangel

    dataangel New Member

    Joined:
    Apr 11, 2004
    Messages:
    184
    Likes Received:
    0
    I still think the box idea would work fine, since I imagine any impact a ragdoll would have on gameplay would happen from it colliding with something. All it involves is replication of the center of the doll, which shouldn't be any more complicated than replicating the center of a pawn when hit by a rocket.
     

Share This Page