Welcome, Guest. Please Login or Register.  • Help
SMF Underground
+ SHMUP-DEV » SHMUP DEV FORUMS » Assistance
|-+ Should my ship catch up with my firing?

Pages: [1]   Go Down
0 Members and 1 Guest are viewing this topic. Topic Tools  
Read January 10, 2006, 07:59:41 PM #0
2dguy

Should my ship catch up with my firing?

This is weird and I didn't notice it until recently. But in my scrolling asteroids game the player ship can zip around pretty quick. The problem is some of the weapons have thrust that start out slowly, or perhaps they don't shoot tha fast.

What is happening, at faster ship speeds, the ship is catching up to the missiles the ship is firing! This would never happen in a real space combat, so I'm wondering if I should just increase the ship firing so this can never happen.

But even if I fire the missiles to move faster, when the main ship is moving faster the missiles "look" like they are slowing down but they are not, it's just the ship moving "almost" as fast as the missiles. This only happens when the ship is moving pretty fast though.  Thoughts??? Thanks...
Offline  
Read January 10, 2006, 08:23:12 PM #1
sloaned

Re: Should my ship catch up with my firing?

I'm trying to find a solution to a similar problem with my vertical shooter. I have the players missiles start off slowly at first and then speed up simulating acceleration. If the player is moving up the screen while firing the missiles go behind the player before flying off at full speed.

Speeding up the rockets doesn't help in this case because it takes away the whole visual acceleration effect so I'm at a loss, any ideas?
Offline  
Read January 10, 2006, 09:06:49 PM #2
oNyx

Re: Should my ship catch up with my firing?

You could always make that bit more realistic, but it isnt necessarly more fun.

2dguy, you could make em a bit faster, but I wouldnt factor the moving speed in. (Its more realistic, but makes prediction way harder.)

Sloaned,its alright. Keep it like that. The behaviour is as expected and you can see it in lots of titles. Often they even start with negative speed (they drop back a little, stop moving... and then start to accelerate quickly). The maximum speed should exceed the ship's (relative) speed by... say... about 50%. And that final speed should be reached quickly.
Offline  
Read January 10, 2006, 09:43:03 PM #3
2dguy

Re: Should my ship catch up with my firing?

Yah, after playing it for a bit I'm convinced there really isn't anything to worry about. It's just an artifact of the player moving at very fast speeds....full throttle.

But you could have a relative offset and base the missile movement off the relative position. This relative position would be on the ship, so you would do something like...

missile.ydistance=missile.ydistance+missile.speed
missile.y=ship.y-ydistance

This would work in a vertical scroller, but for a 360 degree scrolling environment if you did the same with the x position the missiles would always be offset relative to the ship, which would look weird for typical free moving missiles.

Offline  
Read January 11, 2006, 05:42:47 AM #4
jbadams

Re: Should my ship catch up with my firing?

To do it properly, any given projectile when fired should be initialised with it's own launch velocity plus the current velocity of the vessel that fires it.  Thus, unless the ship actually accelerates after firing (at a greater rate than the projectile if the projectile accelerates), or the projectile slows down, the ship will never catch up with any of it's own weapons fire.

A few quick examples (using arbitrary units of speed):
For the purposes of these examples, we'll assume that all projectiles when launched have a speed of 2.

1) The player is currently not accelerating, and is just cruising along at a speed of 2.
The player fires a missile which does not accelerate after being fired, and the player continues cruising (i.e. doesn't accelerate) after firing. 

The speed of the projectile is 4, and the player will never catch it.

2) The player is currently not accelerating, and is just cruising along at a speed of 2.
The player fires a missile which does not accelerate after being fired, and accelerates until reaching speed 5 after firing.

The speed of the projectile is 4.  The player will overtake the projectile.

3) The player is currently not accelerating, and is just cruising along at a speed of 2.
The player fires a missile which accelerates to a speed of 4 after being fired.

The speed of the projectile is 4, but increases to a speed of 6 after being fired.  Without accelerating, the player will not catch the projectile.

Anyways, thats how it works using proper physics - however, it's up to you to decide whether or not being realistic like that is actually fun.
« Last Edit: January 11, 2006, 05:53:57 AM by Kazgoroth »
Offline  
Read January 11, 2006, 06:07:39 AM #5
Olofson

Re: Should my ship catch up with my firing?

To do it properly, any given projectile when fired should be initialised with it's own launch velocity plus the current velocity of the vessel that fires it.  Thus, unless the ship actually accelerates after firing (at a greater rate than the projectile if the projectile accelerates), or the projectile slows down, the ship will never catch up with any of it's own weapons fire.

However, it's up to you to decide whether or not being realistic like that is actually fun.

How about launching with relative speed (ie ship speed + initial launch speed), but then having the projectile adapt it's speed to the world - basically as if there was an atmosphere that made velocities converge towards a balance between thrust and drag?

