# Thread: Applied Mathematics (video game design problem)

1. ## Applied Mathematics (video game design problem)

Hello,

I'll start off with a little introduction for some context to my problem. I am a video game designer working on a game set on a fortress island being attacked by enemy warships. The players (it's a multiplayer game) must provide some input to aim a cannon which then fires an explosive shell.

An important note: none of the game physics are realistic. They are deliberately unrealistic for reasons of gameplay.

The problem I am trying to figure out is an equation for the explosion radius. The two variables which affect it are the range, and the weight of gunpowder in the shell.

The range should have linear, decreasing effect on the explosion radius. I.E. at a greater range, the shell will make a smaller explosion. Again, this is for gameplay reasons and has nothing to do with reality.

The weight has a curved, decelerating effect on the explosion radius. I.E. with a heavier weight the shell will make a bigger explosion radius, but everytime the weight is increased, the radius increase is smaller.

The square root curve is not exactly what I need, it should taper off more towards the end.

Now, the question is, how do I combine these two equations into one, in the form 'radius = ...' so that I can program the effect?

any and all help is appreciated,
gamedev

2. I guess you could add them together and solve for the radius. I am not sure if that is what you need or want.

Let R=radius, C=constant, r=range, and w=weight

$\displaystyle \displaystyle R+R=C-r+\sqrt{w}\rightarrow 2R=C-r+\sqrt{w}\rightarrow R=\frac{C-r\sqrt{w}}{2}$

3. I managed to make it work with some crazy magic numbers. It's still not perfect though, heh.