🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Simulating Archery

Started by
11 comments, last by Green_Baron 4 years, 7 months ago

Hello, so I thought I would find information on this really easy. Surprisingly, I could not find anything of value. Perhaps I'm searching for the wrong thing, I'm not great a math and it has been a while.

I wanted to create a line (arrow), set attributes (angle, mass, velocity, etc) and have it shoot off in the air. Much like the old school game Gorillas if anyone has played that. I tried looking up Archery formulas, Bow and Arrow formulas. Arrow mathematics. But mostly found stuff about the paradox path. The best I found was KE = 1/2MV. Which seemed like part of something I would need.

Can someone perhaps break this down into separate components, or if possible link me to a good article or simple source code (even just console and plugging values)? I'm using SFML btw, How could I grab the correct angle as it is in flight so that it comes down "realistically". 

 

PS: I'm sure you have seen flash games where you set the power and angle and let the arrow fly with various targets of different points. Maybe worms is a better example. 

Thanks

 

Advertisement

Very cool !

Bowmaking was a hobby of mine for several years, good strong wooden bows in mesolithic to medieval style. For prehistoric hunting games or medieval reenactment as well as experimental archeology. Can't do it any more because where i live now there is not the right wood and these things are weapons here and the country is pretty restrictive with that.

Be it as it may, you said simulation, and like anything physical it is not trivial. The flight of an arrow is not just a parabolica under the influence of air drag.

Let's start with the bow, when it is opened, there is stretched on the front and compressed on the back. The energy it can release before it breaks is determined by the amount of such deformation and the speed with which the material returns to the state of a stretched cord (except those shooting bycicles aka compound bows). Btw., bows are kept with the string taken off.

An arrow is stabilized by its shaft and not the feathers, these are mostly just decorative props. The shaft is set into a swinging vibration when the arrow is accelerated. The "stiffness" is defined by tapering the arrowshaft so that its strength corresponds to the shooting strength of the bow. This is, of course, done by machines these days and one can buy sets with given strengths en gros in wood or plastic or fibre ....

The shooting strength is measured in lbs, the spine of the shaft in grains (them 'Murricans, can't help ...). Every arrow in a set must be of equal strength, or some will turn the one or other way before they hit, which can be equally funny and annoying ...

An arrow in flight: Arrow in flight

Traditional Bowyer's Bible (Volumes 1 to 4)

A whole lot of papers from experimental archeology, like for instance:

https://www.cambridge.org/core/journals/antiquity/article/experimental-archery-projectile-velocities-and-comparison-of-bow-performances/2C1D9F880201D2EDBBAFDEB3A283048F

... and more. If they are behind paywalls, try arxiv.org with the doi as a search criterion.

Further search terms will reveal a plethora of information: Physics of Archery, Experimental Archaeology, Bowmaking, Prehistoric Hunting.

Hope that helps and isn't slightly overpowered ?

 

Edit: try this, it has some of the formulas you need. You will eventually want to model the air drag by yourself. Big feathers, short flight, small feathers, long flight ?

Recalling a few numbers from back in the day, assuming a well made wooden bow with a draw weigth of ~60 pounds (needs a well trained person):

Initial velocity: ~50m/s, velocity loss ~0,15m/s per meter, stored energy in the bow ~1600joule, edit 60% of which may be transferred to the arraw, arrow weight ~25g. All values can vary with material, make and weather (sic), but that may be a guideline.

I think what you want is just simple textbook projectile motion.

https://www.khanacademy.org/science/physics/two-dimensional-motion

Hey thanks, everyone, I've found a bit more information last night. I appreciate the links and examples.

On a side note, 

Green_Baron - Are you sure about the feather thing? I am almost certain they are used to stabilize flight. I recall watching a video actually a year or 2 ago running examples with and without them. Without them, they had an inconsistent flight and didn't go as far. If that is true, very interesting and perhaps I understood it wrong. Thanks for the information

Thanks

6 hours ago, RamblingBaba said:

Green_Baron - Are you sure about the feather thing?

