Hard Light Productions Forums

Modding, Mission Design, and Coding => The Modding Workshop => Topic started by: SF-Junky on March 13, 2012, 04:47:42 am

Title: How to make dogfights last longer
Post by: SF-Junky on March 13, 2012, 04:47:42 am
In FreeSpace most dogfights usually don't take longer than a few seconds unless the enemy moves in wave after wave after wave. I'm a bit sick of this as it is not very realstic (please no lectures at this point about how realistic space-sims are ;)) when the players squadron finishes off five times as many hostile craft.

That is why I'm playing around with the bp2 ai a little bit. I want the AI to be very evasive and very competent with its shield manegement but not very accurate in its weapon handling.

What do you think? Stupid idea? Good idea? Any tips? :)
Title: Re: How to make dogfights last longer
Post by: MatthTheGeek on March 13, 2012, 05:22:37 am
Obligatory "no realism in mah FS".

K done. Moving on.
Title: Re: How to make dogfights last longer
Post by: Nuke on March 13, 2012, 05:39:04 am
i actually think the best way to prolong dogfights is to cripple guided weapons. make locks take longer, reduce missile maneuverability, reduce missile count, disallow or limit the availability support ships, etc. secondly, for primary weapons, cripple the accuracy of weapons at the top end of the dps scale, for example using $fof: or reducing weapon velocity. third thing you want to do is make ships faster and more nimble. if you want to take things a bit further you can do all kinds of cool things with armor and subsystems. for example give the ships hull a really resilient armor type, and use standard armor on subsystems, and lots of extra subsystems. this will reward accurate shooting, and require the shooter to take calculating shots against subsystems, instead of just shooting the hull. as the subsystems get shot off, they will take some percentage of the hull with em. to prevent crippling shots, like against engines or weapons, harden those subsystems.

make weapons damage so ridiculously complex that players have a hard time figuring out which weapons give an advantage and which ones are total crap for a particular situation. **** with their heads, make the standard issue weapon really effective in certain situations, where the advanced weapons have trouble. lots of damage types, lots of armor types, sweet spots and penalties. if you 20 of a fighter that a particular weapon is good at taking out, then throw in an ace that has armor that is really effective against that weapon.

not sure what you can do with ai these days though, might be possible to give them survival instincts up the wazoo. so il leave that one open. i usually tend to prefer to make ships easier to kill so that the player has to have good situational awareness to survive. you can kill that ship in front of you, but what about the one to port and the two behind you?
Title: Re: How to make dogfights last longer
Post by: headdie on March 13, 2012, 06:51:36 am
There are options in the AI and AI_profiles tables that help make the AI act more intelligently, Fury AI is a good example of this.

Like Nuke said you can nerf weapon damage either:
directly through damage amounts
 - Armour table
 - Rate of fire - this has two effects, one it changes the damage per second, also it gives the AI more time to react to being hit.
 - $Armor Factor:/$Shield Factor:/$Subsystem Factor: - specialise your more powerful weapons
 - $FoF: and weapon speed can be useful to effect accuracy, again weapon speed gives the AI more time to react when hit
 - With secondary weapons you can make unguided weapons more powerful than guided and/or make guided weapons massive in terms of cappacity

You can also apply ammo counts to your more powerful primary weapons

Weapon lifetime can be useful as well, shorter weapon lifetimes force close quarters fighting which penalises slow rates of fire while longer lifetimes penalises slower weapon speeds

When you design missions be careful how many of the power weapons you let the player(wings) have, you don't have to give the player(s) enough Kaysers to outfit the entire wing

If your storyline supports it you can table in ship hull regeneration

Use Sexps to brake things occasionally for the player, for example if your mod has powerful missiles then disallow guided missiles in mission if an AWACs jumps in or something (I am sure this is possible at any rate) to represent aspect lock jamming.
Title: Re: How to make dogfights last longer
Post by: General Battuta on March 13, 2012, 07:27:40 am
I don't think I agree with Nuke. When we were wrapping up the Fury AI for BP2 we realized that guided weapons had become nearly useless just because the AI was so much better - no tableside alterations required.
Title: Re: How to make dogfights last longer
Post by: Fury on March 13, 2012, 07:52:37 am
guided weapons had become nearly useless just because the AI was so much better - no tableside alterations required.
That's only because of backwards compatibility with AoA and of course FS2. If that hadn't been an issue, there was a lot that could have been done to improve guided missiles.
Title: Re: How to make dogfights last longer
Post by: Dragon on March 13, 2012, 09:16:24 am
Indeed. Fury's AI+improved missiles=realistic, hard dogfights. Also, play on Insane. It removes all buffs to the player, making combat much more tactical, and more difficult.
Title: Re: How to make dogfights last longer
Post by: SF-Junky on March 13, 2012, 09:17:58 am
To be honest I don't really like the approach of improving armor respectively reducing damage as I don't like the idea of a small fighter taking dozens of hits. I'll try to stick with AI and AI_profile. Let's see what I can do. :)
Title: Re: How to make dogfights last longer
Post by: General Battuta on March 13, 2012, 09:19:20 am
To be honest I don't really like the approach of improving armor respectively reducing damage as I don't like the idea of a small fighter taking dozens of hits. I'll try to stick with AI and AI_profile. Let's see what I can do. :)

