Tough, tough, decisions.

Blitz3D Forums/Blitz3D Beginners Area/Tough, tough, decisions.

wizzlefish(Posted 2004) [#1]
Good morning (at 22:35)

Would it be better to create a bullet mesh and test for collisions or use "CameraPick?"


BlackD(Posted 2004) [#2]
The question is incomplete..

You mean, for seeing if bullets hit enemies?

Use LinePick along the line of the bullet and if the first entity it hits is an enemy, then voila. ;)


wizzlefish(Posted 2004) [#3]
I could test for collisions with a bullet mesh that fires using "MoveEntity" or I could use "CameraPick" and test if a certain entity could be picked. I was thinking camera pick would be better, and faster, reducing the amount of polys. Am I right?


Rhyolite(Posted 2004) [#4]
I am only just starting to think about this stuff myself, but I guess a camerapick results in an instant hit whereas a moving bullet will take a finite time to hit. Not much difference at close ranges, but can make a difference at long ranges especialy with slower moving projectiles.

Reducing the amount of polys is always good to keep your FPS high, but you could make a bullet using a sprite or single quad (2 tris) or maybe using a single surface system. Depending on how many you need to draw, its unlikely to be a major contibuter to total polys? I guess their would be another slight performance hit due to actualy moving the bullets. I dont know, but I guess the collision tests might be your biggest performance hit?


wizzlefish(Posted 2004) [#5]
I'll use a timer instead with "CameraPick" and for projectiles, like with the Gernade Launcher, I'll use an actual mesh.


jhocking(Posted 2004) [#6]
Note that CameraPick only works for shots straight down the middle of the player's view. If that's all you want then whatever, but for anything else use LinePick.


big10p(Posted 2004) [#7]
I guess a camerapick results in an instant hit whereas a moving bullet will take a finite time to hit.


I quess you could combat this by creating a pivot as the bullet and then doing a LinePick from the pivot's old position to it's new position, every frame.

This way, you can give the bullet a more realistic speed (dependant on how much you MoveEntity the pivot every frame) instead of instantly hitting a far-off target the moment you press the trigger.