Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: Sushi on April 26, 2009, 11:36:57 am

Title: AI Wishlist: post what you'd like to see here!
Post by: Sushi on April 26, 2009, 11:36:57 am
I'm starting to play around a bit with the AI code, and I wanted to get some ideas on what to try with it. Obviously, there are lots of things that could be done (I have a couple ideas already), but what would you like to see? Post your AI enhancement wishlist here!

The Wishlist So Far
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: The E on April 26, 2009, 11:39:19 am
Bombers that no longer keep ramming their target after firing their bombs.
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: Angelus on April 26, 2009, 11:54:13 am
Two SEXPs, non of 'em actually AI-code related, but still.

is-ai-chased-flip: ( probably a stupid name for it...)
would make the ai fighter flip by 180 deg. to meet the threat behind it, WITHOUT changing the vector or the speed, it would be like glide.

is-ai-chased-turn:
would make the AI make instant sharp turns, by 90 deg to any ( maybe changeable ) direction ( like fly in any direction, hit glide, turn by 90 deg. up, down, left or right and disengage glide again ).

This is already possible using the existing SEXPs, but in the most cases you have to set up waypoints for the AI to follow if you want them to make strafe runs.

The two SEXPs would allow the Glide behaviour without the need for waypoints.
It would make the AI less...predictable in games that actually use glide, like Diaspora, BtRL, TBP and WC Saga.
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: The E on April 26, 2009, 11:57:26 am
Wouldn't that fall under "intelligent use of glide"?
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: karajorma on April 26, 2009, 12:24:33 pm
Neither of those should be done as SEXPs.
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: captain-custard on April 26, 2009, 12:27:12 pm
when you command an ai to do something it does......;.;;
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: General Battuta on April 26, 2009, 12:37:17 pm
Can we have a fire-turret SEXP, Kara? Not technically an AI request, but it'd be sweet. (I hate having to fake things with weapon-create.)
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: Kolgena on April 26, 2009, 12:47:31 pm
Related to the bomber thing:

Fighters or any other small craft change their course slightly if they're colliding with something.

Frequently, fighters flying in formation for a c38 or c35 will simply fly touching side by side, sending up a shower of sparks and debris until you order them to do something else.

Edit:

Oh! Oh! And a waypoint command system (which I imagine would be hard to make). Like, give a sequence of commands to give out. ie: Give a sequence of commands for a wing to kill Arjuna 1-4 by 4v1 piling them, instead of c39 or microing off each Arjuna fighter with c31 after the previous has died.
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: aRaven on April 26, 2009, 12:51:02 pm
ai fighters hugging capital ships to shake pursuers

no more pinpoint accuracy on higher difficult settings

ai fighters breaking from endless turning knife fights

smarter use of afterburners when rushing towards a target
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: karajorma on April 26, 2009, 01:35:19 pm
Can we have a fire-turret SEXP, Kara? Not technically an AI request, but it'd be sweet. (I hate having to fake things with weapon-create.)

If someone (like Wanderer for instance) can tell me which function to call.
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: Sushi on April 26, 2009, 04:26:29 pm
Good ideas. Keep 'em coming. :D

no more pinpoint accuracy on higher difficult settings
smarter use of afterburners when rushing towards a target

These can already be controlled by modifying tables, right?

Oh! Oh! And a waypoint command system (which I imagine would be hard to make). Like, give a sequence of commands to give out. ie: Give a sequence of commands for a wing to kill Arjuna 1-4 by 4v1 piling them, instead of c39 or microing off each Arjuna fighter with c31 after the previous has died.

Hard to make, and probably hard to use. :) That, and it's more of a control-options issue than an AI issue.

is-ai-chased-flip: ( probably a stupid name for it...)
would make the ai fighter flip by 180 deg. to meet the threat behind it, WITHOUT changing the vector or the speed, it would be like glide.

is-ai-chased-turn:
would make the AI make instant sharp turns, by 90 deg to any ( maybe changeable ) direction ( like fly in any direction, hit glide, turn by 90 deg. up, down, left or right and disengage glide again ).

I agree with Kara that these behaviors aren't really right for SEXPs. The first is definitely one I had in mind for "intelligent use of glide." The second might be an interesting behavior too, although I suspect that using it would be a net loss for the AI by making them easier to shoot down.
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: Angelus on April 26, 2009, 04:59:45 pm

is-ai-chased-turn:
would make the AI make instant sharp turns, by 90 deg to any ( maybe changeable ) direction ( like fly in any direction, hit glide, turn by 90 deg. up, down, left or right and disengage glide again ).


I agree with Kara that these behaviors aren't really right for SEXPs. The first is definitely one I had in mind for "intelligent use of glide." The second might be an interesting behavior too, although I suspect that using it would be a net loss for the AI by making them easier to shoot down.

The idea is, that even if the AI would use glide, i wouldn't have total control over it's behaviour in certain situations.
The SEXPs would allow me to control the AI when i need it.

I also thought that adding these two SEXPs would be far easier then rewriting the code, since Karajorma mentioned once that everyone who attempted this, vanished. :P
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: Sushi on April 26, 2009, 05:07:34 pm
I also thought that adding these two SEXPs would be far easier then rewriting the code, since Karajorma mentioned once that everyone who attempted this, vanished. :P

Gather round the virtual campfire, everyone. Time for nerdy ghost stories!

Seriously, though, it's not the easiest part of the code to play with... I'm certainly not making any big promises. :D

The idea is, that even if the AI would use glide, i wouldn't have total control over it's behaviour in certain situations.
The SEXPs would allow me to control the AI when i need it.

Fair enough... but wouldn't it be equally useful to be able to control any and all aspects of the AI that way? If we're going to allow that fine-grained of control, we might as well go whole-hog. :p
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: karajorma on April 26, 2009, 05:23:23 pm
It's still a bad idea.

Quite simply this is trying to control the individual actions of an AI ship via SEXPs instead of allowing the underlying AI system do it. In order to make it work you're going to have to build up a really large SEXP based psuedo-AI system that will tell the ship when and how to use these tricks.

It results in needlessly complicated, probably unmaintainable mission code in return for nothing which can't be gained by simply doing things correctly in the first place. And that's before we get to the fact that in order to implement these SEXPs someone needs to edit the AI code to add functions that will do these things. But if we have functions that will do this, why the hell would we need SEXPs to call them? Why not simply call them from in the code in the first place?
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: Rodo on April 26, 2009, 06:44:40 pm
Tactics for every retail capital ship to face the enemy with most of it's turrets... I mean to avoid that dancing thing the do now, I know you can dissable that from the table but still It would be nice to have custom IA's for every capital ship, sorry if that doesn't fit here.
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: pietraz on April 26, 2009, 06:56:12 pm
I'd actually love to see AI bombers trying to shake off enemy fighters. Right now they go in straight line toward their targets, blind to a wing of fighters decimating their ranks with primaries from 700m. Even simple jinking would be better. Plus, they could stop pursuing their targets and do some evasive maneouvers after the bomb salvo (20 sec cooldown).

Other things I found irritating with the AI were already mentioned.
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: Dilmah G on April 26, 2009, 10:17:01 pm
- Bombers carrying the Helios torpedo close to <500 before releasing their ordnance

