Data Realms Fan Forums
http://45.55.195.193/

Interception algorithm help
http://45.55.195.193/viewtopic.php?f=73&t=14631
Page 1 of 1

Author:  Duh102 [ Thu May 14, 2009 11:00 pm ]
Post subject:  Interception algorithm help

Alright, so I'm disappointed with the current way homing missiles work. They always overshoot the target and look funny in flight, especially when overshooting the target.

I rewrote the basic Coalition homing missile script to do away with purely emission-controlled thrust and instead put in Lua-controlled accelerations based on the position of the missile in relation to the target actor. This woks pretty well, but as a measure to keep the missile from overshooting the target, it slows down almost to a standstill when the actor is four times the velocity minus 10 ((self.Vel.X * 4) + 10) pixels away. This works, but looks very strange. There must be a better, nicer way to keep the missile accelerating throughout the entire burn whilst retaining accuracy.
Here's my code so far (I must have made an error somewhere, when the missile loses it's target it begins accelerating full ahead positive on both axes).
Attachment:
MiniMissile.rar [1.09 KiB]
Downloaded 246 times


Can anyone improve it, or suggest a better way to do it?

EDIT: I think I've made it plenty perfect to my liking. Grif reminded me of trig functions, so I used the same calculation as in the old method to get the angle of the target, then used the x and y components to add acceleration to the missile.
Code:
Attachment:
MiniMissile 2.rar [1 KiB]
Downloaded 283 times

turnspeed and maxspeed should be fairly self-explanitory. The values currently present cuase this effect:
Image

Author:  Miles_T3hR4t [ Fri May 15, 2009 3:10 am ]
Post subject:  Re: Interception algorithm help

but the question is, can you check for terrain, get it to avoid terrain that isn't the target, and even give it path-finding AI so it can run through mazes to a target?

Author:  Daman [ Fri May 15, 2009 4:06 am ]
Post subject:  Re: Interception algorithm help

That'd be annoyingly dumb. It looks very nice now, where it is somewhat like a SAM site.

Author:  Miles_T3hR4t [ Fri May 15, 2009 7:04 pm ]
Post subject:  Re: Interception algorithm help

Daman wrote:
That'd be annoyingly dumb. It looks very nice now, where it is somewhat like a SAM site.


First of all,

Worms : the homing pigeon, and patsy's magic bullet.


Second of all, chainsaws that follow the ground, climb walls and mow down actors feet first. this could be awesome, could it not?

Author:  Daman [ Fri May 15, 2009 8:08 pm ]
Post subject:  Re: Interception algorithm help

Homing pigeon doesn't dodge objects.

I'm saying making ♥♥♥♥ home all the time is not the way to a good mod(especially making it pathfind too urgghh). It's dumb. There are enough homing rocket launchers as it is.

Author:  Miles_T3hR4t [ Fri May 15, 2009 9:47 pm ]
Post subject:  Re: Interception algorithm help

Daman wrote:
Homing pigeon doesn't dodge objects.

I'm saying making ♥♥♥♥ home all the time is not the way to a good mod(especially making it pathfind too urgghh). It's dumb. There are enough homing rocket launchers as it is.


I actually agree with you, Pathfinding missiles is overpowered and adding it to CC would probably be dumb, if you gave it good pathfinding. If it gets lost spins around and blows up at random, it becomes hysterical.

And as for to many homing weapons. For a while a build or 3 ago, there was 1 homing missile, without lua, then suddenly there where 9. and then in B22, everyones like "we can't make homing missiles, we need lua for that" and I was like WTF?! Its an exploding actor with a vacuum gun!

So now theres a bajillion homing missiles that use lua, and here I am, working on a mod with 411570N3 for warhammer 40K and the tau, and I'm making the broadside which has semi-intelligent terrain avoiding smart missiles, that dodge debris, objects that aren't the target, and they track and follow. I have no idea how I'm gonna code that, AND on top of that, even though I started trying to figure out how to just make it a genaric homing missile in B22, Now there are 18 billion homing missiles and I'm just gonna look like a fudge copycat.

What the hell do I do?

Author:  Grif [ Fri May 15, 2009 10:32 pm ]
Post subject:  Re: Interception algorithm help

Do the same thing you always do; that is, don't do anything because it's a W40k mod and they never get finished?

Author:  Miles_T3hR4t [ Sat May 16, 2009 2:17 am ]
Post subject:  Re: Interception algorithm help

Grif wrote:
Do the same thing you always do; that is, don't do anything because it's a W40k mod and they never get finished?


Ivan made space marines, Ork Gothic made orks, someone else (forgot there name) made guard.

And guess what, the tau mod is almost releaseable, We just have some minor balance issue, the problem is they get released and people like you go "oh, warhammer 40K, it will suck by default" and you never even open the thread because of some random bias, and then you forget that it ever existed.


The tau mod we're working on has : 2 working actors that just need new sprites, 6 guns, and 1 grenade, as is, all of which work, we're mostly just balancing it to get it 100% perfect, updating to B23 if needed (gibs and material names, I don't know the gibs off hand, I know mine are fine).

This mod will be released soon, and it will be awesome. Guess what I made? A wide-beam laser that isn't a huge muzzle-flash, or TDEs with invisible explosions. and guess what, It works, doesn't use lua, and works on doors and stuff. you know, something that's never been done before.




But lets stay on topic.

Since you have working code, could you teach me how to do it, or possibly join our WH40K Tau thread and help with the seeker missiles? actually we need to either learn lua, or get someone who knows lua for the pulse carbine, so we can have alternate fire types that isn't done as tracer rounds. (which was promised in a prior dev log)

Page 1 of 1 All times are UTC [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/