rag doll physics

Developer discussion of experimental fixes, changes, and improvements.

Moderators: Nexuiz Moderators, Moderators

Sat May 30, 2009 7:12 pm

  • currently nexuiz is ragdoll-less. i've been working on a ragdoll for dp with little luck. i'll post my code and a screen shot later. until then anyone have any ideas?
    Mizu Kitsune
    Alien trapper
     
    Posts: 362
    Joined: Sat Apr 11, 2009 7:51 pm
    Location: Maridia

Sat May 30, 2009 7:26 pm

Sat May 30, 2009 10:35 pm

  • I've been wondering about this too, would be a great feature to have. Made this topic about it some time ago. At the current point I think DP misses two basic things. First is a real physics engine (Twig does seem to work very nicely) and second is Darkplaces not knowing to animate models dynamically which is most essential. Not familiar with the engine here but I'd love to see what you did there :)
    User avatar
    MirceaKitsune
    Keyboard killer
     
    Posts: 593
    Joined: Thu Aug 14, 2008 6:48 am
    Location: Romania - Bucharest

Sun May 31, 2009 12:09 am

  • you cant use twig for ragdolls, dont even research that area
    best would be to add some free physics engine to dp, as addon (idk, maybe dll/so ), as you know darplaces is under gpl license, and most free physics engines are not compatible (only ode/bullet), but making physics addon that is not needed to run engine would not break gpl terms afaik ianal
    User avatar
    Morphed
    Alien
     
    Posts: 197
    Joined: Tue Feb 28, 2006 10:41 pm
    Location: Poland

Sun May 31, 2009 1:24 am

  • Morphed wrote:you cant use twig for ragdolls, dont even research that area
    best would be to add some free physics engine to dp, as addon (idk, maybe dll/so ), as you know darplaces is under gpl license, and most free physics engines are not compatible (only ode/bullet), but making physics addon that is not needed to run engine would not break gpl terms afaik ianal


    Definitely go with Bullet, you basically hear only good things about it, and most open source games that aren't using their own in-house physics engine (like Nexuiz currently is) seem to go with it.
    Flying Steel
    Keyboard killer
     
    Posts: 623
    Joined: Fri May 08, 2009 9:13 pm

Sun May 31, 2009 1:33 am

  • actually i'm doing it in QC. but very buggy, i.e. player models bounce/move stuck in the position they died in, etc.
    Mizu Kitsune
    Alien trapper
     
    Posts: 362
    Joined: Sat Apr 11, 2009 7:51 pm
    Location: Maridia

Sun May 31, 2009 1:47 am

  • The best you can really hope for is rigid-body physics at death (the new Sven Coop incorporates this rather well). Ragdoll would be impossible without individual control of limbs, which the current Nexuiz model format does not support.
    avirox
    Member
     
    Posts: 15
    Joined: Tue Feb 28, 2006 9:15 pm

Sun May 31, 2009 1:57 am

  • Impossible isn't the right word because we've already seen it done in Darkplaces... it was just far from an optimal solution.
    User avatar
    [-z-]
    Site Admin and Nexuiz Ninja
     
    Posts: 1794
    Joined: Mon Nov 13, 2006 12:20 am
    Location: Florida

Sun May 31, 2009 2:08 am

  • The best you can really hope for is rigid-body physics at death (the new Sven Coop incorporates this rather well). Ragdoll would be impossible without individual control of limbs, which the current Nexuiz model format does not support.


    im not sure if its models fault, its skeletal model format, so maybe only engine doesn't support it

    that reminds me that we don't have control over individual limbs :). Mizu Kitsune if you could add option to rotate bone and don't break animation from quakec, it would be much more cool than ragdolls, we could have up/down aim animation , and procedural shot/pain animations (no more sliding when shoting mg) :)
    User avatar
    Morphed
    Alien
     
    Posts: 197
    Joined: Tue Feb 28, 2006 10:41 pm
    Location: Poland

Sun May 31, 2009 2:37 am

  • [-z-] wrote:Impossible isn't the right word because we've already seen it done in Darkplaces... it was just far from an optimal solution.


    I said impossible without individual control of limbs, which is what mods like SagDoll use. If we had control over individual bone movements in DP+QC it may have a chance, but as others have stated - the best option is realyl engine-side physics support..
    avirox
    Member
     
    Posts: 15
    Joined: Tue Feb 28, 2006 9:15 pm

