Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

volumedetect bullets unreliable?

Stinky Queso
Second Life Resident
Join date: 29 Nov 2004
Posts: 53
12-31-2004 14:29
Ive been playing around with gun scripts today, and I finally worked out a rapid firing gun with volume detect bullets. The only problem is that in order for the bullets to actually have an effect on whatever they are colliding with I have to fire about 10 or so at the same target.

What gives? Are the bullets traveling too fast, or is volumedetect unreliable? Is the collision_start event a problem? I would post the script but I cant log on :P
Any help would be appreciated

edit: I know this has been done in the past, and is used still. Has anyone else experienced difficulties with this?
Christopher Omega
Oxymoron
Join date: 28 Mar 2003
Posts: 1,828
12-31-2004 15:47
Its entirely possible that the bullets are traveling too fast for the collision to be detected. SL physics works by dialating time, that is, splitting continuous motion into discrete (seperate) frames. It seems seemless when viewed, since the human eye can only detect so much "choppy" movement before assuming its fluid, but when "viewed" via LSL, this can result in objects not colliding properly. What happens, is that Havok computes and spits out one instance in time but is unable to preform operations fast enough to spit out an instance in time when the bullet makes contact with the avatar; at one instant, the bullet is about to hit the avatar, at the next, it has already passed through the avatar. This is the result of the speed of the bullet.

At least, that's as far as I know. :)
I hope that helped, in terms of understanding why it may not be working.
==Chris
Doctor Bombay
Ratings Revolt NOW!
Join date: 24 Aug 2003
Posts: 61
12-31-2004 15:47
From: Stinky Queso
Ive been playing around with gun scripts today, and I finally worked out a rapid firing gun with volume detect bullets. The only problem is that in order for the bullets to actually have an effect on whatever they are colliding with I have to fire about 10 or so at the same target.

What gives? Are the bullets traveling too fast, or is volumedetect unreliable? Is the collision_start event a problem? I would post the script but I cant log on :P
Any help would be appreciated

edit: I know this has been done in the past, and is used still. Has anyone else experienced difficulties with this?


Ancient history now but a long time ago I was working on a gun and target system.
I wanted the targets to have a certain look and feel to them, alas, they were too "thin" and the bullets never even detected a collision until i slowed them down to the point you could almost outrun them. OR made the targets so thick they no longer looked like targets. Or at least targets for my application.
I experimented some more and found that a fast enough bullet would pass right through an AV and only rarely "connect".
This may not even remotely be relevent to your issue, but as a complete idiot when it comes to scripting I was pretty amazed that through trial and error I could arrive at these conclusions.
I am sure one of the other scripting masters can better explain this but your post looked lonely with no replies so... blah blah blah :)
_____________________
Best thread commentary ever?
"How dare you confuse us with your fancy pants clear headed thinking! " Chip Midnight 1/11/05
" Silence Infidel.. Do not question the smart people... Accept the answer without question." Alby Yellowknife 1/11/05
"Stop confusing the issue with facts and logic." Moleculor Satyr
Stinky Queso
Second Life Resident
Join date: 29 Nov 2004
Posts: 53
12-31-2004 15:59
Thanks for the replies, guys. I thought the speed and thickness of the bullets might be the case, so I thickened the bullets. It didnt have much of an effect. I see lots of people in sandboxes trying out weapons that have volumedetecting bullets that are tiny but still work wonderfully. Thanks for the info, I'll work with it if I can log on again today.
Francis Chung
This sentence no verb.
Join date: 22 Sep 2003
Posts: 918
12-31-2004 17:14
From: Stinky Queso
Ive been playing around with gun scripts today, and I finally worked out a rapid firing gun with volume detect bullets. The only problem is that in order for the bullets to actually have an effect on whatever they are colliding with I have to fire about 10 or so at the same target.

What gives? Are the bullets traveling too fast, or is volumedetect unreliable? Is the collision_start event a problem? I would post the script but I cant log on :P
Any help would be appreciated

edit: I know this has been done in the past, and is used still. Has anyone else experienced difficulties with this?