You are pretty wise; we found that as AI quality increases, speed and maneuverability becomes way more important than shield and armor strength in AI vs AI fights.
Title: Re: How to make dogfights last longer
Post by: SF-Junky on March 13, 2012, 10:52:04 am
Uhm, can anyone explain me what $AI In Range Time: is after all? I don't understand the wiki description. What does that:
Quote
Defines the seconds added to the time it takes for an enemy to come in range of (i.e. target) a friendly ship
mean in English?
Title: Re: How to make dogfights last longer
Post by: General Battuta on March 13, 2012, 10:53:35 am
Pretty simple, I think. Say you have a gun with range 700m.

If your ship has $AI In Range Time: 0, when it comes within 700m of an enemy, it starts firing.

If your ship has $AI In Range Time: 1, when it comes within 700m of enemy, it waits a second to start firing.

(This might not be weapon-specific, idk)
Title: Re: How to make dogfights last longer
Post by: SF-Junky on March 13, 2012, 11:01:25 am
Hm, kay, that makes sense, after all.
Title: Re: How to make dogfights last longer
Post by: TopAce on March 13, 2012, 11:11:18 am
Edited the Wiki description.

Quote
The delay (in seconds) for the AI to fire its weapons after getting in range.

Is this wording better?
Title: Re: How to make dogfights last longer
Post by: SF-Junky on March 13, 2012, 11:21:17 am
Much better. *thumbsup*

So, if the value is smaller than 0 it means the AI fires its weapons before actually coming within range, yes?
Title: Re: How to make dogfights last longer
Post by: Fury on March 13, 2012, 11:53:02 am
Actually, IIRC that controls how quickly AI gains max accuracy of their primaries. -1 means instantly, 0 means two seconds and anything higher than 0 adds to the two seconds.

So if you have a value of 2.5, AI would gain max accuracy of its primaries in 4.5 seconds of target coming into range. Until then, accuracy slowly climbs and maxes out at 4.5 seconds. Unfortunately I do not know what is starting accuracy.
Title: Re: How to make dogfights last longer
Post by: Nuke on March 13, 2012, 01:58:25 pm
I don't think I agree with Nuke. When we were wrapping up the Fury AI for BP2 we realized that guided weapons had become nearly useless just because the AI was so much better - no tableside alterations required.

generally it has been my impression that missile kills were kinda cheap, and i kinda feel that expert gunnery should trump missiles every time. missiles should be good enough to get by on, however it should not be what the pros use. of course if you can reduce the effectiveness of missiles by improving ai then that achieves the same goal as crippling the missiles.
Title: Re: How to make dogfights last longer
Post by: KyadCK on March 14, 2012, 01:46:10 am
Make the AI run away when under heavy fire.

Thats it.

One of the single biggest pains in the ass in BPmulti is trying to chase down a Kent or Atalanta that doesn't want to be hit and is actively focused on getting away. Eventually the strategy was formed that if you want to kill it, you have to leave it alone for a while, turn your back, and wait for it to come to you. The fact that most AI attempt to out turn you and attack you instead of getting away is one of the reasosn fights are so quick.


I kinda feel that expert gunnery should trump missiles every time. missiles should be good enough to get by on, however it should not be what the pros use. of course if you can reduce the effectiveness of missiles by improving ai then that achieves the same goal as crippling the missiles.

You pretty much described any PvP match in multi. Any good human pilot can dodge hornets all day long while they close in to kill with primaries and dumbfire.
Title: Re: How to make dogfights last longer
Post by: Commander Zane on March 14, 2012, 07:38:30 am
Any pilot can dodge Hornets. :P
Title: Re: How to make dogfights last longer
Post by: SF-Junky on March 14, 2012, 12:49:29 pm
Make the AI run away when under heavy fire.