Sun May 31, 2009 2:38 am

  • Morphed wrote:
    The best you can really hope for is rigid-body physics at death (the new Sven Coop incorporates this rather well). Ragdoll would be impossible without individual control of limbs, which the current Nexuiz model format does not support.


    im not sure if its models fault, its skeletal model format, so maybe only engine doesn't support it

    that reminds me that we don't have control over individual limbs :). Mizu Kitsune if you could add option to rotate bone and don't break animation from quakec, it would be much more cool than ragdolls, we could have up/down aim animation , and procedural shot/pain animations (no more sliding when shoting mg) :)


    Could we shoot off arms with automatic weapons fire (like a knife, but with bullets (boom boom boom boom boom boom boom boom boom boom boom boom boom boom boom boom (SPPPALLLTTEee!!111))
    tundramagi
    Forum addon
     
    Posts: 974
    Joined: Sun Jan 04, 2009 4:53 pm

Sun May 31, 2009 2:42 am

  • i would first make 1 combined ref.smd then a seperate ref for each limb and the animation of each limb seperate from each other. this would also allow skin mods ingame like morphing leg and arm size, and would be easier to ragdoll.
    Mizu Kitsune
    Alien trapper
     
    Posts: 362
    Joined: Sat Apr 11, 2009 7:51 pm
    Location: Maridia

Sun May 31, 2009 2:54 am

  • Mizu Kitsune wrote:i would first make 1 combined ref.smd then a seperate ref for each limb and the animation of each limb seperate from each other. this would also allow skin mods ingame like morphing leg and arm size, and would be easier to ragdoll.


    Yea but no one else will do that.
    Could we have a way to seperate a model into pieces along vertex rings?
    IE: if the bullets go through area X, area X+ seperates from area X- and the triangles that don't exist between the 2 are created by the engine and then textured using the gib (bloody) texture?

    If that could be done then players and bots could even be sliced into diced cubes (kinda) by laser grids :P.
    tundramagi
    Forum addon
     
    Posts: 974
    Joined: Sun Jan 04, 2009 4:53 pm

Sun May 31, 2009 2:57 am

  • thats sorta what i had in mind, though better. that might work. but, how would we render the indivisual triangles for it?
    Mizu Kitsune
    Alien trapper
     
    Posts: 362
    Joined: Sat Apr 11, 2009 7:51 pm
    Location: Maridia

Sun May 31, 2009 4:09 am

  • Mizu Kitsune wrote:thats sorta what i had in mind, though better. that might work. but, how would we render the indivisual triangles for it?


    Connect the "cut" vertexes: blender does this and it makes a surface you can throw a texture on. The surface is triangle, upsidown triangle, triangle etc. If you can't figure out what side is "outside" (it should beable to be found", then just texture both sides (shouldn't be necessassary though.)

    (Though, ofcourse, this would be done in darkplaces engine)

    Basically I would think that what would happen is that the full model would be removed, then the new generated models would be swapped in immediatly, etc. Or, the 1st generated piece would inherit the in dp-memory "file discriptor" of the model, and then for each needed new piece another would be added.
    tundramagi
    Forum addon
     
    Posts: 974
    Joined: Sun Jan 04, 2009 4:53 pm

Sun May 31, 2009 4:19 am

Sun May 31, 2009 4:20 am

  • tundramagi wrote:
    Mizu Kitsune wrote:i would first make 1 combined ref.smd then a seperate ref for each limb and the animation of each limb seperate from each other. this would also allow skin mods ingame like morphing leg and arm size, and would be easier to ragdoll.


    Yea but no one else will do that.
    Could we have a way to seperate a model into pieces along vertex rings?
    IE: if the bullets go through area X, area X+ seperates from area X- and the triangles that don't exist between the 2 are created by the engine and then textured using the gib (bloody) texture?

    If that could be done then players and bots could even be sliced into diced cubes (kinda) by laser grids :P.


    The problem with that technique on its own is that you could look through the dismembered arms and legs in the part of the mesh where they broke off, unless the engine dynamically filled them in with polygons (that had normals facing correctly too) and applied a blood and gore texture to them.

    So it would probably be alot easier to just model the limbs and such for each character model's content 'pack'. Then if you want it to look extra nice, when that character dies, each dismembered limb model is spawned according to where the bone was that it is associated with and then blown out in every direction with a spray of blood particles. Basically like gibs currently do, only with bone-based spawning points so it looks more real- you basically see the character starting as a whole, blow into pieces seamlessly. :twisted:
    Flying Steel
    Keyboard killer
     
    Posts: 623
    Joined: Fri May 08, 2009 9:13 pm