I tried some volume detect stuff with some low-speed projectiles. There's a bug where it doesn't give me a land collision event, so the idea had to be abandoned.

Rickard tells me that volume detect problems get much worse with high speed projectiles.
_____________________
--
~If you lived here, you would be home by now~
Issarlk Chatnoir
Cross L. apologist.
Join date: 3 Oct 2004
Posts: 424
01-01-2005 04:28
Have you tried making very long bullets, textured so that most of it is transparent to still make it look a bullet? A 10m long bullet would surelly collide with an av.
_____________________
Vincit omnia Chaos
From: Flugelhorn McHenry
Anyway, ignore me, just listen to the cow
Kurt Zidane
Just Human
Join date: 1 Apr 2004
Posts: 636
01-01-2005 16:54
maybe this would be the long way around the problem. But game like Doom III no longer use frames to detect colistion. Every thing is done with mathematics. Perhap it is posible to simulate this by reading in posistions from a sensor.

long bullet may work, but dosen't it make it harder to doge bullets? ie bullet has gone past, but the invisable tails end up getting hit as some one strafes to the side to doge another bullet.
Rickard Roentgen
Renaissance Punk
Join date: 4 Apr 2004
Posts: 1,869
01-02-2005 01:33
just out of curiousity, you say the bullets only have an effect 1 in 10 times... you mean the bullets only detect collisions 1 in 10 times? or the target only gets collided with 1 in 10 times? because volume detect will cause the bullet to effectively be phantom to everything in the world, while still detecting collision_start's internally. Also, land_collision_start is much more reliable than land_collision. If you're bullets are going through what you're aiming at try this formula. bullet length = bulletspeed / 50. so if you're bullet moves at 50 m/s it should be 1 meter long. ya, if you have fast bullets it makes for very long bullets. Either make them invis, or pretend it's a streaking effect :P. I also don't recommend multi prim bullets as they tend to have a delay if it's the child prim that collides, and also rez much slower.
_____________________
Rickard Roentgen
Renaissance Punk
Join date: 4 Apr 2004
Posts: 1,869
01-02-2005 01:36
From: Kurt Zidane
maybe this would be the long way around the problem. But game like Doom III no longer use frames to detect colistion. Every thing is done with mathematics. Perhap it is posible to simulate this by reading in posistions from a sensor.

long bullet may work, but dosen't it make it harder to doge bullets? ie bullet has gone past, but the invisable tails end up getting hit as some one strafes to the side to doge another bullet.


it would be nice if havok did the math, maybe havok 2 or 3 does I don't know. you can do this with sensors except sensors only trigger once every quarter second which is pretty slow. also there's no way to tell if there's a solid object between the emitter and target with a sensor.

long bullets shouldn't causes a problem with strafing. if you dodge to the side fast enough to avoid the bullet then you probably won't be able to dodge back fast enough to catch it's tail end. this is assuming the bullet is the right lenght for it's speed. if a 10m long bullet is going 20 m/s ya you could probalby hit it's tail end.
_____________________
Starwaster Peregrine
Registered User
Join date: 14 Nov 2003
Posts: 26
01-02-2005 01:49
The slow blade penetrates the shield.
_____________________
"I fear all we have done is awaken a sleeping giant and fill him with a terrible resolve." - Admiral Isoroku Yamamoto upon learning of the success of the Japanese raid on Pearl Harbor which killed 2,400 Americans.
Stinky Queso
Second Life Resident
Join date: 29 Nov 2004
Posts: 53
01-02-2005 19:39
I ended up making an invisible prim that was 10 M long around my actual bullet model. Then I put the script in the 10 M long prim, and...No difference. For some reason if I run or fly towards my target, the bullets hit more often. And when I say hit, I mean push. Perhaps the pushing is happening too late to actually have an effect on the av I'm shooting.
Rickard Roentgen
Renaissance Punk
Join date: 4 Apr 2004
Posts: 1,869
01-04-2005 14:27
From: Starwaster Peregrine
The slow blade penetrates the shield.


rofl, opposite in sl, but funny.
_____________________