FPS Gurus - Bulltets?

Blitz3D Forums/Blitz3D Beginners Area/FPS Gurus - Bulltets?

wmaass(Posted 2009) [#1]
Yes, I know there are a dozen threads out there already, my apologies for creating a new one. What I would like to get opinions on is what is the best, most realistic method for handling projectiles? I'm aware of LinePick, CameraPick and such but these don't really float my boat. Back in the day when Delta Force came out I always enjoyed how you had to account for distance when shooting because the bullets would eventually fall to the ground. I think Stalker does something like this as well. This would involve using geometry for the bullets and moving them very fast which as we know is problematic with Blitz's collision. Any thoughts?


PowerPC603(Posted 2009) [#2]
You could use all that (bullet meshes, gravity for the bullets, ...), but instead of checking for collisions, do a linepick in front of the bullet to see if it will hit something before it actually does.

So if your bullet is moving by 1000 units at a time, perform a linepick 1000 units in front of the bullet.
If it will hit something, delete the bullet and do your stuff (kill the enemy, impact a wall, ...).

If it doesn't hit anything, move the bullet 1000 units further and also do your mathematics for getting the bullet involved in gravity (translate it down by a certain factor or something like that).


wmaass(Posted 2009) [#3]
Interesting. Do you think something like JV-ODE would be overkill to handle bullets?


Drak(Posted 2009) [#4]
You don't need physics to handle bullets. The most realistic way of handling bullets is to use an actual mesh. (even just a simple sphere)
In my coastal battery game this is the way I handled droprate: Each iteration I checked the distance of the shell (was a coastal gun, not a rifle or pistol, but still same principle) against the player's position. When the distance got to or above a certain threshold, (say 50m) I dropped the shell .001 and added that .001 to it's droprate. So next iteration, it dropped .002, and the next it dropped .003, and so on. It made a nice dropping arc which was visually pleasing, and the shell eventually hit it's target or fell into the water.


wmaass(Posted 2009) [#5]
That's a good idea. Do you also adjust the velocity of the bullet over time (and perhaps hits damage as well)?


Drak(Posted 2009) [#6]
You could sure do that. Just decrease the amount you move it each iteration as well by a very small amount.


wmaass(Posted 2009) [#7]
Thanks for the tips. I've got some ideas now.