Thats it.

One of the single biggest pains in the ass in BPmulti is trying to chase down a Kent or Atalanta that doesn't want to be hit and is actively focused on getting away. Eventually the strategy was formed that if you want to kill it, you have to leave it alone for a while, turn your back, and wait for it to come to you. The fact that most AI attempt to out turn you and attack you instead of getting away is one of the reasosn fights are so quick.
That would mean: Low courage, high get away chance.

Ironically, the most cowardly enemy is the one which is most difficult to kill...
Title: Re: How to make dogfights last longer
Post by: Nuke on March 14, 2012, 01:17:06 pm
i wouldn't call it cowardice to not want to give alpha 1 free kills. besides survival is half the battle.
Title: Re: How to make dogfights last longer
Post by: qwadtep on March 14, 2012, 01:37:40 pm
Make the AI run away when under heavy fire.

Thats it.

One of the single biggest pains in the ass in BPmulti is trying to chase down a Kent or Atalanta that doesn't want to be hit and is actively focused on getting away. Eventually the strategy was formed that if you want to kill it, you have to leave it alone for a while, turn your back, and wait for it to come to you. The fact that most AI attempt to out turn you and attack you instead of getting away is one of the reasosn fights are so quick.
That would mean: Low courage, high get away chance.

Ironically, the most cowardly enemy is the one which is most difficult to kill...
And then you realize you're 2km away from the ship you're escorting and a bomber wing just jumped in on the other side. Clever bastards.
Title: Re: How to make dogfights last longer
Post by: Nuke on March 14, 2012, 02:44:05 pm
when you consider that a fighter that is chasing another fighter is no threat to your warships or bombers, then its a damn valid and effective tactic. it was one employed a lot by sf dragons in fs1, iirc.
Title: Re: How to make dogfights last longer
Post by: BengalTiger on March 17, 2012, 07:00:45 am
Create AI profiles not only for broad definitions of the ships they pilot (fighter, bomber, cruiser, etc.), but make variations for each type.

Interceptors should use burners to get away from enemy fire as often as possible- a Loki needs to move around a lot to survive.
A heavy fighter like an Erynies may be more successful trying to shoot the enemy down in the first pass before the engagement changes into a turning fight, even though this requires getting hit a few times.
Light bombers should disengage their capship target and assist their escorts in dealing with enemy fighters, but an Ursa might be better off launching its bombs under heavy fire first- it won't succeed in any form of dogfighting, unless the enemy is a cruiser.

Have fun in the next couple weeks, staging dogfights in FRED and watching the AI duke it out to fine tune the settings...  :p
Adding and balancing new species is even more work if each one has a different ship building philosophy (and sometimes technological level)...
Title: Re: How to make dogfights last longer
Post by: Fury on March 17, 2012, 09:22:50 am
AI profiles are on per mission basis, you cannot have multiple AI profiles in any one mission. AI classes on the other hand can be used in significant numbers, but IIRC there was a limit in number of AI classes as well. Doing AI classes for different ship types is doomed in insanity because number of AI classes grows so large it'll be next to impossible to maintain.

Creating 5 AI classes for light, medium and heavy fighters and bombers would already grow to 30 AI classes, plus 5 for capships. That's just stupid.
Title: Re: How to make dogfights last longer
Post by: BengalTiger on March 17, 2012, 11:18:56 am
AI profiles are on per mission basis, you cannot have multiple AI profiles in any one mission.

I was thinking of AI class, sorry.

Also, from ai.tbl:
; We have a virtually unlimited number of AI classes.  If you add a new AI class and
; you get an execution error about too many classes, increase MAX_AI_CLASSES, defined
; in ai.h.  On Jan. 30, 1997, MAX_AI_CLASSES = 50.

Gives enough room for the 35 required, and creating them will take just a few minutes. More time would be required to tune the values, but this is optional...

More in a few hours when I get this stuff done, I'll post a report on how custom AI for each ship class works and how it compares to the stock classes.
Title: Re: How to make dogfights last longer
Post by: Fury on March 17, 2012, 12:31:45 pm
More in a few hours when I get this stuff done, I'll post a report on how custom AI for each ship class works and how it compares to the stock classes.
:lol:
Title: Re: How to make dogfights last longer
Post by: BengalTiger on March 17, 2012, 02:34:25 pm
So after getting light fighters working and tested...