- Bombers carrying the Cyclops also close to <500

- Fighters have a greater sense of self-preservation. One thing that pisses me off is seeing a fighter race to it's assigned corvette with six Hercs on it's six. I think that's something to do with AI Skill level but I'm not sure.

- Would modifying the AI code for Capship attack commands be too hard? Personally I like setting waypoints for them but it'd save some time if for smaller ships like cruisers didn't need waypoint sets. And because in retail high noon the Colossus is given an Attack order, causing it to look a bit weird.

- Could you have these as options in the ai_profiles.tbl? If for some reason people preferred retail behaviour (I don't know why...)

- Is it possible to affect in which situations the AI uses certain missiles? Such as the hornet should be used head-on (deviation of 10 degrees) and 30 degrees from it's six, since the hornet uses lag pursuit.

EDIT: Also

- Bombers on the "Destroy my target" order on a ship cruiser class and above automatically attack the nearest turret targeting them. I'm not sure if that's implemented already but sometimes I notice bombers heading right into a wall of flak for no good reason.
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: Admiral Nelson on April 26, 2009, 10:25:48 pm
Mine would be to ask if it is somehow possible to fix the formation grinding thing as if it were a bug in the main branch of the code -- i.e. as some minor tweak that wouldn't break anything else or require the setting of a unique AI profile.
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: Sushi on April 27, 2009, 08:15:01 am
Tactics for every retail capital ship to face the enemy with most of it's turrets... I mean to avoid that dancing thing the do now, I know you can dissable that from the table but still It would be nice to have custom IA's for every capital ship, sorry if that doesn't fit here.

I'm not sure exactly what you mean. Do you mean having every capship try to put its target in the spot where it can bear down with the most firepower? If so, that's fairly hard to do... I suppose it's possible if there is a table entry or something that specifies the "optimal" attack position, but it would mean that people would have to manually debate over and choose the "best' attack position for every single capship.

- Would modifying the AI code for Capship attack commands be too hard? Personally I like setting waypoints for them but it'd save some time if for smaller ships like cruisers didn't need waypoint sets. And because in retail high noon the Colossus is given an Attack order, causing it to look a bit weird.

I dunno, haven't tried yet. What exactly do you want to happen? "Looks wierd" isn't very specific. :p

- Could you have these as options in the ai_profiles.tbl? If for some reason people preferred retail behaviour (I don't know why...)

Naturally, if and when I do change anything, it would have to be optional and off by default.

- Is it possible to affect in which situations the AI uses certain missiles? Such as the hornet should be used head-on (deviation of 10 degrees) and 30 degrees from it's six, since the hornet uses lag pursuit.

Hardcoding the "best" way to use each missile is probably a bad idea, given the sheer number of possible missiles (including mods). IMO the AI does decently well with missiles... certainly well enough to be dangerous. :)

- Bombers on the "Destroy my target" order on a ship cruiser class and above automatically attack the nearest turret targeting them. I'm not sure if that's implemented already but sometimes I notice bombers heading right into a wall of flak for no good reason.

Are you saying that they currently do attack the nearest turret, or that they should?


Mine would be to ask if it is somehow possible to fix the formation grinding thing as if it were a bug in the main branch of the code -- i.e. as some minor tweak that wouldn't break anything else or require the setting of a unique AI profile.

Possible? Sure, assuming I do it. :D I'll let someone else make the decision on whether or not that fix gets to count as a "bug fix" or an "optional enhancement" though.
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: Dilmah G on April 27, 2009, 08:36:45 am
- Instead of attempting the "Circle of Death" (Set up a mission, give both caps the attack order and make them invincible, put your fighter in a good spot and crank up time compression and see what happens), they initially bring their forward beam cannons to bear if they're outside their range, then once they hit say... 2400 metres they start broad-siding (I think this is also what Rodo means), so they do an initial pass of the target side-by-side at... 1200 metres? And they stay stationary in that position until the target begins to move, if it is moving/starting to, the ship attempt to keep 1200 to whichever is the closest side of the ship and move along-side it. This way, I can set up an Orion to move to a series of waypoint, and a Deimos on attack order at 3200 metres will

A) Close the gap
B) Attempt to broadside

I think this is currently what happens, but it looks very messy, you'll most likely notice some obvious things in the code. Basically the AI does whatever it can to get itself sitting next to its target.

- Yes fair enough :yes:

- They should
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: Reprobator on April 27, 2009, 11:06:16 am
i'd like to make the ai capship able to use primary bank and primary weapon witjout having to cheat with turrets  :)

A shield ship ai : i explain what i mean :

I'm planing to make a special ship who'd be used to enforce a capital's ship flak screen where bombers and fighter stay in formation behind that ship shield untill they pass the flak screen to release they're payload.

actually it would work in multiplayer if the shield ship would be a player but i don't think ai would be able to handle it correctly.
Anyway i didn't tryed yet if the collision system allow that kind of "Physical shield" .




Title: Re: AI Wishlist: post what you'd like to see here!
Post by: Sushi on April 27, 2009, 11:45:34 am
A shield ship ai : i explain what i mean :

I'm planing to make a special ship who'd be used to enforce a capital's ship flak screen where bombers and fighter stay in formation behind that ship shield untill they pass the flak screen to release they're payload.

actually it would work in multiplayer if the shield ship would be a player but i don't think ai would be able to handle it correctly.
Anyway i didn't tryed yet if the collision system allow that kind of "Physical shield" .

Yeah, I'd recommend getting it working as a player-flyable ship before worrying about special AI for it. :) Neat idea, though, I hope you can get it to work.
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: Rodo on April 27, 2009, 01:12:13 pm
Tactics for every retail capital ship to face the enemy with most of it's turrets... I mean to avoid that dancing thing the do now, I know you can dissable that from the table but still It would be nice to have custom IA's for every capital ship, sorry if that doesn't fit here.

I'm not sure exactly what you mean. Do you mean having every capship try to put its target in the spot where it can bear down with the most firepower? If so, that's fairly hard to do... I suppose it's possible if there is a table entry or something that specifies the "optimal" attack position, but it would mean that people would have to manually debate over and choose the "best' attack position for every single capship.


exactly, the positions can be discussed by the comunity but we can all agree on some.. for example I've been doing missions with Deimos lately and for me the set up should be like this:

When facing a weaker enemy the Deimos must put up most of it's firepower to bare and kill the threat as fast as possible for that a position like this (http://img528.imageshack.us/img528/1215/screen0516.jpg) should be acquired.

