Home   Help Search Login Register  

Author Topic: Advanced Airstrike  (Read 1000 times)

0 Members and 1 Guest are viewing this topic.

Homefry31464

  • Guest
Advanced Airstrike
« on: 22 Jan 2005, 00:25:02 »
We all know how bad the AI is at flying planes, I've experienced it lots of times.  But, I think I may have come up with an idea to solve that.

Instead of making the AI find the best time to drop a bomb, how about we just let the AI worry about flying the plane and a script handle all the weapon stuff.  From what I can tell, it's an easy system, I just need help getting it into script form.  So, let's see if we can figure some of this physics stuff (its been a while) and see if we can't get a script working.

Here is how it would work.

#1.  A target would be specified, either being called directly by the mission maker or perhaps via a trigger, all that matters is that there is a set target.

#2.  An AI plane would be airborne, set on careless, and once the target has been specified a move waypoint would be set over the target.  

#3.  The script would run, and would compute a firing solution.  The solution would have to include speed, aircraft height, direction in relation to the target, and distance to target.

#4.  This part needs to be discussed.  Either a bomb would be camcreated underneath the aircraft, or a fire command would be given to the aircraft.  Personally, I think the first option would be easier.

-----------------------------------------------------------------------------------------

Advantages:
*We avoid the problem of aircraft not attacking men, because the script would not worry about the class of the target, just it's position.
*The script can cheat, well kind of.  The plane doesn't have to be facing the target exactly, it can be slightly offset and the player would never know.
*The AI won't worry about targeting, so they can worry about staying airborne.

Alright guys, I need some help.  I've got most of the calculations down (or so I think), so I just need some help getting this into script form.

Math: (This is mainly just me thinking out loud, getting my thoughts out)

*Airtime    = sqrt(2*distance)/9.8
*Distance  = airtime * aircraftvelocity


« Last Edit: 22 Jan 2005, 01:34:22 by Homefry »

Offline penguinman

  • Contributing Member
  • **
  • Money is worthless, just paper, ink, and threads
Re:Advanced Airstrike
« Reply #1 on: 26 Jan 2005, 00:47:30 »
sounds good but what exactly do u want planes to do. or not to do

are they crashing to much on there bomb runs, happens to me to,

just give the plane a flyinheight from about 150-300(whichever u want) and setview distance 2000.  that makes it look real neat and the planes dont crash. and planes that are suposed to be flying high arnt flying 200 feet off the ground.

if you want them to attack infantry use a setpos loop with an invisible target.
« Last Edit: 26 Jan 2005, 00:49:13 by penguinman »

Unnamed

  • Guest
Re:Advanced Airstrike
« Reply #2 on: 26 Jan 2005, 01:43:14 »
Quote
are they crashing to much on there bomb runs, happens to me to,

If you run it from a script you can compensate for the terrain around your given targets position. But I've seen what looks like a comprehensive mathematical solution to this in the scripts section at the editors depot. I never got to try it out, and now I cant remember which one it was. I'll try and wade through them again.

But yeah, if you can get close enough to a given map position with a dumb bomb that would be great. Probably other weapons systems that would benefit to.

Edit:

I found it again, quick enough:

http://www.ofpec.com/editors/resource_view.php?id=200
« Last Edit: 26 Jan 2005, 01:49:18 by Unnamed »

Offline penguinman

  • Contributing Member
  • **
  • Money is worthless, just paper, ink, and threads
Re:Advanced Airstrike
« Reply #3 on: 27 Jan 2005, 07:00:09 »
that only works for humans, i think he wants his thing with AI

Unnamed

  • Guest
Re:Advanced Airstrike
« Reply #4 on: 27 Jan 2005, 13:25:27 »
Yeah, but the maths is still the same. The way it's been setup in the example mission, it's hard to see how accurate it is.  So you would have to change the scripts for the AI, just to test it.

Your talking about a loop that calculates a hit point, then a quick check on how far the target and the hit point are from each other. When there close enough, just call the Fire command for the bombs. Not much extra scripting there.

I would not worry about lining up for the target just yet, a single waypoint would do for testing.

Offline penguinman

  • Contributing Member
  • **
  • Money is worthless, just paper, ink, and threads
Re:Advanced Airstrike
« Reply #5 on: 31 Jan 2005, 07:20:55 »
ya see what u mean

Offline Morglor9

  • Members
  • *
Re:Advanced Airstrike
« Reply #6 on: 27 Mar 2005, 08:33:10 »
this isn't what u want, but it does the same thing. usually u can't see the bombs in an airstrike. so, i simply have the plane fly over, wait a second, then camcreate the ordnance I want on the target, using triggerhappy's multiple explosion script. this system works pretty good.
Cymbaline

UNN

  • Guest
Re:Advanced Airstrike
« Reply #7 on: 27 Mar 2005, 16:01:33 »
Getting the AI to work out when to fire could be considered overkill. As you say, you can simulate the whole process without the overheads of an AI targetting loop running in the background.

I guess I just like the idea of self contained AI. It was the same with my mortars, it would be easier to simulate a mortar barrage rather than going to all the trouble to work out elevations and range e.t.c

When I get the chance I will start messing around with the script to see if it can be used, assuming nobody else is doing it? If it does, I think it could be used for all kinds of weapon systems that OFP currently does not support.