This is of course not how it would work in space (vacuum), but most people don't have any real life experience with that kind of environments anyway (or they would complain about objects making audible sounds and other weird, unrealistic stuff), so making conditions a bit more earth-like is probably going to give a false impression of things being a bit realistic.

Anyway, the bottom line is, unless you're doing a serious simulator of sorts, do whatever feels right. Games are supposed to be fun and have a nice feel. Smiley

(Then again, a good simulation of an open wheel race car on a nice track is loads of fun too, if you're into that. Wink I doubt an accurate space war simulation would be anything near as entertaining, though.)


//David
Offline  
Read January 11, 2006, 06:16:13 AM #6
jbadams

Re: Should my ship catch up with my firing?

Indeed.  As with all play-mechanics, the best advice I can give it to playtest it, and see if it's actually fun.  Get a few friends to help you out for some different opinions.  Discussing mechanics is all well and good, but until you're actually playing the game you can't really be sure that you've got a fun game on your hands.  Try a few things out, and see what you find produces the best gameplay experience.
Offline  
Read January 11, 2006, 02:58:14 PM #7
LorenzoGatti

Re: Should my ship catch up with my firing?

Besides realism, there is a good reason to have projectiles start slowly or backwards, as sloaned and oNyx describe in the earliest posts, and to limit projectile/screen relative speed: visual feedback.
When the player presses (or holds) the fire button, he is not aiming a physical weapon: the only way to know where the shots are aimed is watching them for a while, until the movement direction is evident and can be projected to an hit or miss result.
If movement is too fast or the projectile is hard to see, the player has to look away from the ship, losing time for large eye movements, and/or he doesn't perceive his aim adequately and shoots randomly.

A slow start is important for bombs, rockets and other sporadic and discontinuous weapons that shoot isolated small objects. Other weapon categories don't have this problem: rapid fire guns shoot closely spaced bullets forming obvious lines; toothpaste lasers, swords, scoops, orbiting pods and similar attached weapons do not fly away; big lasers flash briefly but a long strip is the most directional shape of all; self-guided weapons don't need much accuracy.

Lorenzo Gatti
Offline  
Read January 12, 2006, 12:36:39 AM #8
2dguy

Re: Should my ship catch up with my firing?

"when fired should be initialised with it's own launch velocity plus the current velocity of the vessel that fires it."

Yah, that's probably what I need to do for my 360 degree scrolling blast-em-up. I'll look into that. Thanks for the obvious! Wink
Offline  
Read January 21, 2006, 03:45:49 PM #9
MarkR

Re: Should my ship catch up with my firing?

There's no reason to assume that a ship can't catch up with its missiles. If the missiles are launched with a given impulse, and then maintain constant speed (or even slow down), then the ship accelerating could easily do so.

I wouldn't be surprised if it's (theoretically) possible for some modern fighter planes to catch up with their own bullets, if they fire the cannon and then immediately turn on full power. Of course this would generally be bad (particularly for the pilot)

Mark
Offline  
Read January 22, 2006, 12:41:19 PM #10
Olofson

Re: Should my ship catch up with my firing?

There's no reason to assume that a ship can't catch up with its missiles. If the missiles are launched with a given impulse, and then maintain constant speed (or even slow down), then the ship accelerating could easily do so.
Well, real missiles are powered (by definition, I think...?), but there are lots of non-powered projectile based weapons that obviously behave like that.

Anyway, though missiles have extreme acceleration capabilities, they're not infinitely fast. Don't know if any existing fighter plane comes anywhere near the acceleration of your average missile, meaning they'd need a good while to catch up - but that doesn't mean missiles have higher top speed. (AFAIK, the fastest fighters will leave most missiles behind, if they accelerate soon/fast enough.)

Quote
I wouldn't be surprised if it's (theoretically) possible for some modern fighter planes to catch up with their own bullets, if they fire the cannon and then immediately turn on full power. Of course this would generally be bad (particularly for the pilot)
I think some of the WWII  prop fighters could shoot them selves down by diving while firing their machine guns... Actually, a bullet will eventually slow down to a certain free fall speed (drag/weight balance), and I don't think you need a particularly fast plane to beat that while diving.


//David
Offline  
Read January 23, 2006, 05:32:24 AM #11
the2bears

Re: Should my ship catch up with my firing?

Interesting discussion... I'd go with the "do whatever feels right" maxim.  Realistic physics is fine and all that, but the most important thing is fun.

Bill


the2bears - the indie shmup blog
Offline  
Read January 27, 2006, 06:20:59 PM #12
gamesmad

Re: Should my ship catch up with my firing?

I would keep it like that, so the player can overtake their own bullets, but if they get in the line of fire, then they would shoot themself, that would stop people madly circling and firing aswell, adding a tactical layer to your game aswell.

Will
Offline  
Pages: [1]   Go Up
Jump to:  

Page created in 0.098 seconds with 17 queries.