But... if it's facing a far superior foe.. let's say a Deimos against an Orion (which we know will turn the Deimos into dust) it must try to shield itself from the firepower and STILL be able to respond to the aggression... something like this (http://img183.imageshack.us/img183/3200/screen0517.jpg) minimizing the hit zone for the Orion and still having something to fight with.... sure it will not be that effective but it's better than the actual.


PD: disregard the orion on the second shot... it's not meant to be there.. in fact it's only a test mission which I used to test some nameplates.. so the position should be facing straight forward the aggressor.
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: Reprobator on April 27, 2009, 02:31:43 pm
the thing is :
as long as i have no ai to try with i'll have to try it online ^^

But that's planned :)

And about enabling ai tu use primary and secondary weapon on capital ships, is there any possibility?
The thing is, afaik (correct me if i'm wrong) you can't set a number of limited ammunition on a turret, and having this would give another dynamics to battle (maybe not in fs2 universe but others would gain from it)
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: Talon 1024 on April 27, 2009, 03:25:13 pm
I think the AI needs to be smarter when they're travelling along a waypoint path.  If you have a bunch of ships that are assigned to follow one waypoint path, and the waypoint is near, the AI can be pretty stupid, almost to the point where they fly like they were drinking alcohol.
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: Topgun on April 27, 2009, 03:27:30 pm
AI should use shields correctly.
that means different routines for capships, since they should use shields differently.
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: Mobius on April 27, 2009, 03:29:51 pm
A thing bomber wings should definitely do is opening their formations. The closer they are, the easier they go down.

Claiming that opening formations makes turrets less effective, although potentially true, is not to be taken in consideration. Bomber turrets can hardly damage a fighter so their presence is nearly insignificant - opening the formation is a much better solution.


AI should use shields correctly.

You mean something like this? (http://www.hard-light.net/wiki/index.php/Ai_profile#.24smart_shield_management)  :)
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: General Battuta on April 27, 2009, 03:46:46 pm
Can't you get the bombers to 'open up' just by placing their warpin points farther apart?

And, um, I have to say I'm decently satisifed with the Freespace AI.  :nervous:
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: Mobius on April 27, 2009, 03:50:47 pm
Changing their positions in FRED somewhat solves the problem, but bombers would tend to close their formation if they're sufficiently close.

The whole issue can be circumvented by using bombers as single spacecraft rather than grouping them in wings, but this option is not handy at all.
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: General Battuta on April 27, 2009, 03:54:44 pm
Agreed, that's not ideal.
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: Kolgena on April 27, 2009, 06:47:41 pm
This will break retail campaign balance, but allow AI ships to dual fire secondaries. (I don't think they can currently, but if they do, well call me stupid.)
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: General Battuta on April 27, 2009, 08:08:33 pm
Methinks they do, judging by some of the Tornado volleys I've seen coming my way...

Oh, yeah, they probably do. Haven't you seen bombers launching a pair of bombs? It happens, I think.
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: Dilmah G on April 27, 2009, 08:32:32 pm
Yeah, it does. Also, http://hard-light.net/wiki/index.php/Ai_profiles.tbl there are already options implemented for people who didn't know.
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: Sushi on April 27, 2009, 10:58:11 pm
I think the AI needs to be smarter when they're travelling along a waypoint path.  If you have a bunch of ships that are assigned to follow one waypoint path, and the waypoint is near, the AI can be pretty stupid, almost to the point where they fly like they were drinking alcohol.

Could you please be more specific?

And regarding capship positioning: I'll add it to the list, but IMO capship battles is one area that will always be easier to get right via good FREDding than via AI.
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: Dilmah G on April 27, 2009, 11:43:57 pm
Regarding Capship AI, yeah I agree, maybe you could take a look at the existing code and see if there's anything that looks blatantly out of place or looks like it could cause some errors and make some edits there instead. In terms of following waypoints, try to keep the AI level when they follow them, occasionally they seem to bank and it looks plain retarded seeing a Deimos on a 45 degree angle.
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: Reprobator on April 28, 2009, 01:36:51 am
Something about ai i was thinking about ,
Is this intended that when a ship (big ones) is exploding, the turrets continue to shot?
I mean if we want to make long and dramatic explosion it would be cool to disable the turret's ai at the begining of the explosion sequence (can be freded maybe? )
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: Dilmah G on April 28, 2009, 01:38:45 am
That'd be an unnecessary one to FRED, I think it's okay, I mean everything doesn't suddenly die at 0% Hull Integrity, the ship has to blow up.
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: General Battuta on April 28, 2009, 01:43:27 am
You could turret-lock the ship at 1% hull. Would that carry over into the death? Probably.
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: Reprobator on April 28, 2009, 01:44:35 am
Ok :)
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: Dilmah G on April 28, 2009, 01:47:50 am
You could turret-lock the ship at 1% hull. Would that carry over into the death? Probably.

That's what went thru my head when he asked the question, but if you're going to FRED a huge mission.... urghh, too much effort.
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: karajorma on April 28, 2009, 04:57:34 am
Changing their positions in FRED somewhat solves the problem, but bombers would tend to close their formation if they're sufficiently close

Only if you tell them to all go after the same target.
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: Reprobator on April 28, 2009, 07:11:38 am
it would be easyier if it was controlled by flag i think (i love flags in tbl's  :p)
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: Dilmah G on April 28, 2009, 07:43:10 am
Well they're all going to be aren't they? In the ****-aip.tbm?
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: Sushi on April 28, 2009, 08:16:23 am
Regarding Capship AI, yeah I agree, maybe you could take a look at the existing code and see if there's anything that looks blatantly out of place or looks like it could cause some errors and make some edits there instead. In terms of following waypoints, try to keep the AI level when they follow them, occasionally they seem to bank and it looks plain retarded seeing a Deimos on a 45 degree angle.

Waypoints have an orientation, right? Meaning you can set which way is "up" for each? If so, do capships currently respect that at all?
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: Dilmah G on April 28, 2009, 08:17:39 am
I've no idea, visually waypoints appear as blobs in FRED so it's hard to tell if the rotation editor affects them.
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: Topgun on April 28, 2009, 08:53:36 am

You mean something like this? (http://www.hard-light.net/wiki/index.php/Ai_profile#.24smart_shield_management)  :)
yes but I was thinking of capitol ships.
if two caps are in a battle, they should add shield power to the side that faces the other ship.
but that thing is pretty darn good too. :yes:
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: Dilmah G on April 28, 2009, 08:58:26 am
Caps actually have shields? I thought that was a FRED anomaly
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: Topgun on April 28, 2009, 09:46:37 am
I mean for mods where caps have shields.
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: Sushi on April 28, 2009, 10:04:50 am
I mean for mods where caps have shields.

OK, I see what you mean now. Added to the wishlist.
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: Mobius on April 28, 2009, 12:06:37 pm
Changing their positions in FRED somewhat solves the problem, but bombers would tend to close their formation if they're sufficiently close

Only if you tell them to all go after the same target.

Well, yeah. I was giving that for sure. :)
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: Reprobator on April 28, 2009, 03:38:21 pm
i could try with a friend my shield concept and that work perfectly (only aaa beam sometime pass through) :)
About the way it should behave under ai control, i was thinking like making pass around the heaviest turret defended cap ship side ?
or maybe some kind of order, when you ask him to attack a turret he'll just approach it untill it is 10/5 meter away then get away and loop back unitll you give him order to stop or to attack another target?

 
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: Aardwolf on April 29, 2009, 12:13:34 am
Just a thought about broadsiding (not a suggestion, more of a 'think first'): What happens if two ships with equal speeds are facing the same direction and start the 'broadside' behavior?

Wouldn't they go off forever (or until one is destroyed)?
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: Dilmah G on April 29, 2009, 03:25:28 am
Once their in ideal positions as aforementioned they should come to a halt shouldn't they?
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: Sushi on April 29, 2009, 08:32:18 am
It's pretty unlikely that two ships will have compatible "ideal positions." For example, two Ravanas (assuming you had a situation where sparring Ravanas made sense) would both want to attack each other from the rear, and would presumably just chase each other in circles.
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: Dilmah G on April 29, 2009, 08:56:58 am
Well IMO, the default behavior should be to broadside the ship until it's in ideal position (directly right or left of the ship facing same direction as attacking ship) since most ships bar the Ravana, Sath and Sobek have the majority of their beams mounted in broadside attack positions with a few in forward positions. FREDers using offensive orientated ships should set waypoint paths for them. This isn't supposed to be a blanket fix for CapShip attack behaviour IMO, just something to help take the weight off FRED-ers FRED-ing complex missions.
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: Mobius on April 29, 2009, 11:23:00 am
It's pretty unlikely that two ships will have compatible "ideal positions." For example, two Ravanas (assuming you had a situation where sparring Ravanas made sense) would both want to attack each other from the rear, and would presumably just chase each other in circles.

Ouch. Not again, not here. :blah:

Back on topic, I think the whole changes to the AI controlling warships is, well, not necessary. Warship duels are to be handled via waypoints so that they can be under control. Telling two warships to attack each other makes the battle weird and unpredictable due to the various and well known turret placements.

In other words, use waypoint paths when trying to represent a battle.
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: Dilmah G on April 30, 2009, 04:27:17 am
Yeah for custom made campaigns I agree, but the issue is in retail on several occurrences (High Noon, Last mission with the 53rd) AI Ships cruiser class and above are given attack orders, so just some streamlining would help in those cases.
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: Rodo on April 30, 2009, 06:27:24 am
it makes no sense not trying to fix this 'cause if it is supposed for the fredder to script every aspect of the battle then eliminating the "attack ship" order for cap ships would be the thing to do... as we need to always use waypoints, so in that case what's the point of the attack order anyway?

besides in a mission with +3 cap ships in battle wouldn't you literally kill for an order that could take the burden of scripting one of the ships waypoints and other stuff?
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: Dilmah G on April 30, 2009, 06:38:15 am
Yeah, maybe just ships of cruiser class should be using attack orders.
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: Rodo on April 30, 2009, 06:46:49 am
yes... cruisers are likely to be good subjects of test for an IA improvement.
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: Dilmah G on April 30, 2009, 06:52:25 am
Yeah, as their size won't make maneuvering into position look that weird from a player perspective.
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: Ziame on April 30, 2009, 11:35:32 am
I want AI to be good enough to make my wingmen talk to each other at their own and control the universe through the internets
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: Dilmah G on May 01, 2009, 03:57:30 am
Yeah, personally I much rather set up waypoint sets, but the main FS2 campaign gives capships attack orders on occasion, which is my real issue with it.
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: karajorma on May 01, 2009, 04:12:48 am
And nothing in this thread should ever change the way the main FS2 campaign works anyway. So the issue is moot.

Having better capship AI is dependant on if it works better in new campaigns than the existing system.
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: Rodo on May 01, 2009, 10:37:19 pm
so... are we getting an IA improvement of cap ships... I'm guessing that it's a no because it can change retail campaign but still it would be a nice thing to conciderate.
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: Sushi on May 01, 2009, 11:14:58 pm
so... are we getting an IA improvement of cap ships... I'm guessing that it's a no because it can change retail campaign but still it would be a nice thing to conciderate.

I'm leaving it on the wishlist... after all, it's a wishlist. But keep in mind, this is a wishlist, not Sushi's Definitive TODO list. :) The point is to collect AI improvement ideas so that I (or anyone else) have some inspiration for what to toy with.

I'm definitely not planning on doing any capship AI anytime soon, partly for the reasons discussed above and partly because it's just not as interesting to me as some of the other issues. If you're curious, what I'm focusing on right now:

1. I'm trying to see if I can make the AI use slide functionality more aggressively (such as during evasion maneuvers, turret strafing, head-to-head jousting, and bombing runs).
2. I'm trying to figure out a good way to solve the "AI ships protecting something let themselves get slaughtered" problem.

I have a pretty good idea of at least one reason why #2 happens: AI ships that get shot when more than 500m from their guarded ship don't do anything to evade or pursue their attacker. So, if they're trying to catch back up with the ship they're guarding, they'll fly in a straight line while getting shot from behind. I'm sure you've seen it. :) There are probably other cases that fall under the "dumb AI is suicidal" category, but this is one of the big ones. The question now is, what's the best way to solve the problem? Should the AI ships turn to fight their attacker, at least temporarily? Should they evade for a bit without firing back? Should that 500m threshold be extended?

Any thoughts? :) I'll probably end up trying them all, but I think I like the "evade" option best.
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: asyikarea51 on May 01, 2009, 11:28:19 pm
I was going to suggest a 'tack-on' idea / improvement / whatever you want to call it to one of Dilmah's earlier posts regarding bombers but I seem to have forgotten what I wanted to say :nervous:
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: Dilmah G on May 01, 2009, 11:35:42 pm
The real issue is when ships head in a straight line they become a target for more hostile fighters, which is how you end up seeing one myrmidon heading leisurely with it's rear shields being assaulted by five Hercs. I think we should play with that 500 number, and switch it round, meaning above 500 metres the AI will turn around and engage the enemy for about 8-12 seconds (if it's possible), and then continue on course, diverting all power from guns to engines and using afterburners as frequently as possible to get to their target ship. Inside of the 500 metre bracket behaviour should stay the same though. Thing with evading, is that if the fighter is close, it will continue to score hits on the escorting fighter. Maybe if the attacker is outside of 1400 metres the escorting fighter will continue on course? (Apologies for using a post as a brain-storming session).
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: karajorma on May 02, 2009, 03:28:23 am
BTW Sushi, is there any way I can get a look at a diff of your Sushi Glide changes?
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: Sushi on May 02, 2009, 12:10:24 pm
(Apologies for using a post as a brain-storming session).

No problem! I like brainstorming, ideas are good.

BTW Sushi, is there any way I can get a look at a diff of your Sushi Glide changes?

Yeah, there's a diff included in the .zip linked to in the SushiGlide v5 thread. (http://www.hard-light.net/forums/index.php/topic,62485.0.html) The extension is .patch, but as far as I can tell the format is the same as .diff (and SVN seems to understand both). If for some reason that doesn't work, I can generate and post a new patch file.
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: swashmebuckle on May 02, 2009, 12:33:52 pm
If you're planning to make bombers jink around as they come under fire on their runs, you could probably use that same maneuvering scheme for fighters trying to catch up to the ship they're protecting.  The problem I see with having them turn and fight their pursuers wherever they are is that if you put a time limit on their engagement, they'll just go back to playing catch up and getting stomped when it expires, and if you let them fight their attackers indefinitely it'd be the same as if they didn't have the protect order on at all.  Protect has to prioritize getting to the heavy hitters over preserving your own ship in order for it to be a meaningful strategy, so I'd say random twitch dodges or some sort of evasive corkscrew with afterburners would be a good compromise when the protector comes under fire.
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: Angelus on May 02, 2009, 12:37:37 pm
The way fighters follow waypoints.
Fighters usually slow down when they reach a waypoint within a waypoint path, then they accelerate as soon they face  the next waypoint, which looks sometimes a bit odd.
This should be changed, so that they fly towards the next waypoint without slowing down, IMO.
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: Angelus on May 02, 2009, 12:43:24 pm
If you're planning to make bombers jink around as they come under fire on their runs, you could probably use that same maneuvering scheme for fighters trying to catch up to the ship they're protecting.  The problem I see with having them turn and fight their pursuers wherever they are is that if you put a time limit on their engagement, they'll just go back to playing catch up and getting stomped when it expires, and if you let them fight their attackers indefinitely it'd be the same as if they didn't have the protect order on at all.  Protect has to prioritize getting to the heavy hitters over preserving your own ship in order for it to be a meaningful strategy, so I'd say random twitch dodges or some sort of evasive corkscrew with afterburners would be a good compromise when the protector comes under fire.


Good point.

Would it be possible to change the behaviour of Wings ( fighters/ bombers in Wings) ?

I think something like, a Wing of six fighters have the order to attack a cap ship.
They are attacked by enemy fighters, now 3 of them turn to face the new threat, while the others continue the attack on the cap.

Title: Re: AI Wishlist: post what you'd like to see here!
Post by: karajorma on May 02, 2009, 12:50:23 pm
Yeah, there's a diff included in the .zip linked to in the SushiGlide v5 thread. (http://www.hard-light.net/forums/index.php/topic,62485.0.html) The extension is .patch, but as far as I can tell the format is the same as .diff (and SVN seems to understand both). If for some reason that doesn't work, I can generate and post a new patch file.

No there isn't. First place I checked. :) The download has the .exes, a readme and folders for BtRL, Realspace and TBP but no diff (either diff or patch is fine. Don't know what the difference is if any either).

