News:

One Minute Game Review by The Happy Friar: https://ugetube.com/@OneMinteGameReviews
Also on Rumble: https://rumble.com/c/c-1115371

idTech 4 (aka Doom 3 tech) Discord Server! https://discord.gg/9wtCGHa

Main Menu

Quake 1 grenade physics

Started by Cyber8, August 07, 2017, 08:11:41 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Cyber8

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?
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

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

Quote from: Cyber8 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?
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

The bounciness value of the grenade is excessively high. Try lowering it.

spamclark15

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

I figured it works like this
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.