Inside3D!
     

is there a way to do location specific damage in QC?
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Inside3d Forums Forum Index -> QuakeC Programming
View previous topic :: View next topic  
Author Message
hondobondo



Joined: 26 Sep 2006
Posts: 101

PostPosted: Sun Aug 01, 2010 11:07 pm    Post subject: is there a way to do location specific damage in QC? Reply with quote

or does it have to be first done in the engine?
Back to top
View user's profile Send private message
leileilol



Joined: 15 Oct 2004
Posts: 1321

PostPosted: Mon Aug 02, 2010 12:13 am    Post subject: Reply with quote

The only thing you'll do is rough estimation by vector height and that's stupid
_________________
Back to top
View user's profile Send private message
hondobondo



Joined: 26 Sep 2006
Posts: 101

PostPosted: Mon Aug 02, 2010 1:03 am    Post subject: Reply with quote

leileilol wrote:
The only thing you'll do is rough estimation by vector height and that's stupid


why would that be stupid
Back to top
View user's profile Send private message
Spike



Joined: 05 Nov 2004
Posts: 944
Location: UK

PostPosted: Mon Aug 02, 2010 1:41 am    Post subject: Reply with quote

because shooting from up high is always a headshot.
_________________
What's a signature?
Back to top
View user's profile Send private message Visit poster's website
Sajt



Joined: 16 Oct 2004
Posts: 1026

PostPosted: Mon Aug 02, 2010 1:59 am    Post subject: Reply with quote

And shooting from below you'll have to aim at a narrow strip of air three feet in front of his face to get a headshot.
_________________
F. A. Špork, an enlightened nobleman and a great patron of art, had a stately Baroque spa complex built on the banks of the River Labe.
Back to top
View user's profile Send private message
Swift



Joined: 26 Jan 2010
Posts: 44

PostPosted: Mon Aug 02, 2010 2:09 am    Post subject: Reply with quote

That's a bit rough isn't it? How do we know he's not using Quake 3 models in Darkplaces or something?
Back to top
View user's profile Send private message
leileilol



Joined: 15 Oct 2004
Posts: 1321

PostPosted: Mon Aug 02, 2010 2:38 am    Post subject: Reply with quote

sdquake.exe isn't darkplaces, and quake3 models don't allow for locational damage stuff either
_________________
Back to top
View user's profile Send private message
Swift



Joined: 26 Jan 2010
Posts: 44

PostPosted: Mon Aug 02, 2010 6:32 am    Post subject: Reply with quote

Arguable. Might be the 'wrong' way to do things - but could you spawn multiple entitys for the head etc and set them to SOLID_BSP (per poly collision?), doing away with the BBOX?

Of course this is all pointless if setting the head as a tag_entity means it doesn't get checked for collisions - which I'm not sure on.

//DP_GFX_QUAKE3MODELTAGS
//idea: id Software
//darkplaces implementation: LordHavoc
//field definitions:
.entity tag_entity; // entity this is attached to (call setattachment to set this)
.float tag_index; // which tag on that entity (0 is relative to the entity, > 0 is an index into the tags on the model if it has any) (call setattachment to set this)
Back to top
View user's profile Send private message
Sajt



Joined: 16 Oct 2004
Posts: 1026

PostPosted: Mon Aug 02, 2010 7:56 am    Post subject: Reply with quote

It's possible that you could cook up some hack for headshots. If the traceline hits the monster's box, then check manually if the line also intersects some hard-coded smaller box representing the monster's head...
_________________
F. A. Špork, an enlightened nobleman and a great patron of art, had a stately Baroque spa complex built on the banks of the River Labe.
Back to top
View user's profile Send private message
hondobondo



Joined: 26 Sep 2006
Posts: 101

PostPosted: Tue Aug 03, 2010 6:08 am    Post subject: leilei Reply with quote

no one even mentioned sdquake. if you ever played it, you would know headshots would be an enormous waste of time to code. i'm thinking more of a zombie mod. i can't believe no one's even done it for quake before, or has they? i mean real zombie not those weird quake zombies. what are those
Back to top
View user's profile Send private message
gnounc



Joined: 06 Apr 2009
Posts: 120

PostPosted: Tue Aug 03, 2010 6:44 am    Post subject: Reply with quote

The Horror is a zombie mod Wink
Back to top
View user's profile Send private message
Orion



Joined: 12 Jan 2007
Posts: 413
Location: Brazil

PostPosted: Tue Aug 03, 2010 9:49 pm    Post subject: Reply with quote

Unfortunately Quake only uses ONE bounding box per entity. On modern games there are multiple bounding boxes for each part of the body, or per-poly collision. So locational damage gets a bit weird in Quake because of that but anyway I still like it.

See a simple diagram below:




I've drawn the bbox accordingly, that's why you see little spheres between the lines. Wink
As you can see, if you shoot between the player's legs, he will take damage, the bullet will not pass through them.


The simplest way to do this is simply checking where the projectile is hitting.

Use this for hitscan weapons:

Code:

damage = 100; // initial damage value (changeable)
if (trace_endpos_z > (trace_ent.origin_z + trace_ent.maxs_z) - 10) // headshot
 damage = damage * 3; // this will do 3x damage, change to whatever you like
else if (trace_endpos_z < trace_ent.origin_z) // leg shot
 damage = damage * 0.5; // this will do half damage (changeable)


And use this for projectile weapons:

Code:

damage = 100; // initial damage value
if (self.origin_z > (other.origin_z + other.maxs_z) - 10) // headshot
 damage = damage * 3; // same thing as above
else if (self.origin_z < other.origin_z)
 damage = damage * 0.5;


Hope it helps, not tested, just came from the top of my head. Smile
_________________
There's no signature here. Stop looking for one.
Back to top
View user's profile Send private message
frag.machine



Joined: 25 Nov 2006
Posts: 728

PostPosted: Wed Aug 04, 2010 12:59 am    Post subject: Reply with quote

Q2K4 has per-poly collision, which could give a little more precise results against hitscan projectiles (shotguns and alike), unfortunately not very helpful against nails and, obviously, rockets. And, unfortunately, there's no way to tell to QuakeC which triangle in the mesh was hit.
_________________
frag.machine - Q2K4 Project
http://fragmachine.quakedev.com/
Back to top
View user's profile Send private message Visit poster's website
ceriux



Joined: 06 Sep 2008
Posts: 968
Location: Florida, USA

PostPosted: Wed Aug 04, 2010 1:01 am    Post subject: Reply with quote

question could a multi bbox system be implemented into the quake engine? for better model formats?
_________________
QuakeDB - Quake ModDB Group
Back to top
View user's profile Send private message Yahoo Messenger
Urre



Joined: 05 Nov 2004
Posts: 1073
Location: Sweden

PostPosted: Wed Aug 04, 2010 6:56 am    Post subject: Reply with quote

I've implemented multi-bbox systems in QC. It's all perfectly possible...

Do basicly what Sajt said, it's not far from what most games do anyway.
_________________
Look out for Twigboy
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Inside3d Forums Forum Index -> QuakeC Programming All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2004 phpBB Group