.com.unity Forums
  The Official e-Store of Shrapnel Games

This Month's Specials

Air Assault Task Force- Save $8.00
Bronze- Save $10.00

   







Go Back   .com.unity Forums > Shrapnel Community > Space Empires: IV & V

Reply
 
Thread Tools Display Modes
  #1  
Old August 17th, 2007, 06:05 AM
dogscoff's Avatar

dogscoff dogscoff is offline
General
 
Join Date: Mar 2001
Location: UK
Posts: 4,245
Thanks: 0
Thanked 0 Times in 0 Posts
dogscoff is on a distinguished road
Default Re: OT: Looking for a good physics site

Quote:

The simple way to do it, if you're going a little bit at a time anyway, is to simply accelerate in the direction of the target. The computer will have some overshooting issues, and it won't be the most efficient course, but it'll do the job eventually.
A variation on this which may (or may not) work better would be:

Missile looks at where target is now, and figures how much time it would take the missile to accellerate in a straight line and get to that point. Lets say it predicts it could get there at time U.

Missile now predicts where target will be at time U based on target's current course and accelleration. Lets call this Location K. (I like picking random letters to use a variables, it bugs reals mathematicians/ scientists=-).

Missile begins accelerating towards K.

Every time the target changes course or acceleration, go back to square one.

When missile gets within a certain "kill range" of the target, it startss accellerating directly toward the target instead of some predicted future position.

Again, it's not perfect. Overshooting may still occur (but less so than if always accellerating directly at the target), and it might do crazy things if the target takes violent evasive maneuvers, but it seems to me it ought to generate something akin to a decent intercept. As a bonus, it only has to recalculate when the target changes course, instead of all the time, thus saving you CPU cycles.

Just a thought.
Reply With Quote
  #2  
Old August 17th, 2007, 03:59 PM
narf poit chez BOOM's Avatar

narf poit chez BOOM narf poit chez BOOM is offline
Shrapnel Fanatic
 
Join Date: Mar 2003
Location: CHEESE!
Posts: 10,009
Thanks: 0
Thanked 7 Times in 1 Post
narf poit chez BOOM is on a distinguished road
Default Re: OT: Looking for a good physics site

@Dogscoff: That would generate a pretty good intercept, but it wouldn't be perfect. To get a perfect intercept, you also have to calculate how far the target moves while the enemy is moving to where it will be then. Thanks for the idea, though.

There was distance. In fact, I'm pretty sure it was the position equation, now that I think about it. We never plugged it into the zeros-solving quadratic equation, hence no 4ac.

By 'distance' I meant we didn't take into account position. That wasn't worded well.

+/- is from the quadratic equation. There are two zeros (values of x where the curve intercepts the x axis and y is zero) in the solution to every quadratic equation. The handy cheat sheet formula compacts them into the same function, which varies only by making one version a + and the other a - where that +/- symbol goes.

So I should make two formulas, one with a '+' there and the other with a '-' there and if one returns a zero, I use the other?

The thing about the position function is that it assumes constant acceleration of both parties. It is calculating how much time passes until the objects intercept. From this, you can plot out where they intercept and get the necessary angle of motion. Remember that you had to do this every so often to find a new intercept heading, based on changes to the acceleration vectors of both objects.
I did get that.

This is what I have currently.

...Erm, does that formula give the distance that will be covered or the time to cover it?
__________________
If I only could remember half the things I'd forgot, that would be a lot of stuff, I think - I don't know; I forgot!
A* E* Se! Gd! $-- C-^- Ai** M-- S? Ss---- RA Pw? Fq Bb++@ Tcp? L++++
Some of my webcomics. I've got 400+ webcomics at Last count, some dead.
Sig updated to remove non-working links.
Reply With Quote
  #3  
Old August 17th, 2007, 06:09 PM
Fyron's Avatar

Fyron Fyron is offline
Shrapnel Fanatic
 
Join Date: Jul 2001
Location: Southern CA, USA
Posts: 18,394
Thanks: 0
Thanked 12 Times in 10 Posts
Fyron is an unknown quantity at this point
Default Re: OT: Looking for a good physics site

By 'distance' I meant we didn't take into account position. That wasn't worded well.

Yes we did; the very definition of intercepting a target object is when the positions are equal. We have two position equations, with two unknowns (time and position). Since we know the positions must be equal, we can simply substitute one of the equations for the S value (position) in the other equation, thus eliminating it.

So I should make two formulas, one with a '+' there and the other with a '-' there and if one returns a zero, I use the other?

No... both will return zeros of the quadratic function (aka x-intercepts). I wasn't talking about the integer value 0. A negative zero/intercept is thrown out, as per previous post.
__________________
It's not whether you win or lose that counts: it's how much pain you inflict along the way.
--- SpaceEmpires.net --- RSS --- SEnet ModWorks --- SEIV Modding 101 Tutorial
--- Join us in the #SpaceEmpires IRC channel on the Freenode IRC network.
--- Due to restrictively low sig limits, you must visit this link to view the rest of my signature.
Reply With Quote
  #4  
