Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: assasing123 on December 15, 2011, 01:36:13 pm

Title: Request: AI Orbit at distance, Minimun AI speed.
Post by: assasing123 on December 15, 2011, 01:36:13 pm
Basically a function that can be added onto a ship AI profile, that will tell the ship that alike the strafing orbit, when it is attacking a ship all it should do is to keep orbiting it at certain distance while its turrets or alike do the damage.

and the second one, to force the ai TO never reduce its ship % speed below certain point when attacking someone, hopefully the table would be something like:

$Orbit Combat:         YES
       +Orbit distance:          XXXX ;XXXX= meters
       +Orbitmaxspeed:       XXXX ; XXXX = M/S
       +OrbitminSpeed:        XXXX ; XXXX = M/S


and the other would be:

$Combat min speed:   XXXX
Title: Re: Request: AI Orbit at distance, Minimun AI speed.
Post by: Sushi on December 15, 2011, 03:40:44 pm
This scenario sounds specific enough I suspect you may be better off using SEXPs/scripts to accomplish it.
Title: Re: Request: AI Orbit at distance, Minimun AI speed.
Post by: assasing123 on December 15, 2011, 05:56:55 pm
This scenario sounds specific enough I suspect you may be better off using SEXPs/scripts to accomplish it.

no actually not, i would be using this for about 40 ships, mostly capital ships, and to make sure the AI behaves on a consistent way on fights while using big "capital" ships that move more like fighters adn that are not supposed to stand still during combat, and this would be used in 2 mods, also not sure of other modders but i m pretty sure a lot of people could use this as well since it allows for much better broadside combat without having to rely on waypoints on fred, and also helps to deal with the clumsy AI constantly stopping to 0 to try shoot the player.

also this is behavior that would be expected on this mods, on any mission or campaign.
Title: Re: Request: AI Orbit at distance, Minimun AI speed.
Post by: Eli2 on December 15, 2011, 08:56:39 pm
Why should this not be possible with scripting ?
Title: Re: Request: AI Orbit at distance, Minimun AI speed.
Post by: Dragon on December 16, 2011, 09:02:34 am
$Combat min speed will be used by atmospheric mods, that's beyond doubt.
Orbiting could be used for gunboat strafing, any ship that has more turrets than front guns could use that. This could also be used to make sure fighters execute their strafing runs correctly when using side thrusters. Also, $Orbit Distance: should have two values, min and max. I can clearly see this getting some use, allowing for a lot of new tactics AI could exploit.
Title: Re: Request: AI Orbit at distance, Minimun AI speed.
Post by: Scourge of Ages on December 16, 2011, 08:45:42 pm
I agree that this would be really useful. Is such a thing even possible, code-wise?
Title: Re: Request: AI Orbit at distance, Minimun AI speed.
Post by: Aardwolf on December 16, 2011, 08:54:59 pm
Seems like there's some overlap between this and the glide AI that Sushi did for the BSG mods...
Title: Re: Request: AI Orbit at distance, Minimun AI speed.
Post by: Dragon on December 17, 2011, 03:28:48 am
Yes, that would be a great addition to glide-capable ships. I think that it could greatly reduce the number of times AI crashes into a ship when strafing it.
Of course, +Orbit Distance:should account for the target size, perhaps adding it's radius to it or somehow calculating distance to actual hull of a target (so a fighter would orbit a long and narrow capship in an eliptical pattern).
Title: Re: Request: AI Orbit at distance, Minimun AI speed.
Post by: MatthTheGeek on December 17, 2011, 04:13:20 am
Probably easier to use the bounding box to have the shape of the ship.
Title: Re: Request: AI Orbit at distance, Minimun AI speed.
Post by: Dragon on December 17, 2011, 06:58:02 am
Sounds like a good idea.
So, it seems that being able to define orbiting parameters is just what we need.

I'd propose another thing for that, +Orbit Facing: This would be a vector which orbiting AI will try to turn towards it's target. For fighters, it should be 0, 0, 1 (and it should default to it), but for bigger craft, you could set it so a ship will try to face the target with it's best armed side. Perhaps you could even define multiple vectors, so the ship would try to turn to the nearest one.
This would pretty much make capship attack orders a viable option.

If we could also allow "Stand Still" command to be issued by the player, commanding capships would be surprisingly near Nexus, as commands like "run away", "move to" and "protect" ("keep safe distance" "stay near ship" and "guard" respectively) are already in FSO, they just need to be enabled.
Title: Re: Request: AI Orbit at distance, Minimun AI speed.
Post by: assasing123 on December 17, 2011, 11:42:22 am
Probably easier to use the bounding box to have the shape of the ship.
from the attention this topic got, i think i had a good idea? O_O

and why not use the shield mesh of the ship for distance calculations?
Title: Re: Request: AI Orbit at distance, Minimun AI speed.
Post by: MatthTheGeek on December 17, 2011, 12:00:56 pm
...probably because most ships don't have a shield mesh ?

You don't want to base your code on something optional.

To boot, the bounding box is much simpler than the shield mesh for calculations (it's a freaking box)
Title: Re: Request: AI Orbit at distance, Minimun AI speed.
Post by: assasing123 on December 17, 2011, 01:35:58 pm
...probably because most ships don't have a shield mesh ?

You don't want to base your code on something optional.

To boot, the bounding box is much simpler than the shield mesh for calculations (it's a freaking box)

i had the impression a shield mesh was a requirement for any ship model, guess i still have a lot to learn, but then certainly the bounding box makes a lot of sense.
Title: Re: Request: AI Orbit at distance, Minimun AI speed.
Post by: Goober5000 on December 18, 2011, 01:23:41 am
Ships already orbit each other when you give them both ai-chase orders.