Efficient use of picking?

Blitz3D Forums/Blitz3D Programming/Efficient use of picking?

poopla(Posted 2004) [#1]
It would be great to find out a bit about whats going on when a pick is used. One thing I was curious about it will it only perform the picking if it's determined to be withing a pickable mesh's bounding box/volume of sorts, etc.


jfk EO-11110(Posted 2004) [#2]
I noticed the following:

the shorter the Line to pick, the faster it is.
the smaller the radius, the faster it is.

A lot of long range picks can slow down a game massively.


Almo(Posted 2004) [#3]
A pick involves a ray-cast, a notoriously processor intensive process. Keep them as short, narrow, and uncommon as possible if speed is going to be a problem for your program. Note the lack of a shotgun in Unreal Tournament...


Aymes(Posted 2004) [#4]
I always thought of the flak cannon as a shotgun substitute in UT :o


Almo(Posted 2004) [#5]
Doesn't do ray-casts though. The projectiles move through the air at a finite speed. At least, not level-wide ray-casts. Probly does short-range ones at each interval... Same for the Minigun. Only the Enforcer and Sniper Rifle do a ray-cast until it hits a target.


poopla(Posted 2004) [#6]
Thanks a ton.


Neochrome(Posted 2004) [#7]
why not just do a move entity in the direction of a parent?
move it say 1000 and that will give the same details?

would this be faster???


slenkar(Posted 2004) [#8]
How do you set the radius of a pick?


N(Posted 2004) [#9]
Slenkar: Example:
LinePick(0,0,0,  -50,50,50,  5) ;starting x,y,z,  distance x,y,z,  radius


"why not just do a move entity in the direction of a parent?
move it say 1000 and that will give the same details?"

That's how I've been doing it, though I'm starting to wonder about the efficiency of such a method.


jfk EO-11110(Posted 2004) [#10]
You can use zero for the radius.

One word about realism:
While any Beam-Gun would probably shot its rays with the speed of light, a real projectile from a pistol or rifle will travel with about 250 to 800 Meters per second, depending on model and ammunition.

Socalled subsonic ammo is used with silencers to prevent a "ballistic crack" sound, these projectiles are travelling with a speed slightly lower than the speed of sound (mach 1, around 330m/s), about 300 m/s.

There is also supersonic ammo and hypersonic ammo.

Personally I completely ignore this in my Indoor Levels and plot the impact sprite immediately after firing the gun - a distance of 10 Meters would take only the time of about 1 or two frames.


slenkar(Posted 2004) [#11]
oh o.k. what is the radius of an entitypick??


jfk EO-11110(Posted 2004) [#12]
the radius of the Line used by Linepick. Well, it's more a pipe or a tube. At least that's what I thought :)