The earlier versions seem to have it but the most recent one doesn't.
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: karajorma on May 02, 2009, 01:21:37 pm
The question now is, what's the best way to solve the problem? Should the AI ships turn to fight their attacker, at least temporarily? Should they evade for a bit without firing back? Should that 500m threshold be extended?

Any thoughts? :) I'll probably end up trying them all, but I think I like the "evade" option best.

Personally I'd suggest

1) Create an AI_Profiles flag to turn on new behaviour. If the flag is set make the decision on what to do dependant on the already existing AI table $evasion and $courage values as they do next to nothing anyway.

or

2) Add new settings to ai.tbl and only modify behaviour from default if they are present.
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: Sushi on May 02, 2009, 01:33:38 pm
No there isn't. First place I checked. :) The download has the .exes, a readme and folders for BtRL, Realspace and TBP but no diff (either diff or patch is fine. Don't know what the difference is if any either).
The earlier versions seem to have it but the most recent one doesn't.

Well crap, you're right! I feel dumb. :) Try again, it should be there now.

If you're planning to make bombers jink around as they come under fire on their runs, you could probably use that same maneuvering scheme for fighters trying to catch up to the ship they're protecting. 

Bombers already DO jink. They don't use sidethrust to do so, but they do dive out of the way. By default, they only go left or right though (I've added experimental code that will also make them go up or down, seems to work fine).

