Hard Light Productions Forums

Modding, Mission Design, and Coding => The FRED Workshop => Topic started by: killface on April 22, 2007, 03:42:38 pm

Title: AI and fighter speed
Post by: killface on April 22, 2007, 03:42:38 pm
Playing BTRL, I got curious about the speed of fighters in Freespace2.  So I jacked up the perseus max speed to 475 m/s (500 m/s with afterburners), which is closer to real-world fighter jet speeds.  I noticed two things immediately:  1. Trying to hit a similarly-enhanced enemy fighter at those speeds - even with proportionally jacked up lasers - is ludicrously tedious.  2.  The game's AI seemed to crap out, perhaps unable to handle the speed.  Neither my 7 wingmen nor my 8 similarly-enhanced opponents ever landed a hit on each other, even set on "General" AI.  They ended up shooting about a mile behind each other every time, while I did all the killing myself.

I'm just curious if anyone else had ever noticed this, and if there is some sort of functional speed cap for fighters, above which the AI has difficulty maintaining the mechanics of dogfights.

EDIT: The issue seemed to be with the $FOF flag in the weapons table.  Once I removed it (it was set to a measly 0.1), the AI pilots did much better in shooting each other down at speeds of 400+.
Title: Re: AI and fighter speed
Post by: Vretsu on April 22, 2007, 07:40:33 pm
Nice. Newtonian physics could be implemented in that fashion...almost...well, sans actual newtonian physics calculations. You know what I'm saying. It would go something like this...

*fly at Shivans at 10,000 miles/s*

YAAAHH!!

*fire a couple shots, shoot past the Shivans, go a few miles, turn around*

YAAAHH!!

*shoot past Shivans, fly 500 miles off, turn around for another pass*

YAAAAHHH YOU BASTARDS!!

*fires a couple rounds, overshoots by 500 miles, turns around for another pass*
Title: Re: AI and fighter speed
Post by: killface on April 22, 2007, 08:08:26 pm

 :lol:  Yeah, that'd be a great time.  I do love messing with the FS2 fighter capabilities, but there's a definitely a point of diminishing returns (AKA, the moment when I start thinking, "You know, Top Gun was complete B.S.").
Title: Re: AI and fighter speed
Post by: jr2 on April 22, 2007, 09:46:24 pm
Did you adjust the weapons speed?  Some of them would need a bump... cannon fire IIRC can reach ~Mach 3, missiles ~Mach 2 - 6.  ;7
Title: Re: AI and fighter speed
Post by: killface on April 22, 2007, 10:26:43 pm

Yeah, I bumped up the laser speed to around 2500 m/s.  I had 5000 m/s on the Subach for a while, with a fire delay of 0.01 seconds...but that was beyond insane.  You could barely even SEE the lasers before they were out of range! 

I thought if I increased the weapons speed proportionally with the flight speed, everything would be ok.  But the problem is manuevering.  If a fighter going that fast jukes you, and you lose track of him for just a second...the next thing you know he's 3000 meters away and gaining distance fast.  Protecting a cap ship in this scenario is a nightmare.  And if it sounds like I'm squeezing every ounce of fun out of the gameplay...I know I am!  Just seeing what it's like to play at Earth-based speeds, that's all.
Title: Re: AI and fighter speed
Post by: takashi on April 22, 2007, 10:48:27 pm
now wheres your dreams of flying a myr, fanboys!?

*takes a bit of burrito*

HUH? HUH?

anyway, UT balanced BTRL tables to make hitting at high speeds possible. ask him. and edit firepoint normals to converge at a certain distance based on tables.
Title: Re: AI and fighter speed
Post by: jr2 on April 22, 2007, 11:14:15 pm
Hmm, you know, most dogfighting occurs at about 400 mph, IIRC
Quote from: http://www.onlineconversion.com/speed_common.htm
400 mile/hour (mph) = 178.816 meter/second
Title: Re: AI and fighter speed
Post by: killface on April 22, 2007, 11:42:29 pm


