Author Topic: Quake 1 grenade physics  (Read 142 times)

0 Members and 1 Guest are viewing this topic.

Cyber8

  • Newbie
  • *
  • Posts: 7
  • Karma: +0/-1
  • Doom Newbie
    • View Profile
Quake 1 grenade physics
« on: August 07, 2017, 08:11:41 PM »
Hi, the D3 handgrenades have really bizarre physics, bouncing and jittering on the floor like it was made of rubber.
I want to achieve the physics from Q1, so only things I'd like to know are, how collision model looks for Q1 grenades, and what do those mean?
Code: [Select]
entityDef projectile_grenade {
"spawnclass" "idProjectile"
"mins" "-3 -3 0"
"maxs" "3 3 11"
"cylinder" "6"
I know it has something to do with collisions for the projectile but I can't figure out what those numbers do.

Snehk

  • Newbie
  • *
  • Posts: 34
  • Karma: +4/-0
  • Doom Newbie
    • View Profile
Re: Quake 1 grenade physics
« Reply #1 on: August 08, 2017, 07:33:23 AM »
I guess those are collision size and type, but I don't have too much time to check references now. Try looking it up on iddevnet or modwiki.

argoon

  • Sr. Member
  • ****
  • Posts: 275
  • Karma: +21/-81
  • Doom Newbie
    • View Profile
Re: Quake 1 grenade physics
« Reply #2 on: August 08, 2017, 10:27:21 AM »
Hi, the D3 handgrenades have really bizarre physics, bouncing and jittering on the floor like it was made of rubber.
I want to achieve the physics from Q1, so only things I'd like to know are, how collision model looks for Q1 grenades, and what do those mean?
Code: [Select]
entityDef projectile_grenade {
"spawnclass" "idProjectile"
"mins" "-3 -3 0"
"maxs" "3 3 11"
"cylinder" "6"
I know it has something to do with collisions for the projectile but I can't figure out what those numbers do.

I'm not sure but i think mins and maxs are the size of the object bounding box, and i'm pretty sure cylinder is the physics primitive shape for collisions.

About the physics, the Doom 3 hand grenades, they use the idtech 4 physics engine and if you see how other objects bounce around you will see they are very similar in behavior, is just the physics engine that idSoftware uses, is very simplistic, to try to improve the grenade behavior you could mess with the physics properties defined in the entityDef file, like mass, bounciness, etc, but don't expect much of it, unless someone replaces the physics engine (i'm sure will never happen) the physics are what they are.

Btw while playing the new Doom i realize the object's physics were suspiciously similar to those of Doom 3, so perhaps they still use the old idtech 4 physics engine even on idtech 6, i was under the impression they replaced their physics engine for the Havok physics engine but i'm not sure anymore.

Phrozo

  • Mr. Phrozo
  • Jr. Member
  • **
  • Posts: 89
  • Karma: +15/-1
  • :3
    • View Profile
    • Mod Page
Re: Quake 1 grenade physics
« Reply #3 on: August 09, 2017, 03:01:12 AM »
The bounciness value of the grenade is excessively high. Try lowering it.

spamclark15

  • id Enthusiast
  • Jr. Member
  • **
  • Posts: 97
  • Karma: +10/-3
  • A missile-launching skyscraper with goat legs.
    • View Profile
Re: Quake 1 grenade physics
« Reply #4 on: August 09, 2017, 03:40:55 AM »
DOOM 3 has a physics system that was made specifically for id Tech 4. The values you have highlighted will not have any effect on how bouncy the grenades are. There should be a single value that will affect this.

Cyber8

  • Newbie
  • *
  • Posts: 7
  • Karma: +0/-1
  • Doom Newbie
    • View Profile
Re: Quake 1 grenade physics
« Reply #5 on: August 09, 2017, 06:36:43 AM »
I figured it works like this
Code: [Select]
entityDef projectile_grenade {
"spawnclass" "idProjectile"
"mins" "-3 -3 0"
"maxs" "3 3 11"
"cylinder" "6"
mins and maxs define the difference in measurments of collision object,
cylinder is a shape of a collision object and value is how many sides it has (it can be changed to a box).
I set everything to 0 and now projectiles bounce normally. Because there's no difference between mins and maxs, projectile is not rotating at any point, whenever it bounces it keeps its orientation.
By bouncing normally, I mean that projectile won't be sliding on the floor and collision object won't make it bounce in other direction than predicted.

Increased also mass and friction and that solved the problem. Still for the price of not having projectiles spin.