The problem I see with having them turn and fight their pursuers wherever they are is that if you put a time limit on their engagement, they'll just go back to playing catch up and getting stomped when it expires, and if you let them fight their attackers indefinitely it'd be the same as if they didn't have the protect order on at all.  Protect has to prioritize getting to the heavy hitters over preserving your own ship in order for it to be a meaningful strategy, so I'd say random twitch dodges or some sort of evasive corkscrew with afterburners would be a good compromise when the protector comes under fire.

Great job summarizing why this is a tricky design problem. :) The current "evade" behavior does include "afterburner and jink" as one of the things it can do, but it doesn't ever do so with a specific destination in mind. One of the ideas I've been toying with is exactly what you described: a new "evade-to-point" behavior where the ship tries to evade fire but still move towards a specific point. In theory, at least, it doesn't sound too complicated... evade but in a way where the ship is always moving towards a point within N degrees of their target destination.

The way fighters follow waypoints.
Fighters usually slow down when they reach a waypoint within a waypoint path, then they accelerate as soon they face  the next waypoint, which looks sometimes a bit odd.
This should be changed, so that they fly towards the next waypoint without slowing down, IMO.

Isn't this a FRED issue? I haven't done any FRED stuff for a while, but can't you set the speed of each waypoint or something? I know that I've seen the situation you're talking about, but I've also seen plenty of places where the ships just barrel through their waypoints at full speed. One example that comes to mind is the escape pods in mission 3 of ST:R. They hit several waypoints where they turn slightly, but they never slow down.
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: Sushi on May 02, 2009, 01:38:38 pm
Sorry for the double post... missed a couple. :)

Would it be possible to change the behaviour of Wings ( fighters/ bombers in Wings) ?

I think something like, a Wing of six fighters have the order to attack a cap ship.
They are attacked by enemy fighters, now 3 of them turn to face the new threat, while the others continue the attack on the cap.



So, in other words, wings that act as intelligent squads? That would be cool, although difficult to make a general AI for. I'll add it to the wishlist, but I think that some smart FREDding (like giving different order priorities to different ships in a wing) can probably get you the same effect with a lot less effort. :)

Personally I'd suggest

1) Create an AI_Profiles flag to turn on new behaviour. If the flag is set make the decision on what to do dependant on the already existing AI table $evasion and $courage values as they do next to nothing anyway.

or

2) Add new settings to ai.tbl and only modify behaviour from default if they are present.

Yeah, naturally everything/anything I do with AI will have to be controlled by some sort of flag(s) so I don't break retail and modders have full control over everything they do/don't want.
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: Angelus on May 02, 2009, 01:54:06 pm
Sorry for the double post... missed a couple. :)

Would it be possible to change the behaviour of Wings ( fighters/ bombers in Wings) ?

I think something like, a Wing of six fighters have the order to attack a cap ship.
They are attacked by enemy fighters, now 3 of them turn to face the new threat, while the others continue the attack on the cap.



So, in other words, wings that act as intelligent squads? That would be cool, although difficult to make a general AI for. I'll add it to the wishlist, but I think that some smart FREDding (like giving different order priorities to different ships in a wing) can probably get you the same effect with a lot less effort. :)


That's true, but my thought was: Place a few fighters, give 'em an attack/ protect order, and don't bother creating events that do exactly that. :D
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: swashmebuckle on May 02, 2009, 08:07:14 pm
One of the ideas I've been toying with is exactly what you described: a new "evade-to-point" behavior where the ship tries to evade fire but still move towards a specific point. In theory, at least, it doesn't sound too complicated... evade but in a way where the ship is always moving towards a point within N degrees of their target destination.
That would be perfect; it's exactly what I do if I'm being harassed by a Dragon or something, like in the last FS2 mission.  If you could get that working and make it so ships don't pointlessly smack into large stationary objects it would do worlds for FotG.  And other mods too, judging by how often Raiders would ram themselves into asteroids in the BtRL demo.  Best of luck with these changes! :yes:
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: takashi on May 02, 2009, 09:06:12 pm
More advanced dogfight styles, like start-stop to throw off a pursuer.

And bombers that actually defend themselves. That is, if it's possible to solely increase the accuracy of bomber turrets, not capship ones. Or have bombers pursue the occasional fighter when under attack.
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: General Battuta on May 02, 2009, 09:08:48 pm
More advanced dogfight styles, like start-stop to throw off a pursuer.

And bombers that actually defend themselves. That is, if it's possible to solely increase the accuracy of bomber turrets, not capship ones. Or have bombers pursue the occasional fighter when under attack.

For the first, play on insane, and the second happens already depending on what orders the bombers have been given.
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: takashi on May 02, 2009, 09:13:31 pm
First post in a year and i aleady feel like an idiot.
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: General Battuta on May 02, 2009, 09:14:03 pm
No, no, welcome back! There's no need to feel idiotic.

They're definitely good ideas. It's often hard to notice the behaviors.
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: asyikarea51 on May 03, 2009, 12:21:47 am
Do Shivans suddenly engaging lateral thrust to beat your agility count as start-stop?
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: Dilmah G on May 03, 2009, 01:09:32 am
I'm not sure but that would be interesting.
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: pietraz on May 03, 2009, 05:57:37 am
Do Shivans suddenly engaging lateral thrust to beat your agility count as start-stop?

I noticed it several times with Maras while playing the retail FS2. At first I was like:  :wtf:
As it seems, they are capable of maneouvers which terran and vasudan fighters can only dream of.
And that would explain the fancy appearance of Mara - the extra thrusters could be mounted on the tips of those "legs" she has.
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: Sushi on May 03, 2009, 11:21:50 am
More advanced dogfight styles, like start-stop to throw off a pursuer.

And bombers that actually defend themselves. That is, if it's possible to solely increase the accuracy of bomber turrets, not capship ones. Or have bombers pursue the occasional fighter when under attack.

One interesting thing to note is that turrets on bombers only attack the bomber's current target. That means that bombers who go straight for their target get ZERO use out of their turrets. Maybe bomber turrets should simply attack the closest target in their FOV?

Do Shivans suddenly engaging lateral thrust to beat your agility count as start-stop?

Here's the funny thing: that lateral thrust thing is NOT part of any "evade" maneuver in the code, even though it looks like that's what they're doing! In reality, there are only TWO places where sliding happens in the code:

1. Avoiding collisions. I think this is what you see those Maras doing: they're trying to get somewhere, your ship is in the way, so they use sidethrust to try to avoid a collision. In other words, the sidethrust you see from Shivan fighters now is more or less an accidental side-effect that happens to work pretty well in the game. AI code is like that. :D

2. Moving towards a waypoint, along a path, or towards a ship. If the ship hasn't rotated all the way to point directly at their destination, they use sidethrusters (if they have them) in the meantime to move them more in that direction. I'm actually not sure exactly how this is working (or even if it is) but I know for sure it has nothing to do with evasive or combat maneuvers.

In other words, there are a LOT more places where sidethrust could be used in combat and evasion but currently isn't. Thus item #2 on the wishlist. :) If I have my way, you'll eventually be able to dogfight ships that make full use of sidethrust (and glide) and make your life extremely miserable when trying to shoot them down.  ;7 Of course, you'd have to enable the appropriate AI_Profiles stuff first, but the option would be there...
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: Mongoose on May 03, 2009, 02:20:42 pm
One interesting thing to note is that turrets on bombers only attack the bomber's current target. That means that bombers who go straight for their target get ZERO use out of their turrets. Maybe bomber turrets should simply attack the closest target in their FOV?
This would be immensely useful, particularly if any attacking ships could be prioritized.  As it stands, your own bomber turret only serves as something of a backup primary bank, and like you said, AI bombers hardly ever use them when it would be prudent to do so.  I think this alone could go a long way toward improving their survival rates.
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: Kolgena on May 03, 2009, 04:19:18 pm
Oh! I know!

Fighters actually use Trebs on other fighters. Fighters actually try to dodge trebs.
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: General Battuta on May 03, 2009, 04:38:35 pm
Fighters do currently try to dodge Trebs.

The reason they won't fire at other fighters is because Trebs have the bomber+ flag (I believe.) You can fix that with a table edit, no AI modifications required.
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: Kolgena on May 03, 2009, 06:42:48 pm
Are you sure fighters dodge them? I don't think I've ever seen anything 3 klicks out use countermeasures against trebs. At least to my recollection, downing dragons with a single treb shot is almost guaranteed if the distance is long enough.

Also, the problem with the tags on the table for the treb is that the bomber+ tag makes them use it against bombers and the huge tag forces them to hit only cap ships. It means that, if I edit table values, the treb can only be used by the AI as anti-bomber or anti-turret ordinance, but not both. This is why I thought that perhaps modifying AI behavior with tag overlaps like this could be a better solution than pigeonholing this versatile weapon.
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: General Battuta on May 03, 2009, 06:49:08 pm
They'll maneuver once the Treb gets within their 'threat envelope', so far as I can tell.

Why don't you just pull of all the tags, and the AI will use it against all targets...?
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: Kolgena on May 03, 2009, 07:09:20 pm
They'd waste it really quickly, which isn't great considering its low max capacity, and they'd also try to use it in dogfights, which would be fail^14. Limiting it to bombers AND capships (if possible) would allow AI to use trebs where they're most valuable, and since those targets are slow, you wouldn't notice AI spewing off misses as much in a fight.

Edit: Building off that, I'm not sure if AI have preferential tactics/uses of secondaries against opponents. Are AI smart enough to realize that hornets will always miss unless you fire them in a tight cone behind your target? Will fighters use hornets or tempests instead of harpoons against cruisers? If not, it'd be great to have that, and it would fix this treb issue as well.
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: General Battuta on May 03, 2009, 07:31:33 pm
Those are good points.
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: karajorma on May 04, 2009, 01:25:05 am
Also, the problem with the tags on the table for the treb is that the bomber+ tag makes them use it against bombers and the huge tag forces them to hit only cap ships. It means that, if I edit table values, the treb can only be used by the AI as anti-bomber or anti-turret ordinance, but not both. This is why I thought that perhaps modifying AI behavior with tag overlaps like this could be a better solution than pigeonholing this versatile weapon.

Specifying a new flag that had both effects rather than altering the behaviour of the current flag seems smarter to me.
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: Dilmah G on May 04, 2009, 03:55:03 am
One interesting thing to note is that turrets on bombers only attack the bomber's current target. That means that bombers who go straight for their target get ZERO use out of their turrets. Maybe bomber turrets should simply attack the closest target in their FOV?
This would be immensely useful, particularly if any attacking ships could be prioritized.  As it stands, your own bomber turret only serves as something of a backup primary bank, and like you said, AI bombers hardly ever use them when it would be prudent to do so.  I think this alone could go a long way toward improving their survival rates.

Personally I think current attacker, and if none exists the closest target.

Also, the problem with the tags on the table for the treb is that the bomber+ tag makes them use it against bombers and the huge tag forces them to hit only cap ships. It means that, if I edit table values, the treb can only be used by the AI as anti-bomber or anti-turret ordinance, but not both. This is why I thought that perhaps modifying AI behavior with tag overlaps like this could be a better solution than pigeonholing this versatile weapon.

Specifying a new flag that had both effects rather than altering the behaviour of the current flag seems smarter to me.

Why yes it does, but I've never seen fighters actually using Trebs on ANYTHING, I assume you needed to use the good-secondary-time sexp to get them to use it.
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: Wanderer on May 06, 2009, 09:52:39 am
More advanced dogfight styles, like start-stop to throw off a pursuer.

And bombers that actually defend themselves. That is, if it's possible to solely increase the accuracy of bomber turrets, not capship ones. Or have bombers pursue the occasional fighter when under attack.

One interesting thing to note is that turrets on bombers only attack the bomber's current target. That means that bombers who go straight for their target get ZERO use out of their turrets. Maybe bomber turrets should simply attack the closest target in their FOV?

Option (objecttypes.tbl) for preventing that has already been added in wanderer branch (quite a while ago actually)...
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: Sushi on May 06, 2009, 10:27:33 am
One interesting thing to note is that turrets on bombers only attack the bomber's current target. That means that bombers who go straight for their target get ZERO use out of their turrets. Maybe bomber turrets should simply attack the closest target in their FOV?

Option (objecttypes.tbl) for preventing that has already been added in wanderer branch (quite a while ago actually)...

Sweet! Crossed it off the list :D
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: Topgun on May 06, 2009, 10:41:47 am
AI that works with Newtonian physics.
that would be cool.
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: pietraz on May 06, 2009, 10:52:04 am
Why AI only?
Besides, that would ruin the gameplay, to say the least.
For it to work we would have to redo the engine and the conception of battles.

Want newtonian physics, play Frontier.
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: chief1983 on May 06, 2009, 11:10:35 am
There already are closer approximations of newtonian physics in the FS engine, but the one thing they all lack is the capability for the AI to use it properly.  What do you mean Why AI only?
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: Topgun on May 06, 2009, 11:16:47 am
Why AI only?
Besides, that would ruin the gameplay, to say the least.
For it to work we would have to redo the engine and the conception of battles.

Want newtonian physics, play Frontier.
for mods man. for mods.
and I would be happy with semi-Newtonian physics. but that doesn't work good either. I tried it and the ai was way to stupid.
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: karajorma on May 06, 2009, 11:23:59 am
Actually from what I understand the AI works perfectly well with Newtonian physics in The Minbari Project. And we have the code for that.
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: chief1983 on May 06, 2009, 11:32:38 am
and I would be happy with semi-Newtonian physics. but that doesn't work good well either.

