any articles on how they work in games.....?....i googled but couldnt find any
This topic is locked from further discussion.
In what sense to you mean by "work"?
I know of two systems for bullets and bullet damage. You have the weapons that fire an actual physical (in game terms) bullet and depending on the damage system will cause X, X-XX, or "your dead" damage to the entity that it strikes. These bullets are the type that you have to lead your target. (think the nail gun in TFC)
Then you have hit-scan bullets. These aren't actual bullets, just an effect. The "bullet" strikes with no delay or travel time. Essentially you click, and if your aiming reticle is on the target it registers damage to that target. (sniper rifle in TFC)
To the computer it isn't "bullets." It's an instruction set that produces a result that we interpret as bullets.
Basically every "being" has hit boxes.
Every time you click the "gun" performs a firing operation.The firing operation looks at where the crosshair is, applies the random trajectory/accuracy to the shot depending on the gun, and finally checks if the "bullet" was aligned with a hitbox after the firing operation is complete.
If the "bullet" lines up with a hit box you do damage, if it doesn't then that bullet misses.
The randomization of where bullets go can be looked at in this fashion, which should help you understand accuracy and recoil.
Let's say an ak47 has a standard deviation of 2 on the first shot.That gives the bullet a chance to hit anywhere within "2 units" of the center of the center of the crosshair on the first shot.However, the following shots are less accurate to do recoil and you could express those shot in the following fashion.
Higher number = greater deviation from the center of the crosshair.
1st Shot: (1(2x1) = 2 - 2nd shot: (2(2x1) = 4 - 3rd shot: (2.5(2x1) = 5
The more successive shots, the lower the accuracy.
I hope this helps...and I only typed this much because 311 is my favorite band.
This is an example of what hit boxes look like.
so quick question..if i shot a "bullet" then paused the ga,e or something ..could i see that bullet?ixi311downerixi
Nope...nothing is flying through the air at all. Only in Farcry and Crysis would that be possible...because bullets are physical objects in those games.
[QUOTE="ixi311downerixi"]so quick question..if i shot a "bullet" then paused the ga,e or something ..could i see that bullet?D9-THC
Nope...nothing is flying through the air at all. Only in Farcry and Crysis would that be possible...because bullets are physical objects in those games.
Wrong. Actually I was playing CSS today and unloaded an automatic rifle into a door, then walked backward and to the side, and noticed two bullets hanging in the air in front ofwhere my rifle was positioned. Cool glitch, but disappeared after 4 seconds just like decals and corpses, so i couldnt get a screenshot.
Plus, bullets in FEAR are quite very real XD.
Wrong. Actually I was playing CSS today and unloaded an automatic rifle into a door, then walked backward and to the side, and noticed two bullets hanging in the air in front ofwhere my rifle was positioned.
humbugdude
Ok...then tell me the location of the bullet model within the CSS folder...
both max payne's simulated actual bullet travel so if you paused the game you could see the bullets.
[QUOTE="humbugdude"]Wrong. Actually I was playing CSS today and unloaded an automatic rifle into a door, then walked backward and to the side, and noticed two bullets hanging in the air in front ofwhere my rifle was positioned.
D9-THC
Ok...then tell me the location of the bullet model within the CSS folder...
Alright that was somewhat of a riddle because the model doesn't actually exist...I just wanted to see if you would own yourself.
What actually happened is you lagged out for four seconds, fired a couple of rounds from the m4, didn't realize you were lagged out, and stepped back to see the last instance of data that arrived at your system. Thanks to the zero-ping mechanics of valve games, you stay in the game world for about 20 seconds after you lose connection to a server and never realize you've lost connection. So you lost 4 seconds of data causing everything in the game to "freeze" until the next packet arrived.
It wasn't a bug or a glitch...you were looking at the shell casings hanging in mid air because you didn't receive any further data...until 4 seconds later.
When they disappeared you also heard the sound of someone splashing in water.
I've played CS for 9 years...I know it doesn't have visible bullets.
Damn.......you push the fire button, a bullet leaves the barrel of your sellected weapon and if your good enough it kills the target...simple.. why try to complecate things by bringing in physics, unless your trying to make a game, then you are the only one who knows' how bullets are going to react in different situations that arise during combat....
The way guns differ in a game is as follows (from a gamer's perspective):
handgun- is relatively accurate for shooting targets that you can see without sniper scope and who are not very far away, do relatively lower damage than the other big shot weapons (handguns start out as the basic weapons in a game, generally); not automatic, i.e.,takes some milliseconds delay to fire the next shot, the mouse has to be cilcked to fire every shot, gun firing frequency depends on how faster you click the mouse button; reloading time depends from game to game but this is something you can guess right
shotgun- at point blank range it's supposed to kill enemies, handy for combat in close quarters, especially in narrow corridors; bullets from a shotgun starts to spread out as they travel out from the muzzle, so the enemies nearer sustain the most damage since the bullets deviate as they fly farther; not very useful for shooting enemies that you can see without sniper scope and are far away; reloading time depends from game to game but this is something you can guess right
submachine gun- does good damage; one good way to visualize this weapon is to imagine how the spray of a perfume works for that's exactly how this gun fires bullets; useful in close range, not useful in long range; automatic, i.e., if the mouse is being clicked on, the gun will keep firing, delay inbetween the shots (i.e., bullets going out) is very minimal to the eye; reloading time depends from game to game but this is something you can guess right
sniper rifle- shots are dead accurate; suppose to be one shot one kill; high velocity weapon, i.e., bullets travel way fast, is a powerful weapon both in close range and long range, but there's a time delay inbetween the shots; comes with a scope; reloading time depends from game to game but this is something you can guess right
assault rifle- this is my weapon of choice; may or may not come with a scope; shooting with this kind of game is the ultimate luxury a shooter gamer looks forward to; delay inbetween the shots is minimal just like the submachine gun but is way powerful than the sub; accuracy is cool for both close range and long range; does considerable and satisfactory amount of damage on both the ranges; reloading time depends from game to game but this is something you can guess right
Thankyou.
Damn.......you push the fire button, a bullet leaves the barrel of your sellected weapon and if your good enough it kills the target...simple.. why try to complecate things by bringing in physics, unless your trying to make a game, then you are the only one who knows' how bullets are going to react in different situations that arise during combat....
orr25
Its called curiosity, and its a really great thing. Maybe you should have some.
The way guns differ in a game is as follows (from a gamer's perspective):
handgun- is relatively accurate for shooting targets that you can see without sniper scope and who are not very far away, do relatively lower damage than the other big shot weapons (handguns start out as the basic weapons in a game, generally); not automatic, i.e.,takes some milliseconds delay to fire the next shot, the mouse has to be cilcked to fire every shot, gun firing frequency depends on how faster you click the mouse button; reloading time depends from game to game but this is something you can guess right
shotgun- at point blank range it's supposed to kill enemies, handy for combat in close quarters, especially in narrow corridors; bullets from a shotgun starts to spread out as they travel out from the muzzle, so the enemies nearer sustain the most damage since the bullets deviate as they fly farther; not very useful for shooting enemies that you can see without sniper scope and are far away; reloading time depends from game to game but this is something you can guess right
submachine gun- does good damage; one good way to visualize this weapon is to imagine how the spray of a perfume works for that's exactly how this gun fires bullets; useful in close range, not useful in long range; automatic, i.e., if the mouse is being clicked on, the gun will keep firing, delay inbetween the shots (i.e., bullets going out) is very minimal to the eye; reloading time depends from game to game but this is something you can guess right
sniper rifle- shots are dead accurate; suppose to be one shot one kill; high velocity weapon, i.e., bullets travel way fast, is a powerful weapon both in close range and long range, but there's a time delay inbetween the shots; comes with a scope; reloading time depends from game to game but this is something you can guess right
assault rifle- this is my weapon of choice; may or may not come with a scope; shooting with this kind of game is the ultimate luxury a shooter gamer looks forward to; delay inbetween the shots is minimal just like the submachine gun but is way powerful than the sub; accuracy is cool for both close range and long range; does considerable and satisfactory amount of damage on both the ranges; reloading time depends from game to game but this is something you can guess right
Thankyou.
dual_barrel
Errrrr, no. Just no.
yea read the forum before you make an ass of yourself dual_barrel. this is about bullets not how much damage a shotgun will do over a handgun.....
and on whether a bullet would be a real object or an effect- i reckon it would have to be an effect because otherwise the computer would have to process every bullet- the game would just be lag heaven wouldnt it? if it didnt lag it would only be because the bullets are so small..... im not much of a techie guy so i dunno.....
Damn.......you push the fire button, a bullet leaves the barrel of your sellected weapon and if your good enough it kills the target...simple.. why try to complecate things by bringing in physics, unless your trying to make a game, then you are the only one who knows' how bullets are going to react in different situations that arise during combat....
orr25
Because THINKING is a perfectly normal and healthy mental process? Oh and because it's not outlawed in the United States (yet) either.
watching the bullets won't really teach you how a gun works. knowing the damage it deals and the actual impact anims and player hit sounds will. Otherwise the projectiles will probably be visible to the naked eye or have a tracer effect.
research your game of choice on the net and you will probably find the weapon stats for it if it is played seriously online.
The way guns differ in a game is as follows (from a gamer's perspective):
handgun- is relatively accurate for shooting targets that you can see without sniper scope and who are not very far away, do relatively lower damage than the other big shot weapons (handguns start out as the basic weapons in a game, generally); not automatic, i.e.,takes some milliseconds delay to fire the next shot, the mouse has to be cilcked to fire every shot, gun firing frequency depends on how faster you click the mouse button; reloading time depends from game to game but this is something you can guess right
shotgun- at point blank range it's supposed to kill enemies, handy for combat in close quarters, especially in narrow corridors; bullets from a shotgun starts to spread out as they travel out from the muzzle, so the enemies nearer sustain the most damage since the bullets deviate as they fly farther; not very useful for shooting enemies that you can see without sniper scope and are far away; reloading time depends from game to game but this is something you can guess right
submachine gun- does good damage; one good way to visualize this weapon is to imagine how the spray of a perfume works for that's exactly how this gun fires bullets; useful in close range, not useful in long range; automatic, i.e., if the mouse is being clicked on, the gun will keep firing, delay inbetween the shots (i.e., bullets going out) is very minimal to the eye; reloading time depends from game to game but this is something you can guess right
sniper rifle- shots are dead accurate; suppose to be one shot one kill; high velocity weapon, i.e., bullets travel way fast, is a powerful weapon both in close range and long range, but there's a time delay inbetween the shots; comes with a scope; reloading time depends from game to game but this is something you can guess right
assault rifle- this is my weapon of choice; may or may not come with a scope; shooting with this kind of game is the ultimate luxury a shooter gamer looks forward to; delay inbetween the shots is minimal just like the submachine gun but is way powerful than the sub; accuracy is cool for both close range and long range; does considerable and satisfactory amount of damage on both the ranges; reloading time depends from game to game but this is something you can guess right
Thankyou.
dual_barrel
You forgot something very important...Armor penetration. Oh yeah and damage degredation over distance.
A pistol will own someone without armor...but someone with armor will take minimal damage. I would guess that armor reduces pistol damage by about 200%...unless it hits the head in which case a helmet lowers the damage by about 50-60%. Pistol damage reduces significantly at a distance. Sniping someone with the glock can take 30 hits...
Shotguns can easily kill in one shot if someone doesn't have armor...but with armor I would guess that shotguns do about 50-75% less damage per shot. Helmets really stop buck shot too. Not too much damage degredation over distance but you don't take sniper shots with a shotgun anyways so it's hard to tell.
SMGs are super deadly against people without armor but going against armor with an SMG can be frustrating. SMGs do about 100% less damage against someone with armor. It might take 5 shots with an mp5 to drop someone without armor and with armor you can realistically expect 10 shots to drop someone. Lots of damage degredation over distance with SMGs...similar to pistols but not that extreme.
Sniper Rifles really ignore armor. Two shots with the scout to the body = kill no matter what armor. One shot to the head = death no matter what armor. I don't know about the AWP because I refuse to use it. No damage degredation over distance.
Assault Rifles pretty much ignore armor. It might take 3 shots to kill someone without armor but it will probably take 4. Against someone with armor it will probably take 4 shots but sometimes it takes 5 if you have an m4. No damage degredation over distance.
yea read the forum before you make an ass of yourself dual_barrel. this is about bullets not how much damage a shotgun will do over a handgun.....
and on whether a bullet would be a real object or an effect- i reckon it would have to be an effect because otherwise the computer would have to process every bullet- the game would just be lag heaven wouldnt it? if it didnt lag it would only be because the bullets are so small..... im not much of a techie guy so i dunno.....
aussieboy911
Did you read it?
i just would like to jknow though...like just some useful facts...like how each gun...(take cs for instance) differs from one anotherixi311downerixi
D9-THC is absolutely correct about CSS, this method of bullet calculation is also true for a lot of games. The current trend is to use a physical object and calculate impacts with the actual playermodels via the physics engine. Engines that do this are Doom3Engineand Unreal Engine 3 off the top of my head, I also hear that Crysis uses a similar method as well.
With physics controlling the collision with bullets, you actually need to aim slightly ahead of the enemy to accomodate for bullet travel which is far more realistic than the CSS method of instant detection. You'll also notice in the screenshot that D9-THC posted that the hitboxes are larger than the player model, which is obviously not very realistic.
Most games that actually use the physics engine to calculate bullet collisions don't draw a bullet as such, they might draw a line to indicate something moving fast like has already been mentioned but only Max Payne and Fear that I can think of actually draw a bullet model. I'm not sure but I think Fear only draws a bullet when in slow motion though.
Personally I think it's much better using the physics engine because it increases the realism in the game which makes the game more believable, but it can get frustrating sometimes when you just can't hit anyone.
aussieboy911, calulating the bullets in physics doesn't harm performance at all. Physics calculations are very optomised these days, I believe the Havok 2 engine in HL2 is capable of calculating 400+ solid body objects in real time without harming the FPS. The PhysX on the other hand can do many thousand solid body collisions as well as many other effects like cloth and liquid. Though the PhysX requires added hardware.
Have fun.
how bullets are modelled in a game depends on the developer. A simple approach is to fire a ray and loop through all bounding boxes (hit box) in the world to find an intersect(quadtrees probably used to optimise). They may choose to animate a bullet moving its vector position in each update call. For something a little more advanced like physics, the physics routine would calculate the updated variables (position, velocity, acceleration, mass, friction, gravity) of the bullet each update call and check for any collisions and handle them accordingly. Operation flashpoint is a good example, for snipers you need to aim sometimes up to 3m above and in front to counter bullet drop and time delay (althoughwhile this is more accurate than most gamesI am not sure howit would stack up to areal world test).
D9-THC is absolutely correct about CSS, this method of bullet calculation is also true for a lot of games. The current trend is to use a physical object and calculate impacts with the actual playermodels via the physics engine. Engines that do this are Doom3Engineand Unreal Engine 3 off the top of my head, I also hear that Crysis uses a similar method as well.
With physics controlling the collision with bullets, you actually need to aim slightly ahead of the enemy to accomodate for bullet travel which is far more realistic than the CSS method of instant detection. You'll also notice in the screenshot that D9-THC posted that the hitboxes are larger than the player model, which is obviously not very realistic.
Most games that actually use the physics engine to calculate bullet collisions don't draw a bullet as such, they might draw a line to indicate something moving fast like has already been mentioned but only Max Payne and Fear that I can think of actually draw a bullet model. I'm not sure but I think Fear only draws a bullet when in slow motion though.
Personally I think it's much better using the physics engine because it increases the realism in the game which makes the game more believable, but it can get frustrating sometimes when you just can't hit anyone.
aussieboy911, calulating the bullets in physics doesn't harm performance at all. Physics calculations are very optomised these days, I believe the Havok 2 engine in HL2 is capable of calculating 400+ solid body objects in real time without harming the FPS. The PhysX on the other hand can do many thousand solid body collisions as well as many other effects like cloth and liquid. Though the PhysX requires added hardware.
Have fun.
NosmoKing1984
The hit box thing is interesting, but im pretty sure its alot smaller for bf2. Ive shot people in the helmet, missing the faceand not got an instant kill. :(
Most hard to learn and pleasureable once learnt weapon models out there. Bf2 is da s**t
how bullets are modelled in a game depends on the developer. A simple approach is to fire a ray and loop through all bounding boxes (hit box) in the world to find an intersect(quadtrees probably used to optimise). They may choose to animate a bullet moving its vector position in each update call. For something a little more advanced like physics, the physics routine would calculate the updated variables (position, velocity, acceleration, mass, friction, gravity) of the bullet each update call and check for any collisions and handle them accordingly. Operation flashpoint is a good example, for snipers you need to aim sometimes up to 3m above and in front to counter bullet drop and time delay (althoughwhile this is more accurate than most gamesI am not sure howit would stack up to areal world test).
DJGOON
DJGoon's got it.
Depending on how realistic the developers want to make a game, there are quite a few ways to go about doing bullets. Now to expand what he said a bit:
I assumed you know how 3d game basically works, by sewing triangles together one after another. Now in order to determine if two object are occupying the same space, you can check to see if any of the triangle between two object intersects. While math for that isn't complex, when your model has 3-4000 polygons computer can be quickly be bought down to its knee just to check if two models intersects (4000 checked against 4000, that's 4000^2 operations, and that's only for 2 model). Here is the appromixation that was mentioned earlier. By using hitbox, instead of using each triangle, the check is much simplified, we can set up an invisible box arounder the player, and if anything breaks that invisible boundry, we then check each of the hitbox to detect if a collision has occur, and this is the basis of 3D collision detection.
Why mention this? Because you can think bullet as an arbitary line, by dectacting if the line intercepts any hitbox on the model, we can then say if tareget has been hit or it misses. precision of the detection then is determined how tightly hitbox is bounded to the body (where quake only uses 1 rectangle box to check for collision and IIRC Half Life uses circle)
Bullet can be defined in two ways. 1) as a projectry object, or 2) as a straight line until it encounter some object.
let's use 2) as it's easier to describe. Whenever you click on fire button, computer will draw a like based on the angle of the view you are looking toward to. so we get this basic 3d line equation of ax+by+cz=0. The computer then draw this line, starting from the gun-point, untile it comes across any bounding box, then detect against crossing the hitbox. Once registered as hit, then computer automatically remove health from the hit object, or if the target is environment, makes some sparks or destroy the hit object. Games where this type of collision is used. Quake's chain gun, majorty of all halo human techology weapons (beside rocket launcher), Half-Life, TFC, CS, Ghost Recon series, Splinter Cell, Unreal, etc. the list goes on and on.
The spread effect of the weapon can be caused by (a+delta)x + (b+delta)y + (c+delta)z=0, where each delta would be programmed to match certain behavior. If you think Halo actually draws bullet, think again, what they did is a clever use of the line equation. Once the line hits a target, they simply replace the line with trail of smoke. Games that uses this effect cleverly include Halo's sniper rifle, and Unreal's ASMD (the hit is determined when you fire the shot, laser traveling were drawn afterward and is actually harmless. )
For 1), that's where things gets interesting. the bullet basically would be treated like a super fast moving rocket. This design makes sense on a big map or realistic shooters as there is no bullet that is instant hitting and at long distance can create illusion of realism. The game basically treat a bullet as a point that will move dx, dy, dz per frame. and when the bullet is moved, you can draw a line between the old position to the new position. and if this line intercept any hitboxes. The object is count as hit. To simulate the effect of gravity, the game can slowly change the position of bullet closer to the ground, hence causing you having to "lead" the target while shooting.
Games that utilize such method, Delta Force, Max Payne series, Stranglehold, any rocket or grenade type weapon you see in game. or any weapon you can clearly see the projectry.
D9-THC is absolutely correct about CSS, this method of bullet calculation is also true for a lot of games. The current trend is to use a physical object and calculate impacts with the actual playermodels via the physics engine. Engines that do this are Doom3Engineand Unreal Engine 3 off the top of my head, I also hear that Crysis uses a similar method as well.
With physics controlling the collision with bullets, you actually need to aim slightly ahead of the enemy to accomodate for bullet travel which is far more realistic than the CSS method of instant detection. You'll also notice in the screenshot that D9-THC posted that the hitboxes are larger than the player model, which is obviously not very realistic.
Most games that actually use the physics engine to calculate bullet collisions don't draw a bullet as such, they might draw a line to indicate something moving fast like has already been mentioned but only Max Payne and Fear that I can think of actually draw a bullet model. I'm not sure but I think Fear only draws a bullet when in slow motion though.
Personally I think it's much better using the physics engine because it increases the realism in the game which makes the game more believable, but it can get frustrating sometimes when you just can't hit anyone.
aussieboy911, calulating the bullets in physics doesn't harm performance at all. Physics calculations are very optomised these days, I believe the Havok 2 engine in HL2 is capable of calculating 400+ solid body objects in real time without harming the FPS. The PhysX on the other hand can do many thousand solid body collisions as well as many other effects like cloth and liquid. Though the PhysX requires added hardware.
Have fun.
NosmoKing1984
Guess the question is already answered, but here's a few point i I will say about physics engine. a) no, physics engine still has to treat each object as a practiles. It is impossible and improper for any computer system to treat each moving object as a continous body. How would we do calculation about that? do we check to see if object collide after .001s? .002s? 1s? Hardware or not, evey supercomputer cannot do this kind of calculation in realtime for each object. It is wastful when the object is still moving. Either way, best approxmiation is to a) calculate two moving object to see if they would intercept each other during the time escaped, and b) if they do, when does this collision occur. This is when the extra hardware comes into place.
PhysicsX is basically a super fast calculator that can crunch numbers faster then CPU can as they are dedicated to do nothing but math. Where as physics usually is handeled by CPU, if the extra hardware is presented, CPU can off load all these operation to the card and just wait for the card to return the result. Fundamental of the 3D collision detection still does not change because physicX card is present, it simply is handeled by a much more dedicated hardware.
Now if you are into graphic card as well, that's where hardware physics starts to get funny. I am sure that you are aware of the pixel shader on the DX9 card generation. To produce these shader effect, the graphic card uses the shader instruction to preform some mathematical operation to alter the apparence of pixel on a given image/model. Notice the term mathematical? It turns out through cleaver use of pixel shader engine, you can actually modify the pixel shader to act as a dedicated calculator capable of preforming physics calcation as well. This provides two different ways of dealing with physice, 1) buy physicsX card from Ageia, or b) Havok's ragdoll engine which would be using GPU's shader engine to do the work for them if you have 2 graphic cards.
Here's some afterthought. I do not know if Havok's method is already in effect. But in order to use graphic card in that way, you are suppose to have at least 2 cards, so 1 can be used for graphics and another for physics. In other words, SLI or crossfire has to be disabled (donno if they changed it now). Ageia's card may seem to be a better choice, the only problem is there is yet any game that shows significiant difference behavior by utilizing their cards. Big one comes to mind is GRAW, where having the card active actually makes game a lot more laggy and doesn't provide enough environment interaction that justified the price tag. As of now, Physics card is an even worse offender then Vista's DirectX in the market penetration.
Im just going to put it out there.
Only in certain new games can bullets be seen. Sure, you could say you saw them in BF2, but you must remember, you don't. Many Machine gun turrets, Helos, and tanks and etc. have a certain number of bullets and tracers. For example, The jeep from BF2 claims to have 4 bullets then 1 tracer. so you know every time you see something yellowy white shoot out, 4 bullets have already come out.
As for physics, in older games it was merely as someone else had previously stated, the bullet travels along its path at x units per second, where x is the speed of the bullet and the units are defined by in game pixels/polygons. Recoil is determind as well often by for every adiitional bullet the gun is pushed x units this way and that (usually predetermined).
Bullets are relatively new. I know in STALKER the bullets actually have good physics - apparantly weight, speed, and the like affect the rate of bullet drop. Most new-ish games will have bullet drop, meaning, gravity affects the bullet. of course, it wont matter from relatively close conditions because of the speed of the bullet, though even a fast sniper will drop after a long time.
does that help?
People need to understand is that there are no games where bullets are actual projectiles unless they are slowed and clearly have a texture. It's all instant hit-registration. D9 THC is completely right.
[QUOTE="NosmoKing1984"]D9-THC is absolutely correct about CSS, this method of bullet calculation is also true for a lot of games. The current trend is to use a physical object and calculate impacts with the actual playermodels via the physics engine. Engines that do this are Doom3Engineand Unreal Engine 3 off the top of my head, I also hear that Crysis uses a similar method as well.
With physics controlling the collision with bullets, you actually need to aim slightly ahead of the enemy to accomodate for bullet travel which is far more realistic than the CSS method of instant detection. You'll also notice in the screenshot that D9-THC posted that the hitboxes are larger than the player model, which is obviously not very realistic.
Most games that actually use the physics engine to calculate bullet collisions don't draw a bullet as such, they might draw a line to indicate something moving fast like has already been mentioned but only Max Payne and Fear that I can think of actually draw a bullet model. I'm not sure but I think Fear only draws a bullet when in slow motion though.
Personally I think it's much better using the physics engine because it increases the realism in the game which makes the game more believable, but it can get frustrating sometimes when you just can't hit anyone.
aussieboy911, calulating the bullets in physics doesn't harm performance at all. Physics calculations are very optomised these days, I believe the Havok 2 engine in HL2 is capable of calculating 400+ solid body objects in real time without harming the FPS. The PhysX on the other hand can do many thousand solid body collisions as well as many other effects like cloth and liquid. Though the PhysX requires added hardware.
Have fun.
solaris1979
Guess the question is already answered, but here's a few point i I will say about physics engine. a) no, physics engine still has to treat each object as a practiles. It is impossible and improper for any computer system to treat each moving object as a continous body. How would we do calculation about that? do we check to see if object collide after .001s? .002s? 1s? Hardware or not, evey supercomputer cannot do this kind of calculation in realtime for each object. It is wastful when the object is still moving. Either way, best approxmiation is to a) calculate two moving object to see if they would intercept each other during the time escaped, and b) if they do, when does this collision occur. This is when the extra hardware comes into place.
PhysicsX is basically a super fast calculator that can crunch numbers faster then CPU can as they are dedicated to do nothing but math. Where as physics usually is handeled by CPU, if the extra hardware is presented, CPU can off load all these operation to the card and just wait for the card to return the result. Fundamental of the 3D collision detection still does not change because physicX card is present, it simply is handeled by a much more dedicated hardware.
Now if you are into graphic card as well, that's where hardware physics starts to get funny. I am sure that you are aware of the pixel shader on the DX9 card generation. To produce these shader effect, the graphic card uses the shader instruction to preform some mathematical operation to alter the apparence of pixel on a given image/model. Notice the term mathematical? It turns out through cleaver use of pixel shader engine, you can actually modify the pixel shader to act as a dedicated calculator capable of preforming physics calcation as well. This provides two different ways of dealing with physice, 1) buy physicsX card from Ageia, or b) Havok's ragdoll engine which would be using GPU's shader engine to do the work for them if you have 2 graphic cards.
Here's some afterthought. I do not know if Havok's method is already in effect. But in order to use graphic card in that way, you are suppose to have at least 2 cards, so 1 can be used for graphics and another for physics. In other words, SLI or crossfire has to be disabled (donno if they changed it now). Ageia's card may seem to be a better choice, the only problem is there is yet any game that shows significiant difference behavior by utilizing their cards. Big one comes to mind is GRAW, where having the card active actually makes game a lot more laggy and doesn't provide enough environment interaction that justified the price tag. As of now, Physics card is an even worse offender then Vista's DirectX in the market penetration.
By the way... it actually ISN'T that resource intensive to keep track of bullets... Adding two numbers together every few clock-cycles and checking interactions isn't all that difficult. When you fire normally that all happens anyway - INSTANTANEOUSLY. It merely isn't done, because its somewhat wasteful because no-one can actually see the bullets. Even if you can pause the game most bullets are traveling so fast that it would be merely luck if you could even see one while pausing. Havok is able to calculate thousands of INTERACTIONS simultaneously... but most bullets stop after one interaction (eg hitting a wall). This isn't necessary for bullets though.
For those of you who don't know much about programming almost all games have actual bullets that leave the position of the gun and travel until they interact with something. However, this usually isn't accompanied by drawing the bullet - the "bullet" is just an object which contains variables such as x-coordinate, y-coordinate, speed(vector), acceleration(vector) etc. If the "bullet" interacts with an "opponent" model (which is mathematically determined by calculating the intersection of shapes - usually rectangles) then you score a hit. bob9999999999About the only game that draws bullet during game time is probably Max Payne. for others it's just air moving at high speed :D
Please Log In to post.
Log in to comment