🔒 Locked
Problem Solving
Advertisement
Original Post
Hey I need to work out the following: What is the final velocity of a bullet of mass 0.2g, travelling at 5m.s, with an initial acceleration of 50m.s, over a distance of 500m, which experiences a force of gravity? I know this sounds like a homework question but it's not, I promise. I need it to set the correct speed of a bullet in my game. If you want to help, please could you show the steps you took and explain why you took those steps. Thanks
Quote:
What is the final velocity of a bullet of mass 0.2g, travelling at 5m.s, with an initial acceleration of 50m.s, over a distance of 500m, which experiences a force of gravity?
You need the direction of the initial movement.
Also, you mention an initial acceleration. First, 50m.s is not an acceleration, it's a speed. An acceleration would be 50m.s2. Besides, the effect of acceleration depends on the time during which it is applied. You need this duration too.
Other than that, a basic book or course discussing newtonian physics has you solve this problem over a dozen times in a row, and explains in depth how it is solved.
Finally, remember that usually, a realistic game is not necessarily fun, and it's sometimes easier to break the laws of physics to make a game really fun. So my answer would be: choose whatever speed works best, instead of limiting yourself to what speed the laws of physics dictate.
Quote:
Also, you mention an initial acceleration. First, 50m.s is not an acceleration, it's a speed. An acceleration would be 50m.s2
Yeah I know that. I didn't know how to type the ^2.
Anyway... the reason I want to do this is because the following is happening.
If I shoot a stream of bullets and move say left at the same time, the bullets waver off to the right to much. It's like they don't even reach the crosshair.
It looks as though I'm firing a flame thrower. I don't want to increase the speed to much though. If you look a Quake 3's plasma gun, it doesn't shoot that fast.
How else could I fix this then?
When you fire a bullet, it goes towards the object the crosshair is on. If you move, your crosshair will move as well, but the bullet should keep going towards the object it was fired at. As a player, if I put my crosshair on my (unmoving) target and fire, I want to hit my target regardless of how I move afterwards, or where I put my crosshair once the trigger has ben pulled.
Do you plan to make bullets that, when fired, will reach the crosshair regardless of where you put it (for instance, you fire, then aim at an enemy, and the bullet "moves" to hit the enemy)?
Do you plan to make bullets that, when fired, will reach the crosshair regardless of where you put it (for instance, you fire, then aim at an enemy, and the bullet "moves" to hit the enemy)?
Dmytry [EDIT: and Eelco]: that would be a "realistic" solution, but it quite defeats the use of a crosshair (since you have no possibility of aiming accurately).
Why? Because you would have to predict, at the moment you fire, that the crosshair will be on the target when the bullet reaches the correct distance.
Why? Because you would have to predict, at the moment you fire, that the crosshair will be on the target when the bullet reaches the correct distance.
Quote:
Original post by ToohrVyk
Dmytry: that would be a "realistic" solution, but it quite defeats the use of a crosshair (since you have no possibility of aiming accurately).
So it must be that rocket gun in half-life 1 where rocket was radio-controlled and moved to aim.
edit:BTW.
If you move with constant speed and shoot and don't turn, all bullets will go in direction of crosshair with that added velocity. Probably it's exactly what OP want, what he meant by "don't want it be like flame thrower" .
Quote:
Do you plan to make bullets that, when fired, will reach the crosshair regardless of where you put it (for instance, you fire, then aim at an enemy, and the bullet "moves" to hit the enemy)?
No. The bullet will still stay on the same line that it was shot. It just looks as though it is cruising to the right.
Quote:
when a new bullet leaves the barrel, you should add the speed of the player to it.
Could you explain why I would need to do this?
Dmytry: the OP is looking for something similar to the Q3A plasma gun (shots travel in a straight line, slowly enough to be dodged).
Mr_Ridd: it might be only an optical illusion. What I suggest is that you do the following experiment: set up a little "target" object in your world. Put your crosshair on it, fire, and move left. If the bullet hits the target object, it has moved in a straight line and you are experiencing an optical illusion : shots seem to be moving right, but in fact they're moving in a straight line.
If the bullet doesn't hit the target object, you seem to have a bug somewhere indeed.
Mr_Ridd: it might be only an optical illusion. What I suggest is that you do the following experiment: set up a little "target" object in your world. Put your crosshair on it, fire, and move left. If the bullet hits the target object, it has moved in a straight line and you are experiencing an optical illusion : shots seem to be moving right, but in fact they're moving in a straight line.
If the bullet doesn't hit the target object, you seem to have a bug somewhere indeed.
Quote:
Original post by ToohrVyk
Dmytry: the OP is looking for something similar to the Q3A plasma gun (shots travel in a straight line, slowly enough to be dodged).
If you'll add velocity of barrel to speed of bullet at start, it will do exactly that. Even more, it will go to crosshair as well if you move with constant speed(between shooting and hitting target).
Dmytry: being physically correct is not a good enough reason to be included in a game. The priority of a game is to be fun, or so I hope. If breaking the laws of physics makes the game better, then by all means it should be done! Imagine Sonic The Hedgehog if you couldn't change your course midair...
And concerning the "moves towards the crosshair", I completely agree with you that shots will indeed move towards the crosshair using your solution. But what players want shots do to is move not towards the crosshair, but towards the object the crosshair was on when they pressed the trigger!
And concerning the "moves towards the crosshair", I completely agree with you that shots will indeed move towards the crosshair using your solution. But what players want shots do to is move not towards the crosshair, but towards the object the crosshair was on when they pressed the trigger!
The bullet is moving in a straight line, it will hit an object that I fire at.
It's just that when I move to either side and shoot it does not look as though the bulets are going straight. It is an illusion but it's too much. If you shoot and move to either side in Quake with the Plasma gun, the bullets do waver a bit but it still looks real.
Mine wavers a lot.
It's just that when I move to either side and shoot it does not look as though the bulets are going straight. It is an illusion but it's too much. If you shoot and move to either side in Quake with the Plasma gun, the bullets do waver a bit but it still looks real.
Mine wavers a lot.
What player wants it to hit the monster like that->[grin]. Should bullets auto-aim onto monsters? I think only rare weapons should auto-aim at monsters, again like in half-life...
edit: latest post:
If you don't add velocity of barrel at start, if you move to side, bullets will look going not straight. They will be going straight line but turned by some degree relatively to crosshair. Like flamethrower.
edit: latest post:
If you don't add velocity of barrel at start, if you move to side, bullets will look going not straight. They will be going straight line but turned by some degree relatively to crosshair. Like flamethrower.
Mr_Ridd: the only way to get rid of that effect while still hitting the objects being aimed at is to increase the speed of the projectiles.
Dmytry: in the end the choice is his. I personally dislike games where projectiles obey to physical rules. I want to play games, not simulations. I want my skill to rely on my ability to put my crosshair with pixel accuracy on where my enemy will be when the shot reaches him.
Also, there's a difference between auto-aiming bullets, which is quite unacceptable, and the legitimate expectation of the player of having a crosshair that actually serves a purpose (that of showing which objects will be hit by the bullet).
EDIT: and to delve deeper into the subject, why do we allow players to walk up/down stairs while running? How can they climb ladders while firing rocket launchers? Why do they survive a shot to the head? And what about a direct rocket hit?
Dmytry: in the end the choice is his. I personally dislike games where projectiles obey to physical rules. I want to play games, not simulations. I want my skill to rely on my ability to put my crosshair with pixel accuracy on where my enemy will be when the shot reaches him.
Also, there's a difference between auto-aiming bullets, which is quite unacceptable, and the legitimate expectation of the player of having a crosshair that actually serves a purpose (that of showing which objects will be hit by the bullet).
EDIT: and to delve deeper into the subject, why do we allow players to walk up/down stairs while running? How can they climb ladders while firing rocket launchers? Why do they survive a shot to the head? And what about a direct rocket hit?
Quote:
Original post by ToohrVyk
Dmytry: in the end the choice is his. I personally dislike games where projectiles obey to physical rules. I want to play games, not simulations. I want my skill to rely on my ability to put my crosshair with pixel accuracy on where my enemy will be when the shot reaches him.
then its obvious we want different things from games :)
for example, in the game soldat i always play with the grenade launcher. it is physicly accurate, and doesnt hit where you put your crosshair. unlike the sniper for example, which is indeed a point and click weapon. nonetheless i think im getting the better part of the gameplay compared to the noobs who cant handle anything other than a sniper.
bottom line: i think more physicly accurate weapons is a great way to add more depth to the FPS genre. a genre which is imho literally dying in need of some innovative gameplay elements.
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement