Author Topic: Real (Bullet) Physics in Quake 2 - Take Two!  (Read 33880 times)

Offline Paril

  • Jr. Member
  • **
  • Posts: 89
    • View Profile
  • Rated:
Re: Real (Bullet) Physics in Quake 2 - Take Two!
« Reply #45 on: April 14, 2011, 12:34:10 PM »
Yes, something like the death ragdolls in HL2 (not the ones you spawn in GMod as actual ragdolls, but the ones that appear when people die).

It would be impossible to sync them up 100% with just client-side prediction.

-P
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus

Offline Paril

  • Jr. Member
  • **
  • Posts: 89
    • View Profile
  • Rated:
Re: Real (Bullet) Physics in Quake 2 - Take Two!
« Reply #46 on: April 14, 2011, 12:51:17 PM »
Hi paril, cool stuff. You get on IRC at all? quakedev seems dead

Hey Kren, sorry I completely skipped over your post.

I don't very often, just MSN and Skype. I frequent #reactionquake3 and #wirehead in EnterTheGame, though.

-P
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus

Offline VaeVictis

  • i was -1 because you fucking suck
  • Brobdingnagian Member
  • *
  • Posts: 4498
    • View Profile
  • Rated:
Re: Real (Bullet) Physics in Quake 2 - Take Two!
« Reply #47 on: April 14, 2011, 02:33:23 PM »
Yes, something like the death ragdolls in HL2 (not the ones you spawn in GMod as actual ragdolls, but the ones that appear when people die).

It would be impossible to sync them up 100% with just client-side prediction.

-P

so... like an origin point for the rag doll and then it can behave however it wants with all the limbs and such on the client?
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus

Offline Paril

  • Jr. Member
  • **
  • Posts: 89
    • View Profile
  • Rated:
Re: Real (Bullet) Physics in Quake 2 - Take Two!
« Reply #48 on: April 14, 2011, 03:41:48 PM »
Yeah. The server would just say "ragdoll spawns here at these angles, have fun".

-P
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus

Offline Irritant

  • Newbie
  • *
  • Posts: 28
    • View Profile
    • Alien Arena
  • Rated:
Re: Real (Bullet) Physics in Quake 2 - Take Two!
« Reply #49 on: April 14, 2011, 08:54:30 PM »
Yes, this is how it is done on the server as well; thank you for your godly insight :lolsign:

Well that was kind of uncalled for :)  Since I haven't seen your code I wasn't sure if you weren't well, like maybe spawning them from player_die, or something along those lines :P

I had trouble with Bullet on the client side due to it running at a variable FPS, so I have to see what I can do to make it run at a fixed 30 or 60 like the game DLL.

There should be ways to deal with the variable framerate in Bullet.  We used ODE, but I'm sure there are similar functions in Bullet since it was built from ODE.  Darkplaces also does something similar.  This is our little block of code, not sure if it'll help or not..

Code: [Select]
int ODEIterationsPerFrame;
int frametime = Sys_Milliseconds() - lastODEUpdate;

//iterations need to be adjusted for framerate.
ODEIterationsPerFrame = frametime;

//clamp it
if(ODEIterationsPerFrame > MAX_ODESTEPS)
ODEIterationsPerFrame = MAX_ODESTEPS;
if(ODEIterationsPerFrame < MIN_ODESTEPS)
ODEIterationsPerFrame = MIN_ODESTEPS;

dSpaceCollide(RagDollSpace, 0, &near_callback);

dWorldStepFast1(RagDollWorld, (float)(frametime/1000.0f), ODEIterationsPerFrame);

// Remove all temporary collision joints now that the world has been stepped
dJointGroupEmpty(contactGroup);

lastODEUpdate = Sys_Milliseconds();

Excuse the formatting, this board seems to get wonky when posts are longer than the window.
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus

Offline quadz

  • Loquaciously Multiloquent Member
  • ****
  • Posts: 5352
    • View Profile
  • Rated:
Re: Real (Bullet) Physics in Quake 2 - Take Two!
« Reply #50 on: April 14, 2011, 10:54:59 PM »
Yeah. The server would just say "ragdoll spawns here at these angles, have fun".

My presumption would be that in multiplayer, a lot of the potential fun of ragdolls would be diminished if players were seeing dissimilar orientations of the model.

player1: haha!
player2: what?
player1: did you see the corpse arm get caught and the body get dragged up the lift??
player2: ...no :(  mine's on the floor over here


Maybe the client could treat its local modeling of the ragdoll as a prediction, and the server could periodically send a low-res snapshot of its 'master' ragdoll position to the client.  If the client's ragdoll state has drifted from the server's, the client would be responsible for interpolating over some number of frames to put its position back in line with the server's snapshot.

If we've got 10 potentially visible moving ragdolls, and the server were sending just one ragdoll snapshot per frame, then each ragdoll would still be receiving a snapshot every 0.3 seconds given your 30Hz framerate...  The fewer ragdolls moving, the more rapidly snapshots could be sent.

If the PVS changes and new ragdolls become potentially visible which haven't received snapshots in awhile, their snapshot would be scheduled to be sent ASAP; and presumably the client wouldn't bother interpolating, but would just accept the server's positioning immediately.


Dunno... Just a thought. . .


Regards,

quadz

  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus
"He knew all the tricks, dramatic irony, metaphor, bathos, puns, parody, litotes and... satire. He was vicious."

Offline VaeVictis

  • i was -1 because you fucking suck
  • Brobdingnagian Member
  • *
  • Posts: 4498
    • View Profile
  • Rated:
Re: Real (Bullet) Physics in Quake 2 - Take Two!
« Reply #51 on: April 14, 2011, 11:11:48 PM »
Yeah. The server would just say "ragdoll spawns here at these angles, have fun".

My presumption would be that in multiplayer, a lot of the potential fun of ragdolls would be diminished if players were seeing dissimilar orientations of the model.

player1: haha!
player2: what?
player1: did you see the corpse arm get caught and the body get dragged up the lift??
player2: ...no :(  mine's on the floor over here


Maybe the client could treat its local modeling of the ragdoll as a prediction, and the server could periodically send a low-res snapshot of its 'master' ragdoll position to the client.  If the client's ragdoll state has drifted from the server's, the client would be responsible for interpolating over some number of frames to put its position back in line with the server's snapshot.

If we've got 10 potentially visible moving ragdolls, and the server were sending just one ragdoll snapshot per frame, then each ragdoll would still be receiving a snapshot every 0.3 seconds given your 30Hz framerate...  The fewer ragdolls moving, the more rapidly snapshots could be sent.

If the PVS changes and new ragdolls become potentially visible which haven't received snapshots in awhile, their snapshot would be scheduled to be sent ASAP; and presumably the client wouldn't bother interpolating, but would just accept the server's positioning immediately.


Dunno... Just a thought. . .


Regards,

quadz



the funny aspect was kinda what i was thinking :(

thats the whole point in having rag doll physics... lawl factor would make them worth it, otherwise they might just be annoying...

PLUS gameplay problem, if the rag dolls are in a different place to the server vs the client, a rocket could hit a rag doll on the server and explode, but just explode randomly on the client... or even explode in some ones face cause they are standing next to a rag doll... it has a practical gameplay aspect, good to aim for dead bodies with nades and stuff to gib them and get a nice splash damage explosion :)
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus

Offline Acer

  • Sr. Member
  • ****
  • Posts: 315
    • View Profile
  • Rated:
Re: Real (Bullet) Physics in Quake 2 - Take Two!
« Reply #52 on: April 15, 2011, 04:02:14 AM »
Excuse the formatting, this board seems to get wonky when posts are longer than the window.

Internet Explorer 8?  Tools ->Compatibility View Settings and add "tastyspleen.net" to the list, seems to fix it.
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus
Nicotine has never been addictive to me, whatsoever, no matter how many years I've smoked or how many I smoke a day.

Offline [BTF] Reflex

  • Loquaciously Multiloquent Member
  • ****
  • Posts: 5324
  • !
    • View Profile
  • Rated:
Re: Real (Bullet) Physics in Quake 2 - Take Two!
« Reply #53 on: April 15, 2011, 05:38:38 AM »
Quake only lets you have 8 bodies,  ragdolls have different/same limit?


It game hitting a body can be a tactic.

    Barton is heading across megaroom in dm1,  I'm around the stairs waiting with my grenade launcher.
  A body is just on this side of the corner and I shoot the body right as Barton comes into view.

 
Be neat to "nudge" a body into position for some ploy.

Finally gets rid of the "floating in midair" corpse bug.  :)
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus
Sometimes I think it’s a sin when I feel like I’m winnin’ when I’m losin’ again

Offline Paril

  • Jr. Member
  • **
  • Posts: 89
    • View Profile
  • Rated:
Re: Real (Bullet) Physics in Quake 2 - Take Two!
« Reply #54 on: April 15, 2011, 06:47:09 AM »
Due to the network inefficiency of ragdolls (read up), I capped the limit to 4, which seems to be the lowest I can go without overflowing everybody.

Quote
Well that was kind of uncalled for   Since I haven't seen your code I wasn't sure if you weren't well, like maybe spawning them from player_die, or something along those lines

Oh I know, it just sounded a bit patronizing; I was kidding :ilysign:. Anyways, they are indeed being spawned from player_die, just replacing the bodyqueue portion, although if I did move them to the client side I would most likely do it in the EV_DEATH event. I don't use frames anymore for animation, I use animation files (to account for the 30 fps change but still using our 10 fps files).

Quadz, your long and inspiring post is nice, but too much work for something so simple as ragdolls. If I was going to implement snapshots, I would end up doing it for every entity while I had the system in place, and that's somewhat of a large change to replace the stupid baselines that Quake 2 attempts to delta from in a new PVS. Also, slight flaw in your idea: what happens if a player gibs a ragdoll piece while it's out of sync?

Quote
if the rag dolls are in a different place to the server vs the client, a rocket could hit a rag doll on the server and explode,

They aren't "in a different place", the server doesn't have them at all. Besides, ragdolls are not solid.

All-in-all, I think leaving them where they are now is the best option. A max of 4 is quite limiting, but because of how much space they eat I can't really go up anymore (~200 bytes per ragdoll, 1400 byte limit, do the math people!) :(

-P
« Last Edit: April 15, 2011, 07:11:33 AM by Paril »
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus

 

El Box de Shoutamente

Last 10 Shouts:

Costigan_Q2

November 11, 2024, 06:41:06 AM
"Stay cozy folks.

Everything is gonna be fine."

There'll be no excuses for having TDS after January 20th, there'll be no excuses AT ALL!!!
 

|iR|Focalor

November 06, 2024, 03:28:50 AM
 

RailWolf

November 05, 2024, 03:13:44 PM
Nice :)

Tom Servo

November 04, 2024, 05:05:24 PM
The Joe Rogan Experience episode 223 that dropped a couple hours ago with Musk, they're talking about Quake lol.

Costigan_Q2

November 04, 2024, 03:37:55 PM
Stay cozy folks.

Everything is gonna be fine.
 

|iR|Focalor

October 31, 2024, 08:56:37 PM

Costigan_Q2

October 17, 2024, 06:31:53 PM
Not activated your account yet?

Activate it now! join in the fun!

Tom Servo

October 11, 2024, 03:35:36 PM
HAHAHAHAHAHA
 

|iR|Focalor

October 10, 2024, 12:19:41 PM
I don't worship the devil. Jesus is Lord, friend. He died for your sins. He will forgive you if you just ask.
 

rikwad

October 09, 2024, 07:57:21 PM
Sorry, I couldn't resist my inner asshole.

Show 50 latest
Welcome, Guest. Please login or register.
November 25, 2024, 04:09:28 AM

Login with username, password and session length