# Theory behind bullet trajectories in shmups?

This topic is 3029 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I was reading a text about the mathematical theory of points rendezvousing to a common point or spreading over an area and then I thought that something similar is happening in (some) shoot em up games with the bullets. See for example Touhou game series (e.g.
or
).

I was wondering if there is actually some math behind those bullet trajectories and tried to look around the Internet but without any results. Some of my friends pointed out that it is most likely just pure trial and error but before I trust that it is just that I thought I'd ask from some game dev forum about it.

So is there any math theory behind the trajectories and if so, any ideas where I could find out more (e.g. is there a term for it I could search with)?

##### Share on other sites
I think most patterns are hand-crafted by combining linear movement with other more interesting movement such as bezier curves or sine waves (at least that was how I was doing it). If you want something more formal or just want some ideas then you should probably check out BulletML.

Hope that helps.

##### Share on other sites
Bullets in this type of game are basically particles -- their movement, color shift and general behavior is all a function of time, typically.

In short, lots of particle bullets + slight deviations in spawn properties leads to quite impressive, immergent patterns. As a simple example, assume a particle emiter at some position, pointing in an initial direction. Now, imagine that this emitter fires a single linear-travelling particle, turns 5 degrees, fires another identical particle, turns 5 degrees... repeat ad-nausium. The effect this produces is a "spiral of bullets" -- already this effect, taken as a whole, seems much more complicated than the sum of its parts would lead you to believe.

Throw in some color-shifting effects, some non-linear acceleration, some spline-like paths or sinusoidal motion, or even some "swarming" behavior for sub-particles in some combination -- put a couple identical emitters at different places to crank up the combinitorial complexity of the effect and suddenly the combination of just a few simple things becomes something that appears to have awe-inspiring complexity.

Think of the patterns produced by a koleidoscope, for example -- you only actually see about 1/6th of the image which is unique, and the rest of the complexity is just mirroring that image. The effect is the same -- the visual complexity appears much higher than the sum of its unique parts suggest.

##### Share on other sites
"already this effect, taken as a whole, seems much more complicated than the sum of its parts would lead you to believe."

Now that I think about it, that might actually be true and most likely is for many cases.

"If you want something more formal or just want some ideas then you should probably check out BulletML."

Thanks. Reading the BulletML documentation made me understand how those bullets are composed of very simple elements.

##### Share on other sites
Another thing you can vary is the speed of plain dumb bullets: faster ones will overtake slower ones at fixed distances from the source, creating a wave interference pattern that's independent of where they are aimed.

1. 1
2. 2
3. 3
Rutin
22
4. 4
5. 5
khawk
14

• 9
• 11
• 11
• 23
• 12
• ### Forum Statistics

• Total Topics
633654
• Total Posts
3013168
×