Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Author
Message
Rick123
19
Years of Service
User Offline
Joined: 26th May 2005
Location:
Posted: 5th Oct 2007 03:22 Edited at: 5th Oct 2007 03:23
Is there any way to code a missile model using Dark AI to follow and hit an enemy?

For Example - I would click the mouse to fire a missile. Then the missile would twist and turn to hit the enemy.

Thanks!
Agent Dink
20
Years of Service
User Offline
Joined: 30th Mar 2004
Location:
Posted: 5th Oct 2007 17:29
I'm sure it's possible, but I couldn't tell you how to do it. However, you can already do this pretty easily without physX commands.

Rick123
19
Years of Service
User Offline
Joined: 26th May 2005
Location:
Posted: 5th Oct 2007 19:33
I was talking about Dark AI, not physicsX commands.
Red Ocktober
20
Years of Service
User Offline
Joined: 6th Dec 2003
Location:
Posted: 5th Oct 2007 20:13 Edited at: 5th Oct 2007 20:14
still... maybe dark ai might be a lil bit of overkill for your needs on this one...

i mean, consider the following... if a missile is able to constantly "look" at an object (using point object command), then, it will automatically home in on what it is looking at if it has a force thrusting it forward (move object command)...

why complicate things unnecessarily...

--Mike
Rick123
19
Years of Service
User Offline
Joined: 26th May 2005
Location:
Posted: 5th Oct 2007 23:19
Ok. I will try that out. Thanks Agent Dink and Red Ocktober.
Agent Dink
20
Years of Service
User Offline
Joined: 30th Mar 2004
Location:
Posted: 9th Oct 2007 01:04
Sorry, misread your post, but I agree with Red, Dark AI is mad overkill for a homing missile, hehe.

Lucy
17
Years of Service
User Offline
Joined: 19th Apr 2007
Location: Roanoke, VA USA
Posted: 12th Oct 2007 13:06
Using DarkAI for a homing missile would likely result in the missile navigating corridors in order to smack into the enemy.

Imagine firing a missile into the entrance of a maze and then following it as it winds through the corridors of the maze as it takes the shortest route to the enemy...

do{;}while(1);
Agent Dink
20
Years of Service
User Offline
Joined: 30th Mar 2004
Location:
Posted: 12th Oct 2007 15:32
That does actually sound really cool, Lucy, lol.

JerBil
20
Years of Service
User Offline
Joined: 8th May 2004
Location: Somewhere along the Z axis...
Posted: 13th Oct 2007 05:00
I'm using point for a homing missile, and one thing I found is that
if you are not facing your target when fired you won't see it leave.
Obvious since it will point at the target no matter which direction you happen to be facing.
I'm thinking of having the missile come from a corner of the map, instead, as in an air strike.

Ad Astra Per Asper
Red Ocktober
20
Years of Service
User Offline
Joined: 6th Dec 2003
Location:
Posted: 14th Oct 2007 15:14 Edited at: 14th Oct 2007 15:15
well... that seems like it's working the way you might expect it to work in the real world... for example, a heat seeking missile won't home in on a target that the seeker head can't see... and if you're pointing away from the intended target, then you obviously can't see it... and neither can the seeker head...

therefore...

i would put something in the logic to make sure that the missile doesn't track unless the target is in view... if it can't see it then it just flies off on it's own...

a lil lock on type logic would fit in nice hear... you manuever a box around (on a HUD) until it is in proximity of the target... then it starts giving a locked on tone... then, and only then will the homing missile be able to track the target...

starting to get a lil invilved... isn't it

but if you think out the logic step by step, it'll make sense, and be easy to code...

--Mike
demons breath
20
Years of Service
User Offline
Joined: 4th Oct 2003
Location: Surrey, UK
Posted: 14th Oct 2007 16:57
or put on a timer, for which it travels forwards in the direction you're facing, then after however long it starts to turn towards the nearest enemy.

http://jamesmason01.googlepages.com/index.htm
Agent Dink
20
Years of Service
User Offline
Joined: 30th Mar 2004
Location:
Posted: 14th Oct 2007 17:11
You could have a dummy object use Point Object, and slowly have the missile rotate to have the same angle that the dummy object has. This way it won't just jerk and face the enemy. It will slowly rotate towards him.

JerBil
20
Years of Service
User Offline
Joined: 8th May 2004
Location: Somewhere along the Z axis...
Posted: 15th Oct 2007 08:06 Edited at: 15th Oct 2007 08:07
Red Ocktober: I do have a frame for target selecting, and thats a good idea for not selecting if not in view.

demons breath: I tried a timer, and the missile takes a nice right turn in mid flight. Good idea though.

Agent Dink, yours is also a good idea, and I like the thing turning more slowly.

Its kinda cool to see the missile tracking a moving object after firing, btw.
Thanks, guys.

Ad Astra Per Asper
Agent Dink
20
Years of Service
User Offline
Joined: 30th Mar 2004
Location:
Posted: 15th Oct 2007 23:19
Quote: "Agent Dink, yours is also a good idea, and I like the thing turning more slowly."


Yeah, and using this method, it makes it harder for the missile to strike it's target, potentially over shooting it if the enemy maneuvers correctly which will add some cool evasive action type stuff. Same if they get a missile lock on you. You might have a chance to dodge, it's not a guaranteed hit then.

thebulk71
18
Years of Service
User Offline
Joined: 2nd Jan 2006
Location: takin a poop
Posted: 17th Oct 2007 00:09 Edited at: 17th Oct 2007 00:10
Why not try something simple... and have the missile find the angle towards its target and SLOWLY turn towards it using curveangle().

Then it'll shoot fine and glide nicely to it's target. if it's moving slowly then it'll have great chances of hitting it's target, the faster it goes the higher the chances of it missing and crashing.

try this code for example


Hope this helps, i have not tested this code but it should work.
JerBil
20
Years of Service
User Offline
Joined: 8th May 2004
Location: Somewhere along the Z axis...
Posted: 18th Oct 2007 03:22 Edited at: 18th Oct 2007 03:55
thebulk71,
I was able to drop your code right in to my missile movement code, and it worked first time.
Thanks!

edit: Sometimes, the missile just orbits the target, although it will
eventually hit it.

Ad Astra Per Asper

Login to post a reply

Server time is: 2024-09-08 00:55:29
Your offset time is: 2024-09-08 00:55:29