Sun May 31, 2009 4:25 am

  • thats a good point. blood particles can be spawned at predefined ref point, and i believe maya has a ragdoll smd export for css, maybe that can be incorporated.
    Mizu Kitsune
    Alien trapper
     
    Posts: 362
    Joined: Sat Apr 11, 2009 7:51 pm
    Location: Maridia

Sun May 31, 2009 4:35 am

  • Mizu Kitsune wrote:thats a good point. blood particles can be spawned at predefined ref point, and i believe maya has a ragdoll smd export for css, maybe that can be incorporated.


    Well for it to actually work in an OSS project (and not be forgotten next release) it all has to be generated in the engine, not by art/predefined etc. I think that could be done: you can manipulate anything in memory (the engine IS drawing triangles, it isn't sending bla.md3 to the videocard :P).
    tundramagi
    Forum addon
     
    Posts: 974
    Joined: Sun Jan 04, 2009 4:53 pm

Sun May 31, 2009 4:40 am

  • its sending what drawn to the video card, i.e. the models, maps, and bitmaps. the qc and models would be in the next releases dataxxx.pk3 file.
    Mizu Kitsune
    Alien trapper
     
    Posts: 362
    Joined: Sat Apr 11, 2009 7:51 pm
    Location: Maridia

Sun May 31, 2009 4:59 am

  • Mizu Kitsune wrote:its sending what drawn to the video card, i.e. the models, maps, and bitmaps. the qc and models would be in the next releases dataxxx.pk3 file.


    It is converting the .md3 into it's own internal format, and sending the triangles to the card.

    Read md3 -> convert to internal format -> convert into triangles the vidcard can understand.

    This can be changed to (when a laser cuts a model, or a string of bullets rip through an arm):
    Read md3 -> convert to internal format -> convert into triangles the vidcard can understand -> time passes -> bad things happen to model -> add/subtract triangles from interal model, split it into 2 or more internal models, throw them around (or one of them), etc.... they're just triangles, we can do this.

    The md3 is just a starting point, the engine can do whatever it wants with the triangles in memory.
    tundramagi
    Forum addon
     
    Posts: 974
    Joined: Sun Jan 04, 2009 4:53 pm

Mon Jun 01, 2009 12:13 pm

  • Since I modeled a few characters for Nexuiz in Blender, I see the character skeletal problem like this: DP only knows to 'bend' models by their animations (every .zym model has its own verticles bones and animation sets, and DP shows a certain model while that model plays a triggered animation from itself). Imo what DP needs to know is how to animate bones dynamically as an offset over the normal animations, and how to rotate and offset bones or verticles via code.

    If DP could do this it would allow more nice stuff apart from ragdoll physics. A very important possibility would be for players to be seen leaning back / forward when the player aims up or down. Another nice thing would be stuff like flexible models or brushes (flags, goo, etc) which could move when you touch them or go through them :)

    Just an observation and idea - Water in DP already knows to animate verticles from code. If you go in Slimepit Revisited for instance and look at the slime, the entire water surface is wavery. So maybe code from there could be reused on the bones of player models to make them move as wanted.
    User avatar
    MirceaKitsune
    Keyboard killer
     
    Posts: 593
    Joined: Thu Aug 14, 2008 6:48 am
    Location: Romania - Bucharest

Mon Jun 01, 2009 10:55 pm

  • i can make the water splash with qc, but then lots of code to make things splash differently.
    +The Dude+
    [-Project 2501-]
    Mizu Kitsune
    Alien trapper
     
    Posts: 362
    Joined: Sat Apr 11, 2009 7:51 pm
    Location: Maridia

Wed Jun 03, 2009 6:22 am

  • Mizu Kitsune wrote:i can make the water splash with qc, but then lots of code to make things splash differently.


    That would be cool, nexuiz doesn't have any of that yet.

    Also would the cutting model in memory that we talked about above be possible (I would think it would be as you can do what you want with triangles once in memory.) That way we could even have the lazer grids which are found in some maps... cut the victims up properly :P.
    (Hell, with that you could make a sci-fi horror movie completely in DP/Nexuiz).
    tundramagi
    Forum addon
     
    Posts: 974
    Joined: Sun Jan 04, 2009 4:53 pm