Fixed.
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: Topgun on May 06, 2009, 11:35:20 am
(http://student.eepis-its.edu/~ndahen/UTS/GrammarPolice.gif)
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: Sushi on May 06, 2009, 11:54:38 am
Yeah, the AI does decently with newtonian and semi-newtonian, although some of the dodge & jink code doesn't work as well (the effects are reduced at high dampening levels). On the other hand, some of the features usually present with (semi) newtonian stuff (such as glide and sidethrust) don't really get used by the AI. You'll notice that those are the first two items on the list. :D

Also, you can probably get some benefit out of optimizing AI profiles for newtonian(ish) fighting. I'm sure the Minbari Project folks have done something along those lines, ask them about it maybe? :)
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: haloboy100 on May 06, 2009, 12:04:53 pm
How about AI profiles? So that you can choose what kind of behavoir to flag on an AI when you create a ship; things such as "aggressive", "defensive" "conservative", etc...

That way some of these suggested features can be toggled on and off depending on how you want a certain A.I. to act.

Oh, and here's one. How about different A.I. behavoir during subspace missions? From what I've heard, the A.I. is easy to beat in subspace missions because they rely on shields (which are non-existant). So I think their tactics should change to be aware of no shields.

and perhaps squad meneuvers? Such as outnumbering an opponent (alpha one) and using certain flight tactics to take individual targets down. Such as, if it's one on three, one fighter would engage the target directly while the other two attempt to flank and attack simultaneously.
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: General Battuta on May 06, 2009, 12:19:26 pm
Hey, I've got a question about AI in general.

Do people generally experience a crash when the AI is ordered to fire Trebuchets at the player via good-secondary-time? I've had a mission crashing pretty consistently and that seems to be the cause.
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: Bobboau on May 10, 2009, 09:22:42 am
well if this is a wishlist how about this.

intelligent object collision avoidance.

tell the AI to blow up the reactor, it finds a path through a bunch of obstacles and a few tunnels and blows it up and is able to find it's way out again.
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: Stormkeeper on May 10, 2009, 11:33:05 am
I want my wingmen to actually be wingmen, not cannon-fodder pilots.
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: General Battuta on May 10, 2009, 12:54:48 pm
I want my wingmen to actually be wingmen, not cannon-fodder pilots.

As in covering you and all? Because other than their lack of specific formation flying tactics, I think they do a pretty good job already.
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: aRaven on May 10, 2009, 02:24:57 pm
the only way to prevent this is to have allied pilots have a  higher skill level than the opponents. like in XWA your wingmen rarely die, because they are on skilllevel superace.
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: haloboy100 on May 10, 2009, 02:32:33 pm
the only way to prevent this is to have allied pilots have a  higher skill level than the opponents. like in XWA your wingmen rarely die, because they are on skilllevel superace.
really? I found that they always died.

And that they always, always missed their target whenever they were trying to attack the same TIE I was chasing...by a mile.
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: aRaven on May 11, 2009, 10:06:23 am
you must be playing the original xwing then
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: Trivial Psychic on May 11, 2009, 11:12:19 am
It might be possible to script in some wingman coverage (as in LUA), by having orders for, when in a 2-fighter formation, 2 automatically stays near 1 and only engages targets nearby.  If 1 is directly threatened by an enemy fighter, it will break off any engagements and assist.  1 would engage any enemy unless 2 gets into trouble.  In FS AI commands, assuming that Fighter 1 isn't the player, that would be:

Default
Fighter 1:  AI-Chase-Any 89
Fighter 2:  AI-Stay-Near-Ship 89
                 AI-Chase-Any 88

That should prevent Fighter 2 from straying too far from Fighter 1, while still engaging enemies.  The problem is finding the trigger for ordering one ship to break off from its current target, and protect its wingman.  Perhaps the same code trigger that orders the "cover me" message, or a check to register a certain number of shield impacts within a certain period of time, or combine that with a check to register the amount of registered damage to its shields.  Whatever the check the result would be (assuming that Fighter 1 got into trouble):

Protect
when
-<Fighter 1 is attacked chriteria>
-clear-goals
--Fighter 2
-add-goal
--Fighter 2
--ai-guard
---Fighter 1
---89

Now if there is a way within LUA to order Figther 2 to attack the ship that is actually causing the damage to Fighter 1, that would allow Fighter 2 to be returned to its default status if the attacker is destroyed.  There would probably need to be a check to make sure that the attacker is not a cap-ship, and perhaps to make sure that the attacker is within a certain distance to avoid having Fighter 2 drawn away to engage an enemy attacking Fighter 1 with long-range weaponry.  That would leave Fighter 1 exposed to additional attacks.  The chriteria to return to default orders, could instead of the above-mentioned is-attacker-destroyed check, could either be tempered by a don't-stray-from-fighter-1 check, or by a continuous check to see if Fighter 1 is still under attack.  If Fighter 1 is no longer in danger, then Fighter 2's default orders are reinstated.

There would also need to be an order sequence, so if say in a 4 fighter formation, where 1 and 2 are wingmen, and 3 and 4 are wingmen, and if Fighter 3 is lost, then 4 would join in to assist Fighter 2 to provide cover for Fighter 1.  If then Fighter 1 is lost, Fighter 2 becomes then new lead, while Fighter 4 becomes his cover... that sort of thing

Not even sure if that can be done, but its a start.
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: Reprobator on August 04, 2009, 06:50:19 am
Hi, 'sorry for the necro ^^
I was tweaking around with turrets asteroids and other stuff and I've upgrade the asteroid's hitpoint by a factor of 100, the result is quite cool as now you can use them to hide and cover from enemy , the do not explode anymore with a single little laser shot...
But that's quite frustrating to see AI fighters wasting time and ammunition on those asteroids, and more than that, that's boring to see them collide with asteroids and stupidly explose while they try to destroy them ! (i vie upgrade the mass too)
So whats the point?
Well two thing in fact :
Having a flag in aiprofile for :
AI fighter/bomber ignore asteroids (they would just avoid colliding with them)
And have a new flag in the weapon.tbl like 'asteroid killer' that let cap ship with turret (armed with weapons using this flag) shooting those asteroids (with priority targeting orders like bombers/fighter/asteroids ).
That would be more realistic (IMHO) and i imagine being a gunner in those cap ship would get a bit more exciting than before :p



Title: Re: AI Wishlist: post what you'd like to see here!
Post by: TrashMan on August 04, 2009, 07:49:09 am
Regarding better capship AI manouvering:

The way I see it, something like this could work:
(http://img29.imageshack.us/img29/4743/shippositioning.th.jpg) (http://img29.imageshack.us/i/shippositioning.jpg/)

You pick one of the vectors that fits the ship best (and possibly a secondary vector if it's faster to get into that position) and put that vector in the ships table together with a defense vector
Forward, Back, Left, Right, Up and Down - combining those you can get all the vectors on the image.
It defaults to broadside. Now, sometimes you want some capital ships to be dumb, so maybe smart positioning could be turned on/off in FRED for individual capships.


On another note, I'd also like to see an aditional option - range. Basicly, what distance the ship will try to mantain from the target.

Long range would mean the ship would stay at the range of his (cap or supercap) weapon with longest range, pepper the enemy and fall back if necessary.
Medium would mean he would close to the distance where ALL of his anti-cap weapons would be in range. (take the effective range of all weapons capable of killing a capship, find the one with the shortest range and move to that distance)
Close is your regular bawl.
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: General Battuta on August 04, 2009, 07:57:15 am
I just can't see a situation in which smarter capship AI wouldn't lead to ships ramming each other all over the place.
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: chief1983 on August 04, 2009, 10:05:15 am
They would of course also have to check the direction they want to move, lord knows most capital ships should have ample time to react to a possible collision.
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: Sushi on August 04, 2009, 11:50:14 am
Stuff about asteroids

I agree that it would be nice if the AI worked better with high-hitpoint asteroids.

Regarding better capship AI manouvering:

Something like that could maybe work, but it would STILL be in every case inferior to scripting capship battles in FRED. AFAIK, the only thing you *can't* do for capships via FRED is control how much they roll. But that topic's already been debated to death in this thread: your ideas are definitely worthwhile if capship AI is ever improved.
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: Colonol Dekker on August 04, 2009, 12:01:00 pm
Support ships calling for cover. . .
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: TrashMan on August 04, 2009, 12:42:05 pm
Regarding better capship AI manouvering:

Something like that could maybe work, but it would STILL be in every case inferior to scripting capship battles in FRED. AFAIK, the only thing you *can't* do for capships via FRED is control how much they roll. But that topic's already been debated to death in this thread: your ideas are definitely worthwhile if capship AI is ever improved.

I beg to differ.

What happens if a ship get is engine damaged. With reduced speed, the whole crafted sequence is down in the toilet.
Change the ships max speed?
Ships turret destroyed?
Change the weapon loadout? Now you'll have to re-script the whole battle.

If one of the main turret is destroyeds, and the ships offensive potential drops, the AI can turn the ship around, into the secondary fire position.
If the ships speed is reduced, the ship still moves inteligently.

that's the beauty of it - it reacts and adapts.
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: General Battuta on August 04, 2009, 12:53:04 pm
It'd still be a FRED nightmare. Unpredictable warship positions means ships unable to jump out or colliding while jumping in.
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: chief1983 on August 04, 2009, 02:05:16 pm
Maybe neither one is supposed to jump out, it's a fight to the death and the smarter captain wins.  But I'll admit, Freespace was never about capships having a mind of their own, they're there to tell the story to the pilot, not make it up.
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: TrashMan on August 04, 2009, 03:09:37 pm
It'd still be a FRED nightmare. Unpredictable warship positions means ships unable to jump out or colliding while jumping in.

Ships turn if they need to jump out. If the ship is important you make it invulnerable before it jumps out, so several extra seconds of it turning is no problem.

Colliding when warping in - now that is a problem.
I'd suggest adding a "check for collisions" checkbox in FRED for a ship, so that it adjusts is arrival location (and vector) slightly if it detects a possible collision.
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: General Battuta on August 04, 2009, 03:38:21 pm
This behavior may be unique to Hecates, but in at least two instances I've seen the ship generate its warpout vortex inside a blocking target, then simply sit still when it should be warping out. It vanishes after a few seconds. All in all this does not do much for immersion.
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: Reprobator on August 04, 2009, 03:53:32 pm
another thought but this time i may get wrong.
After importing a new capship to freespace, i saw it's turret firing on it's ship's hull, avoiding that would be cool.
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: Colonol Dekker on August 04, 2009, 03:55:01 pm
Support ships calling for cover. . .

Awacs is meant to... Wingmen do it... why not support?
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: Dragon on August 04, 2009, 03:56:10 pm
After importing a new capship to freespace, i saw it's turret firing on it's ship's hull, avoiding that would be cool.
For this you can use "Check Hull" subsystem flag: http://www.hard-light.net/wiki/index.php/Subsystem#.24Flags:
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: Sushi on August 04, 2009, 04:02:45 pm
Support ships calling for cover. . .

Awacs is meant to... Wingmen do it... why not support?

Because they're expendable and have an infinite supply of replacements, perhaps? :D That, and they're unpiloted drones, I thought...
Title: Re: AI Wishlist: post what you'd like to see here!
Post by: karajorma on August 04, 2009, 05:12:17 pm
Nope, they're definitely piloted. :D

Cover messages could be added in the same way that other messages were added a while back.