I think you're right, but the maximum speed of a jet like the F-16 is well over 1200 miles an hour (>536 m/s, based on that converting site).  If I could have the fighters move that fast when going from place to place, and slow down just for the dogfighting...that would be an easy but banal fix.  Actually, they do slow down a tad, jockeying around each other at about 350-400.  That's still insanely quick movement and lots of swearing at the screen.  I guess I now know why dogfighting is a thing of the past...it's just so much easier with missiles, missiles, missiles!
Title: Re: AI and fighter speed
Post by: jr2 on April 23, 2007, 01:24:44 am
Nah, they tried that with the F-4... and they ended up having to retrofit a cannon to it for close-range dogfights.  Missiles just allow you a chance to begin the game early, and hope the other pilot can't counter / evade the missile.  At those speeds, the distance closes quick... and when you want to maneuver, you have to slow down.  Actually, maneuvering itself slows you down.  The optimal speed for dogfighting still is ~180 m/sec, because then you can turn faster.  BTW, what's the max speed of an F-14/15/16/18 without afterburners?  Ask yourself this: If your afterburner uses so much fuel that you run out in 20 minutes, how often will you use it?  What will you use it for?  You won't use it that often, except in short bursts, for added speed / assisting during maneuvers.  The F-22 is unique in that it has supercruise (http://www.milnet.com/ftr4tab.htm), which means that it can travel faster than the speed of sound (Mach 1.5) without using its afterburners, thus saving fuel.  (Max speed they will now confess to is IIRC Mach 2.4... give me a break ;7 )

So, the solution to your problem is to make the afterburners have enough fuel to run for about 10-20 minutes to make it playable, put 2-5 minutes, with 0 recharge rate, a max norm speed (http://www.aero-web.org/specs/mcdodoug/f-15e.htm) of
Quote from: http://www.onlineconversion.com/speed_common.htm
570 mile/hour (mph) = 254.812 8 meter/second
and an AB speed of
Quote from: http://www.onlineconversion.com/speed_common.htm
2.5 mach = 850.725 meter/second
... of course, the AI doesn't know how to handle that... but for multi, that would work.
Title: Re: AI and fighter speed
Post by: killface on April 23, 2007, 09:55:03 am

Now that's an interesting concept...thinking of the afterburner as more of a long-distance cruise drive than anything else.  But yeah, no reason the AI wouldn't take advantage of that during combat.  I'll try it out when I get home just for ****s and giggles.  I don't suppose FRED2 has a "break-afterburner" function I haven't found yet  :p

But I stand by my statement that Top Gun is crap, if only because of Tom Cruise's presence.  He has destroyed his past...from the future!  Such is the time-traveling power of manic behavior...
Title: Re: AI and fighter speed
Post by: Wobble73 on April 23, 2007, 10:06:16 am

Now that's an interesting concept...thinking of the afterburner as more of a long-distance cruise drive than anything else.  But yeah, no reason the AI wouldn't take advantage of that during combat.  I'll try it out when I get home just for ****s and giggles.  I don't suppose FRED2 has a "break-afterburner" function I haven't found yet  :p

But I stand by my statement that Top Gun is crap, if only because of Tom Cruise's presence.  He has destroyed his past...from the future!  Such is the time-traveling power of manic behavior...

Not only that....................Top Gun was so GAY! Honestly, I've known even a few gay friends to cringe at the volleyball scene!
Title: Re: AI and fighter speed
Post by: karajorma on April 23, 2007, 12:54:20 pm
I don't suppose FRED2 has a "break-afterburner" function I haven't found yet  :p

Nope. But I might add one in the near future.
Title: Re: AI and fighter speed
Post by: jr2 on April 23, 2007, 03:58:35 pm
Make sure that you can use in-flight refueling (ie, support ship) to get it back.  ;)
Title: Re: AI and fighter speed
Post by: Rand al Thor on April 24, 2007, 09:43:54 pm
Ah the Volley ball scene.

'Hey Guys! Lets get these pesky tops off! YEAH!'

....

'Eh, not you Goose. No, not you. You have to be BUFF for that.'

Poor, poor Dr. Green.
Title: Re: AI and fighter speed
Post by: killface on April 24, 2007, 10:29:24 pm


Love, LOVE the handle, Rand.  It's probably been five years since I've seen a proper shoutout to Robert Jordan.
Title: Re: AI and fighter speed
Post by: THE Phreak on April 25, 2007, 03:50:41 am
Meh, I set the Perseus' to 180 meters per second and it does it for me. Too bad the Basilisks are still too slow.
Title: Re: AI and fighter speed
Post by: jr2 on April 25, 2007, 09:32:05 am
I don't suppose FRED2 has a "break-afterburner" function I haven't found yet  :p

Nope. But I might add one in the near future.

