Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

3 Dimensional Chat / bullet collision issue (HELP)

Author
Message
Maxmax123
16
Years of Service
User Offline
Joined: 11th Feb 2008
Location:
Posted: 11th Dec 2008 23:07
I have my bullets being registered by my hit detection code and it does work but some bullets pass right through a player.
I think the bullets are skipping some collisions with a player due to their move object is set to like 8 spaces per cycle. I wanted realistic bullets and not just use ray casting as the bullets would be more like lazers.

Any idea how I could have the bullets not skip collisions and still allow them to fly at any speed?
Hunter H111
17
Years of Service
User Offline
Joined: 29th Jun 2007
Location: United States
Posted: 12th Dec 2008 04:24
I think you posted in the wrong place.
RUCCUS
19
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 12th Dec 2008 15:47
By the sounds of things, you're checking for collision on a bullet object based on it's current position. Thats wrong. You need to use an intersection ray being cast from the bullet's old position to the bullet's new position, checking for intersection with any enemies / walls etc. You may also consider not even using a bullet object, as most weapons shoot bullets so fast that you cant see the bullet. In most games today, instead of using objects they just cast an intersection ray from the player's gun to a point far out infront of the player's gun, checking for collision.

If you dont know what an intersection ray is, do a search for sparky's collision, intersect object, intersection ray, and bullet collision. If that doesnt help do a search for Massive Collision Resource, a thread I made a year or two ago containing tutorials and demos about information on checking for different types of collision.

And yes, this belongs in the Newcommer's Corner board, not 3D Chat.

Maxmax123
16
Years of Service
User Offline
Joined: 11th Feb 2008
Location:
Posted: 12th Dec 2008 21:08
you havent hear of tracers?

I just need to know a good way to implement ray casting with my bullets
RUCCUS
19
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 12th Dec 2008 23:10 Edited at: 12th Dec 2008 23:11
And... I just told you what to do to find information on that. Its really not that hard. Get the old position of your bullet before it moved, then move it and get it's new position. Call the intersect object command with the old and new coordinates as the starting and ending coordinate on your enemy object (or run it in a for-loop to check multiple enemies). If it returns anything greater than 0 then there was a hit and you can delete / hide the bullet object and damage the enemy. Look into Sparky's collision Dll for faster intersection checks, as well as the ability to group objects and check for intersections with groups (IE a group of enemy objects) and for commands to get the angle of the polygon hit (for decal placement like bullet holes).

Heard of forum edicate?

lazerus
16
Years of Service
User Offline
Joined: 30th Apr 2008
Location:
Posted: 13th Dec 2008 20:41
someone tried this awhile back, search fpsc forums

prasoc
16
Years of Service
User Offline
Joined: 8th Oct 2008
Location:
Posted: 14th Dec 2008 10:42
RUCCUS, what command in Sparky's allows you to find the angle? I have made bullet collision using raycasting, and when I try to find a command that lets a bullet hole angle correctly, I can't.
RUCCUS
19
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 15th Dec 2008 01:28
There's a demo that comes with Sparky's dll that demonstrates how to place decal plains at an intersection point oriented to the polygon's angle / hit position. Look through them, its there.

prasoc
16
Years of Service
User Offline
Joined: 8th Oct 2008
Location:
Posted: 16th Dec 2008 20:02
ah i got it !! woot i got it to fully work ^_^

Login to post a reply

Server time is: 2024-11-25 09:53:36
Your offset time is: 2024-11-25 09:53:36