Bullet Doppler distance?

A place for people with an interest in developing new shmups.
Post Reply
castpixel
Posts: 1
Joined: Fri Jan 07, 2022 3:23 pm

Bullet Doppler distance?

Post by castpixel »

Hi all, newbie here, nice to meet you.

I keep wondering how Treasure games (like radiant silvergun) manage to make a constant stream of bullets even when rushing forward or backing your ship up.

My idea was to snap bullets to 24px horizontal increments on creation (i.e. create bullet at: int(player.X/24)*24, player.Y )

However when moving forward, an extra bullet is created,
whereas when moving back you can clearly see a bullet missingImage

But that's not the behaviour you see in radiant silvergun. There seems to be a doppler effect when I look at it frame-by-frame, *but* the projectiles seem to rearrange themselves every frame, so that they're equidistant.

Anyone know how?
Ixmucane2
Posts: 760
Joined: Mon Jan 19, 2009 3:26 pm
Location: stuck at the continue prompt

Re: Bullet Doppler distance?

Post by Ixmucane2 »

What do you consider a "constant" stream of bullets? A constant time interval between shots allowing them to change density (closer when going forward), or a constant distance between consecutive bullets allowing rate of fire to fluctuate (lower when going forward, constant only on average)?

You can also compensate Doppler effect partially (i.e. slightly closer shots at a slightly lower rate when going forward) and, quite independently, compensate or not the ship's velocity (a shot with a constant muzzle velocity travels across the screen faster if it comes from a ship that is going forward; lateral velocity is even more impactful and usually it's fully compensated).

And of course projectiles can change speed. For example, if there are sequential streams of bullets, the first bullet can move straight or towards a target, while the others can move towards a point at a desired distance from the preceding bullet or towards the midpoint of the preceding and following bullets, evening out distance and velocity differences due to Doppler effect etc.
Post Reply