Wed Jun 03, 2009 1:04 pm

  • i know it is possible with md3 because you can set the variables in mesh.qc, not sure about .zym but defs.qc effects.qc and either misc.qc or something like ragdoll.qc need to be done first.
    +The Dude+
    [-Project 2501-]
    Mizu Kitsune
    Alien trapper
     
    Posts: 362
    Joined: Sat Apr 11, 2009 7:51 pm
    Location: Maridia

Wed Jun 03, 2009 3:36 pm

  • Mizu Kitsune wrote:i know it is possible with md3 because you can set the variables in mesh.qc, not sure about .zym but defs.qc effects.qc and either misc.qc or something like ragdoll.qc need to be done first.


    For cutting models (deleting current model, then spawning 2 (or more) models that are the generated-by-darkplaces divided models of whatever was cut (division being to the nearest vertex in a vertex loop) divverent said that work would also need to be done on the model caching code (I guess to deal with generated in memory models).

    That is the same area where automatic LOD could be added (known as decimation in 3d modeling programs IIRC (basically your merging some close vertexes, reducing the count of the triangles thusly).
    tundramagi
    Forum addon
     
    Posts: 974
    Joined: Sun Jan 04, 2009 4:53 pm

Wed Jun 03, 2009 4:44 pm

  • Nut sure if what your talking abt is segmented models, if so you could cut the mesh in X pieces and attach them by bones (dpm, zym) or tags (md3). The wired part would be to get normal animation to work then (algorithmic? reference skelly?). Also, it would need to be client side to not rape bandwidth.

    The sane way would of course be to handle it by extending the engine so expose bone control to quakec, add multianimns and so on. but there seem to be noone willing or able to do this atm.
    HOF:
    <Diablo> the nex is a "game modification"
    <Diablo> quake1 never had a weapon like that.
    <Vordreller> there was no need for anything over 4GB untill Vista came along
    <Samua>]Idea: Fix it? :D
    <Samua>Lies, that only applies to other people.
    User avatar
    tZork
    tZite Admin
     
    Posts: 1337
    Joined: Tue Feb 28, 2006 6:16 pm
    Location: Halfway to somwhere else

Wed Jun 03, 2009 9:39 pm

  • tZork wrote:Nut sure if what your talking abt is segmented models, if so you could cut the mesh in X pieces and attach them by bones (dpm, zym) or tags (md3). The wired part would be to get normal animation to work then (algorithmic? reference skelly?). Also, it would need to be client side to not rape bandwidth.

    The sane way would of course be to handle it by extending the engine so expose bone control to quakec, add multianimns and so on. but there seem to be noone willing or able to do this atm.

    segmented models, yes. dpm?
    +The Dude+
    [-Project 2501-]
    Mizu Kitsune
    Alien trapper
     
    Posts: 362
    Joined: Sat Apr 11, 2009 7:51 pm
    Location: Maridia

Wed Jun 03, 2009 9:42 pm

  • tZork wrote:Nut sure if what your talking abt is segmented models, if so you could cut the mesh in X pieces and attach them by bones (dpm, zym) or tags (md3). The wired part would be to get normal animation to work then (algorithmic? reference skelly?). Also, it would need to be client side to not rape bandwidth.

    The sane way would of course be to handle it by extending the engine so expose bone control to quakec, add multianimns and so on. but there seem to be noone willing or able to do this atm.


    Not talking about segmented models per-se. We'd never get everyone to make those. I'm talking about DP segmenting the models in memory along the nearest vertex string when say a laser rips through someone. This is, ofcourse, possible as dp can do whatever it wants with the triangles in memory. Div says the model caching code is where most of the work needs to be done (that would include sending the clients the new in-memory data to draw the newly generated models I would think (send them the vertex and uvmap info for the pieces). For choosing where to chopup the model the ring-loop algo can be used from blender.

    In OSS, one needs to program around artwork limitations :P, but really that's usually the best way as it reduces the burden on content creators. Also it makes things "just work" as one doesn't need to be using a supported model (as all would support it thusly).
    tundramagi
    Forum addon
     
    Posts: 974
    Joined: Sun Jan 04, 2009 4:53 pm

Wed Jun 03, 2009 9:44 pm

  • i said i would segment the models. so far the only thing i can get to do with models is just animate regularly them and change the textures, besides bounce and slide in static dead position.
    +The Dude+
    [-Project 2501-]
    Mizu Kitsune
    Alien trapper
     
    Posts: 362
    Joined: Sat Apr 11, 2009 7:51 pm
    Location: Maridia

Next


Return to Nexuiz - Development




Information
  • Who is online
  • Users browsing this forum: No registered users and 1 guest