Possible to adjust ragdoll decay timer?

aeroripperaeroripper Join Date: 2005-02-25 Member: 42471NS1 Playtester, Forum Moderators, Constellation
When you kill say, an onos, his ragdoll (and any other alien for that matter) will disappear after a few seconds. Is there a lua file, or better yet, a console command I can use to adjust this time? Was going to play around with 30 seconds just for giggles.

Comments

  • TharosTharos Join Date: 2012-12-18 Member: 175439Members
    No console command but kRagdollDuration = 6 in Natural Selection 2\ns2\lua\Ragdoll.lua

  • PaLaGiPaLaGi Join Date: 2008-01-03 Member: 63331Members, Constellation
    This is one of my many annoyances with NS2. Would be great if you could limit the immersion like you can with the decal limit.
  • aeroripperaeroripper Join Date: 2005-02-25 Member: 42471NS1 Playtester, Forum Moderators, Constellation
    Apologies for ressurecting this thread, but I started messing with this again. Same question remains, and I've tried editing kRagdollDuration = 60 as Tharos suggested in that file to no effect when testing in the game. I've also altered the same variable in RagdollMixin.lua as well to no effect.

    Not sure why it isn't working.
  • BeigeAlertBeigeAlert Texas Join Date: 2013-08-08 Member: 186657Members, Super Administrators, Forum Admins, NS2 Developer, NS2 Playtester, Squad Five Blue, Squad Five Silver, NS2 Map Tester, Reinforced - Diamond, Reinforced - Shadow, Subnautica Playtester, Pistachionauts
    aeroripper wrote: »
    Apologies for ressurecting this thread, but I started messing with this again. Same question remains, and I've tried editing kRagdollDuration = 60 as Tharos suggested in that file to no effect when testing in the game. I've also altered the same variable in RagdollMixin.lua as well to no effect.

    Not sure why it isn't working.

    Keep at it! I want this sooo badly. It'll go great with hour-long decals. :)
  • MendaspMendasp I touch maps in inappropriate places Valencia, Spain Join Date: 2002-07-05 Member: 884Members, NS1 Playtester, Contributor, Constellation, NS2 Playtester, Squad Five Gold, NS2 Map Tester, Reinforced - Shadow, WC 2013 - Shadow, Retired Community Developer
    I haven't checked, but have you tried changing the dissolve delay too in DissolveMixin:OnKillClient()?
  • aeroripperaeroripper Join Date: 2005-02-25 Member: 42471NS1 Playtester, Forum Moderators, Constellation
    Mendasp wrote: »
    I haven't checked, but have you tried changing the dissolve delay too in DissolveMixin:OnKillClient()?

    DissolveMixin.lua
    local kDissolveSpeed = 500
    local kDissolveDelay = 500


    Ragdoll.lua
    local kRagdollDuration = 500

    RagdollMixin.lua
    local kRagdollTime = 500

    @‌Mendasp These are the changes I've tried in each file. The only thing I can get to affect the ragdolls at all is the Dissolve speed, which makes them disappear instead of dissolve. This is the contents of the code you cited in DissolveMixin:

    function DissolveMixin:OnKillClient()
    // Start the dissolve effect`
    local now = Shared.GetTime()
    self.dissolveStart = now + kDissolveDelay
    self:InstanceMaterials()

    According to that, the dissolve effect should be getting delayed.
  • xDragonxDragon Join Date: 2012-04-04 Member: 149948Members, NS2 Playtester, Squad Five Gold, NS2 Map Tester, Reinforced - Shadow
    edited July 2014
    I don't think this is something that you can easily do, since for *most* ents the ragdoll is not a new entity, its just the players entity. Increasing the time they stick around would probably become quite messy. If you want to play around with testing it tho, I suspect this is the code you need to remove/comment out:
    function RagdollMixin:OnTag(tagName)
        
            PROFILE("RagdollMixin:OnTag")
            
            if not self.GetHasClientModel or not self:GetHasClientModel() then
            
                if tagName == "death_end" then
                
                    if self.bypassRagdoll then
                        self:SetModel(nil)
                    else
                        SetRagdoll(self, kRagdollTime)
                    end
                    
                elseif tagName == "destroy" then
                    */DestroyEntitySafe(self)/*
                end
                
            end
            
        end
    
    

    Be warned though that you would want to have a way to make sure the ents get Destroyed.
  • aeroripperaeroripper Join Date: 2005-02-25 Member: 42471NS1 Playtester, Forum Moderators, Constellation
    edited July 2014
    After playing around in these 3 files for quite a while today I can't achieve the desired result I'm looking for. The 'easy' values to set in each file do not work. I'm commented out and experimented with different pieces of code in each file but can't achieve any real results. RagdollMixin.lua is the key I believe, but I'm not sure if I need to add code or not.

    @XDragon I've tried commenting out that info (among other parts of RagdollMixin and Ragdoll (the fake ragdoll after the physically simulated one). No results :/
  • BeigeAlertBeigeAlert Texas Join Date: 2013-08-08 Member: 186657Members, Super Administrators, Forum Admins, NS2 Developer, NS2 Playtester, Squad Five Blue, Squad Five Silver, NS2 Map Tester, Reinforced - Diamond, Reinforced - Shadow, Subnautica Playtester, Pistachionauts
    Bump... cuz I really wanna be able to wade through an ocean of dead skulk bodies.
  • xDragonxDragon Join Date: 2012-04-04 Member: 149948Members, NS2 Playtester, Squad Five Gold, NS2 Map Tester, Reinforced - Shadow
    Hmmm i just noticed this... let me take a look and see what happens.
  • xDragonxDragon Join Date: 2012-04-04 Member: 149948Members, NS2 Playtester, Squad Five Gold, NS2 Map Tester, Reinforced - Shadow
    Made this little mod which works.. but be advised a good number of ragdolls absolutely destroys FPS with the physics calculations... and I dont think there is a way to make the models static after a time and keep the deformations.

    https://github.com/xToken/Ragdoll

    2014-08-06_00001.jpg
  • McGlaspieMcGlaspie www.team156.com Join Date: 2010-07-26 Member: 73044Members, Super Administrators, Forum Admins, NS2 Developer, NS2 Playtester, Squad Five Blue, Squad Five Silver, Squad Five Gold, Reinforced - Onos, WC 2013 - Gold, Subnautica Playtester
    @xDragon You might be able to add another time field, use it on the update routine then change the physics group of the ragdoll so it doesn't collide with anything. Admittedly, that's off-the-cuff and untested. Ideally, a new phycis state could be added that would "freeze" a ragdoll, thus skip it when the update pass occurs.
  • BeigeAlertBeigeAlert Texas Join Date: 2013-08-08 Member: 186657Members, Super Administrators, Forum Admins, NS2 Developer, NS2 Playtester, Squad Five Blue, Squad Five Silver, NS2 Map Tester, Reinforced - Diamond, Reinforced - Shadow, Subnautica Playtester, Pistachionauts
    Multithreaded physics?
  • xDragonxDragon Join Date: 2012-04-04 Member: 149948Members, NS2 Playtester, Squad Five Gold, NS2 Map Tester, Reinforced - Shadow
    Yea i was looking into changing the groups for the ragdolls, but didnt experiment much with that after my initial trial just made them return to default pose. I dont think there is any way to keep them fully dynamic even if you had perfect multithreading.. its just too many calculations. The best solution would be some way to make them non-collideable, and hope that causes them not to be updated.
  • BeigeAlertBeigeAlert Texas Join Date: 2013-08-08 Member: 186657Members, Super Administrators, Forum Admins, NS2 Developer, NS2 Playtester, Squad Five Blue, Squad Five Silver, NS2 Map Tester, Reinforced - Diamond, Reinforced - Shadow, Subnautica Playtester, Pistachionauts
    xDragon wrote: »
    Yea i was looking into changing the groups for the ragdolls, but didnt experiment much with that after my initial trial just made them return to default pose. I dont think there is any way to keep them fully dynamic even if you had perfect multithreading.. its just too many calculations. The best solution would be some way to make them non-collideable, and hope that causes them not to be updated.

    Even without physics at all, how does this impact performance having this many skulk bodies rendering?
  • McGlaspieMcGlaspie www.team156.com Join Date: 2010-07-26 Member: 73044Members, Super Administrators, Forum Admins, NS2 Developer, NS2 Playtester, Squad Five Blue, Squad Five Silver, Squad Five Gold, Reinforced - Onos, WC 2013 - Gold, Subnautica Playtester
    If no collisions could occur after X time, then they wouldn't need to be updated. Right now, players can collide with ragdolls, which means they need to be updated every frame even if no collisions actually occur.

    The prefered method would be to change a ragdoll's collision/physics group after X time. Eliminating the need to perform any kind of update on them. Now, technically, they'll still be updated. However, since we know they couldn't change after X time, then it would be a faster process.
Sign In or Register to comment.