Wait a minute... what's wrong with a recharge rate of 0?  Then all you'd have to do is make the Support ship able to refuel it...
Title: Re: AI and fighter speed
Post by: karajorma on April 25, 2007, 11:17:41 am
Wanna explain to me how you set the recharge rate to zero in the middle of a mission? :p
Title: Re: AI and fighter speed
Post by: Mobius on April 25, 2007, 02:22:06 pm
Meh, I set the Perseus' to 180 meters per second and it does it for me. Too bad the Basilisks are still too slow.

Well...


You must balance most tables if you want faster combats. Apparently, the release of WCS Prologue and BSG:BtRL Demo made the problem of FS2 physics a top priority.

We're currently working on such a conversion for Steadfast. We're increasing the speed of spacecraft and weapons...
Title: Re: AI and fighter speed
Post by: killface on April 25, 2007, 10:30:57 pm


Yeah, that was the issue I was dealing with.  I did work out a pretty good ratio of fighter speed to weapon speed / rate of fire.  But jesus god, one good bank to the right or left and a fighter moving at 500 m/s leaves me choking on their afterburner dust.  Maybe that's more "realistic", or challenging.  Maybe it makes kills more rewarding.  Or maybe I just suck.  That's actually a good possibility, considering how I didn't start playing FS2 again until I found this site.  But I'm still looking for a way to tinker with the maneuverability aspects of the ships to make high-speed combat a little less...tedious?
Title: Re: AI and fighter speed
Post by: jr2 on April 26, 2007, 01:54:57 am
Wanna explain to me how you set the recharge rate to zero in the middle of a mission? :p

Code in a SEXP that allows altering of table file settings on the fly and on a per-ship basis.  :p  (You can do it, I have faith in you!)  ;)  lol

Seriously, though, I thought the idea was to have all of the AB energy that you have be all you get, unless you re-fuel (re-arm) mid-flight.  (With an increased amount of energy and/or a decreased use rate.)

Also, the AB energy recharge rate is set at 0 when you decrease reactor>engine energy to none (press PgDwn 2-3 times).

And, I think that my first suggestion above, although meant as a joke, would actually be extremely useful, if it was possible to implement.  (Maybe by 3.7.0?)

What do you think, kara?
Title: Re: AI and fighter speed
Post by: Mustang19 on April 26, 2007, 08:01:11 am
BTRL ships typically go at 300ms. I have and old OpenGL and so haven't played it very much (all the ships show up as black shadows), but I did get some useful insights. One, at that kind of speed, you have to actually be worried about asteroid collisions. They will typically do 25% hull damage or so. Two, the AI is totally worthless at that speed. During the training mission my "instructor" said, "hey, watch me attack this drone". I know this wasn't "supposed' to happen, especially in a high-quality campaign like BTRL, but she chased the AI ship around in circles for an eternity. It's just way too fast for the computer at that speed.

I was planning to jack up fighter speeds to a reasonable level, say, 200m/s, for one of my campaigns. The idea is that the player is genetically modified for 10X reaction speeds, so he's actually going at 2,000m/s or .5% the speed of light, a reasonable small fighter speed. Your best bet is to make the primary weapons semi-guided. Anyone played Starlancer where you have limited auto-aiming (sometimes your cannons automatically aim if you get the reticle close to the lead indicator)? That's a good idea for high-speed combat. It makes hitting targets a helluva lot easier.

But remember that real jet dogfights take place at closure speeds in excess of 2000 kilometers per hour, they're just pretty indecisive. Most kills are scored by missiles, with gun kills being rare and considered the mark of an expert. It's doable, just challenging, and it would take away from Freespace's "blast everything" arcade feel.
Title: Re: AI and fighter speed
Post by: Wobble73 on April 26, 2007, 08:18:32 am
and it would take away from Freespace's "blast everything" arcade feel.

BTRL does do that, I may not be that good, but there is a lot of chasing the cylons ships and with limited ammo, you can't just blast away, you have to pick your shot's. Therefore I end up chasing a cylon for about 5 mins just to get a kill!! It's more realistic that way though I suppose!???
Title: Re: AI and fighter speed
Post by: Mustang19 on April 26, 2007, 08:24:59 am
More realistic. But I get the impression that most people prefer hordes of quick kills rather than chasing the enemy for 5 minutes. Am I right? Personally, I'm fine playing either way.