There is no significant difference between stock AI and fighters with higher evasion and really high or really low courage. While the pimped fighters did maneuver a bit more, it didn't have any effect on the outcome of dogfights after having 6-8 battles of AI vs AI fighters.

All tests were performed with GTF Ulysses fighters on both sides, stock weapons, at first 6 vs 6 and 5 waves for each team; then 12 vs 12 and 5 waves for each team, difficulty on insane and with a slightly modified ai_profiles from BP 2. The AI class used as the 'stock AI' was captain.

What may be significant is the accuracy setting and boostsing afterburner use during defensive maneuvers (once I figure out how...), but that's for another time...
Title: Re: How to make dogfights last longer
Post by: BengalTiger on March 18, 2012, 04:40:28 am
After running a few more tests using stock AI it seems that the enemy team gets some hidden bonuses on insane, even though I use
$Autoscale by AI Class Index:    NO
and the same accuracy for both AI classes (captain and general) the AI running the enemy team scored 3:0 victories no matter what the pilot skill was set to.

I ran another test, like the one yesterday with one side having custom AI and the other one stock, both with the same accuracy. This time the custom AI was running the hostile team...

They wiped the floor with the friendlies.
Therefore the fact they were able to draw when on friendly side means that custom class is far superior and the stock class was holding it's own when hostile thanks to some hidden bonuses.

Where are the parameters for giving friendlies/enemies nerfs/bonuses so I could shut them off to make designing the other AI classes easier?
Title: Re: How to make dogfights last longer
Post by: yomi on March 18, 2012, 06:23:15 am
only
$Friendly AI Fire Delay Scale
and
$Hostile AI Fire Delay Scale
comes to my mind. But its default favoring friendlies, and its Even on insanity, and on most difficulties in BP2
Title: Re: How to make dogfights last longer
Post by: Commander Zane on March 18, 2012, 07:14:04 am
I could be wrong, but with BP AI in particular the rates are 1.0 for both sides on Medium and up.
Title: Re: How to make dogfights last longer
Post by: BengalTiger on March 18, 2012, 10:50:27 am
That is correct, which makes the results even more mysterious, because getting a 4:3 when custom AI controlled the friendlies and 3:0 when it controlled the hostiles is rather strange...

Now after more testing:

Neutral vs hostile- custom AI wins 3:0 when neutral and 3:0 when hostile, so guess this is the way I'll be testing from now on.

Friendlies vs neutral was pretty much like friendlies vs hostiles, with more/less equal results when custom AI flew friendly and custom AI victory when it flew neutral..

It seems that friendlies could be weaker for some reason...
Either that or I just consistently got improbable results and in an infinite sample custom AI would win when flying friendlies just as often as when flying others.
Title: Re: How to make dogfights last longer
Post by: General Battuta on March 18, 2012, 10:57:10 am
You know, I've had one player complaining that friendly AI has turned really ****ty since 3.6.12. Assuming that you've got a 3.6.14 build right now, could you maybe test again under 3.6.12 and see if things are any different?
Title: Re: How to make dogfights last longer
Post by: Cyborg17 on March 18, 2012, 11:33:16 am
That would explain a lot.
Title: Re: How to make dogfights last longer
Post by: Fury on March 18, 2012, 11:36:20 am
Also, you do realize that there is no such thing as "stock AI" when you use custom AI profile? If you use custom AI classes, then you also have to use custom AI profile to get get full advantage from AI improvements. But doing so also alters retail AI classes to a point where they are no longer retail AI classes at all.

Which effectively means that it is IMPOSSIBLE to test custom AI vs. retail/stock AI in any one mission. All you can do, is compare how well AI performs but comparison must be done separately. Setting up a dogfight mission does not tell you anything because retail AI classes will then use default values from AI profiles where appropriate. Sure they lack some AI flags, but that does not mean they perform worse, actually in might just be on the contrary as "better" is very much subjective.
Title: Re: How to make dogfights last longer
Post by: BengalTiger on March 18, 2012, 01:11:49 pm
Well the point is to check how changing courage, and other parameters (except accuracy) influences the performance of AI pilots.

The AI profile is custom, but the AI class on one side (Captain) is unchanged compared to FS 2, which I call "stock". It challenges an edited Light Fighter Captain AI class, which I call the "custom" class.
These could be directly tested against each other, as the profile is the same for both and doesn't give any side any advantages or disadvantages.

I could kick out the ai_profiles.tbl and use only the characteristics found in ai.tbl, but I have a feeling the original profile will fade away pretty soon and only custom ones will be in use.