Absolutey. Feathers or vanes can help stabilizing over long distances but are also a decarotive element and usually much too huge because this makes a nice sound during flight and an eyesore colour is easier to find in the thicket. Shooting arrows without feathers is actually a common traditional technique to refine the spine value. If it hits on short distance without feathers, it's correct. The exact matching of spine, bow strength and archer's technique determine the diameter of the distribution disk at the target.

Another Example

Same for the atlatl

Some archery simulators may be worth having a look at if you haven't already done so. But modelling this for a game may be a bit too "advanced", idk ... your decision ?

9 hours ago, Green_Baron said:

Absolutey. Feathers or vanes can help stabilizing over long distances but are also a decarotive element and usually much too huge because this makes a nice sound during flight and an eyesore colour is easier to find in the thicket. Shooting arrows without feathers is actually a common traditional technique to refine the spine value. If it hits on short distance without feathers, it's correct. The exact matching of spine, bow strength and archer's technique determine the diameter of the distribution disk at the target.

Another Example

Same for the atlatl

Some archery simulators may be worth having a look at if you haven't already done so. But modelling this for a game may be a bit too "advanced", idk ... your decision ?

Thanks again Green_Baron. Yes, it is a LITTLE advance in terms of the complexity of making it realistic. Perhaps a future goal after a better understanding of how to combine it all. For now, I'm going to keep it simple "KISS". Much appreciated for all the input and links. 

EDIT: It's amazing how much is involved in something that seems rather basic (if that makes sense). I've also seen that video about the archer paradox! It's a good one.

On 11/18/2019 at 1:28 AM, RamblingBaba said:

But mostly found stuff about the paradox path. The best I found was KE = 1/2MV. Which seemed like part of something I would need.

You need to make a decision that will influence everything else.

Is your design going to model real-world physics?  Or is your design going to use cartoony physics? Or are you going to aim for something in between?

As described, real-world physics is really intense. You can spend months digging in to formulas and reviewing PhD-level and post-doctoral research regarding the physics. There are many properties that could be modeled, up through and including concepts like weakness in each arrow that causes it to break, and how different flexibility in each arrow leads to slight variations in flight. The more realistic you want your modeling the more math you will need.

With cartoony physics you can animate across a line or a parabola and call it done.  

With extremely cartoony physics you don't even need to animate. Just perform a hit test, if it collides the arrow is teleported to the target.

There are games where realistic medieval weaponry is the biggest draw. Some players absolutely love it.  Other players don't care, and would much rather take a game that feels casual and easy rather than one that is physically accurate.

3 hours ago, frob said:

You need to make a decision that will influence everything else.

Is your design going to model real-world physics?  Or is your design going to use cartoony physics? Or are you going to aim for something in between?

As described, real-world physics is really intense. You can spend months digging in to formulas and reviewing PhD-level and post-doctoral research regarding the physics. There are many properties that could be modeled, up through and including concepts like weakness in each arrow that causes it to break, and how different flexibility in each arrow leads to slight variations in flight. The more realistic you want your modeling the more math you will need.

With cartoony physics you can animate across a line or a parabola and call it done.  

With extremely cartoony physics you don't even need to animate. Just perform a hit test, if it collides the arrow is teleported to the target.

There are games where realistic medieval weaponry is the biggest draw. Some players absolutely love it.  Other players don't care, and would much rather take a game that feels casual and easy rather than one that is physically accurate.

I'm not going for ultra real-world physics or anything (I couldn't do it), and this is on a 2D world field. Have you ever played the old atari game "Gorillas"? Where there are 2 gorillas on each side of the map and you plug in the velocity and angle and let the banana fly and you try to hit the other players Gorillas. I can't recall if you have to take into consideration the wind, I believe you do.

Or perhaps you have played one of those flash games where you start a position and using the left mouse to set the power and the mouse movement for angle and you let it fly and try to hit different targets.

Even the game worms is a good one (probably more advance) where you shoot different projectiles and try to hit the other worms.

That is about as realistic as I need. Some physics to simulate drop based on the power applied and angle, finding the correct angle to rotate the arrow in flight and drop.

Well, that makes it easy ?

It is as @a light breeze said, projectile motion, then.

This topic is closed to new replies.

Advertisement