shooting in games

Post your questions, suggestions and experiences regarding game design, integration of external libraries here. For irrEdit, irrXML and irrKlang, see the
ambiera forums
roxaz
Posts: 575
Joined: Tue Jan 23, 2007 8:35 pm
Location: LT

Post by roxaz »

FlyingIsFun1217 wrote:
roxaz wrote:why ray casting? i am sure that all now days FPS games use physics engines, there is nowhere to go without them.
Ummm, because I like my precious fps.
Use casting to get the path, send a quick bullet animation, see if the ray intersects.

Maybe I'm wrong on this one, but it seems like this would be altogether easier, and less CPU/GPU intensive. PLEASE CORRECT ME IF IM WRONG!

FlyingIsFun1217
You are just right, less resources needed is good thing. I didnt think about setting accuracy error while using raycasting. Maybe my idea is not the best but if i need to implement this - i would do my way because i always wanted to play a game where bullets bounce of the walls and still might hit someone, or in some very rare cases bullet hits other bullet. Now i am writing and thinking... Everything i mentioned could be implemented with raycasting. Ok, you got me ;]
kburkhart84
Posts: 277
Joined: Thu Dec 15, 2005 6:11 pm

Post by kburkhart84 »

Yeah, the physics engines in a game with certain exceptions are used to make a game look better. Some games actually have gameplay using physics, like puzzles, but for the most part, it is more for looks when the same techniques can be done with faster methods. For example, walking over terrain using a physics engine is overkill, as is shooting most guns. The terrain walking is accomplished by a much quicker method the high accuracy physics engines, and since it will look about the same anyway, there is no point in using physics engines for this. The same way is the gun shot because it happens so quick that it doesn't get a chance to look good. A different example would be movement of characters as ragdolls, and things that get thrown around from the gun shots. That's a little different because those things have a chance to actually get seen, and look good that way. It is harder to calculate this type of movement without a physics engine, either home made or 3rd party. Whereas on the first examples, it is easy to achieve and still look good.

Now if the gameplay is physics based, like rolling a ball around a maze or something like that, then yeah, it would be much better using good physics, since that is what the actual game play is based on, but a gun shot, unless it's really a slow bullet, should probably be done ray based.
lostclimategames
Posts: 331
Joined: Sat Sep 02, 2006 4:11 am
Location: Michigan
Contact:

Post by lostclimategames »

most games cast a ray from the camera, then when it hits an object, it creates a bullet at the gun that points to the hit spot.
___________________________
For all of your 3D/2D resource needs:
Image
JPulham
Posts: 320
Joined: Sat Nov 19, 2005 12:06 pm

Post by JPulham »

the problem with physics is time step/sampling resolution.
lets say the server updates 30 times per second (standard in fast paced FPS i believe) and the bullet moves faster than sound at 300 m/s.
so 300 / 30 = 10. therefore the bullet moves 10 plus meters between updates.
This means that the bullet could pass through walls and straight through a large group of people. :shock:
pushpork
sudi
Posts: 1686
Joined: Fri Aug 26, 2005 8:38 pm

Post by sudi »

well not really....u would make a raycast for the object to check for intersections....

but i don't know how this conversation changed to this....my initial question had absolutly nothing to do with physics....and never had^^
We're programmers. Programmers are, in their hearts, architects, and the first thing they want to do when they get to a site is to bulldoze the place flat and build something grand. We're not excited by renovation:tinkering,improving,planting flower beds.
Post Reply