Old August 17th, 2007, 06:26 PM
narf poit chez BOOM's Avatar

narf poit chez BOOM narf poit chez BOOM is offline
Shrapnel Fanatic
 
Join Date: Mar 2003
Location: CHEESE!
Posts: 10,009
Thanks: 0
Thanked 7 Times in 1 Post
narf poit chez BOOM is on a distinguished road
Default Re: OT: Looking for a good physics site

...I'm missing something here. You're saying the positions must be equal, but at the same time they start unequal.

No... both will return zeros of the quadratic function (aka x-intercepts). I wasn't talking about the integer value 0. A negative zero/intercept is thrown out, as per previous post.
...I have no idea what you just said. I can't even decypher the grammer. For one thing, the only zero I've ever known is an integer, except for the fact that zero isn't actually all that numerical.
__________________
If I only could remember half the things I'd forgot, that would be a lot of stuff, I think - I don't know; I forgot!
A* E* Se! Gd! $-- C-^- Ai** M-- S? Ss---- RA Pw? Fq Bb++@ Tcp? L++++
Some of my webcomics. I've got 400+ webcomics at Last count, some dead.
Sig updated to remove non-working links.
Reply With Quote
  #5  
Old August 17th, 2007, 06:47 PM
Fyron's Avatar

Fyron Fyron is offline
Shrapnel Fanatic
 
Join Date: Jul 2001
Location: Southern CA, USA
Posts: 18,394
Thanks: 0
Thanked 12 Times in 10 Posts
Fyron is an unknown quantity at this point
Default Re: OT: Looking for a good physics site

...I'm missing something here. You're saying the positions must be equal, but at the same time they start unequal.

Huh? Unknown and unequal are not the same thing.

...I have no idea what you just said.

http://en.wikipedia.org/wiki/Zero_of_a_function
__________________
It's not whether you win or lose that counts: it's how much pain you inflict along the way.
--- SpaceEmpires.net --- RSS --- SEnet ModWorks --- SEIV Modding 101 Tutorial
--- Join us in the #SpaceEmpires IRC channel on the Freenode IRC network.
--- Due to restrictively low sig limits, you must visit this link to view the rest of my signature.
Reply With Quote
  #6  
Old August 17th, 2007, 06:58 PM
narf poit chez BOOM's Avatar

narf poit chez BOOM narf poit chez BOOM is offline
Shrapnel Fanatic
 
Join Date: Mar 2003
Location: CHEESE!
Posts: 10,009
Thanks: 0
Thanked 7 Times in 1 Post
narf poit chez BOOM is on a distinguished road
Default Re: OT: Looking for a good physics site

I'm missing something. Probably something obvious. Are you saying the function backtracks from where the positions are equal to where they are at start?

Ok, so occasionally the formula will return zero.

Perhaps it would help if you looked at my code? It could help us figure out the difference between what I think I should be doing versus what I should actually be doing.
__________________
If I only could remember half the things I'd forgot, that would be a lot of stuff, I think - I don't know; I forgot!
A* E* Se! Gd! $-- C-^- Ai** M-- S? Ss---- RA Pw? Fq Bb++@ Tcp? L++++
Some of my webcomics. I've got 400+ webcomics at Last count, some dead.
Sig updated to remove non-working links.
Reply With Quote
  #7  
Old August 17th, 2007, 07:18 PM
Suicide Junkie's Avatar
Suicide Junkie Suicide Junkie is offline
Shrapnel Fanatic
 
Join Date: Feb 2001
Location: Waterloo, Ontario, Canada
Posts: 11,451
Thanks: 1
Thanked 4 Times in 4 Posts
Suicide Junkie is on a distinguished road
Default Re: OT: Looking for a good physics site

The two final positions are variables, and unknown. But they are equal to each other by definition, since equal positions is the definition of interception.
Knowing that they are both equal reduces the number of unknowns by one (Instead of positionA and positionB, you have two copies of positionIntercept). This allows you to solve for Time. If the interception is impossible, Time will end up being an imaginary number.
Reply With Quote
  #8  
Old August 17th, 2007, 07:30 PM
Fyron's Avatar

Fyron Fyron is offline
Shrapnel Fanatic
 
Join Date: Jul 2001
Location: Southern CA, USA
Posts: 18,394
Thanks: 0
Thanked 12 Times in 10 Posts
Fyron is an unknown quantity at this point
Default Re: OT: Looking for a good physics site

Ok, so occasionally the formula will return zero.

If one of the zeros/x-intercepts of the equation occurs at 0,0, then sure... The formula always returns two zeros/x-intercepts; that is the entire purpose of it.
__________________
It's not whether you win or lose that counts: it's how much pain you inflict along the way.
--- SpaceEmpires.net --- RSS --- SEnet ModWorks --- SEIV Modding 101 Tutorial
--- Join us in the #SpaceEmpires IRC channel on the Freenode IRC network.
--- Due to restrictively low sig limits, you must visit this link to view the rest of my signature.
Reply With Quote
Reply

Bookmarks


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 12:57 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©1999 - 2025, Shrapnel Games, Inc. - All Rights Reserved.