Author Topic: Feature Request: free-afterburner-use as an AI profile flag.  (Read 2195 times)

0 Members and 1 Guest are viewing this topic.

Feature Request: free-afterburner-use as an AI profile flag.
So as far as I understand the only way to get the AI to use afterburners freely atm is with an alter-ship-flag SEXP. Making free-afterburner-use an AI profile flag would make it much easier to have more helpful AI that can follow the player as he afterburns through waypoints or when attacking capships.
As a bonus it would also be helpful if you could also use ai.tbl Ai profiles overrides for this flag if you want to make certain classes without free-afterburner-use.
« Last Edit: July 18, 2016, 12:27:18 pm by FrikgFeek »
[19:31] <MatthTheGeek> you all high up on your mointain looking down at everyone who doesn't beam everything on insane blindfolded

 

Offline General Battuta

  • Poe's Law In Action
  • 214
  • i wonder when my postcount will exceed my iq
Re: Feature Request: free-afterburner-use as an AI profile flag.
Yes yes yes yes

 

Offline mjn.mixael

  • Cutscene Master
  • 212
  • I release things
    • Steam
    • Twitter
    • Mix-Hai Productions
Re: Feature Request: free-afterburner-use as an AI profile flag.
 :yes:
Cutscene Upgrade Project - Mainhall Remakes - Between the Ashes - MjnMixael's Render Boutique
Youtube Channel - P3D Model Box
Between the Ashes is looking for committed testers, PM me for details.
Freespace Upgrade Project See what's happening.

 

Offline Spoon

  • 212
  • ヾ(´︶`♡)ノ
Re: Feature Request: free-afterburner-use as an AI profile flag.
In what way is the afterburner currently restricted for ai usage? Waypoints (though they do set ETS to engine max) and?
Urutorahappī!!

[02:42] <@Axem> spoon somethings wrong
[02:42] <@Axem> critically wrong
[02:42] <@Axem> im happy with these missions now
[02:44] <@Axem> well
[02:44] <@Axem> with 2 of them

 
Re: Feature Request: free-afterburner-use as an AI profile flag.
A better question is in what way it isn't. AI will only use afterburners when attacking, but they will use them no matter how far away the fighters/invisible nav buoys they're "attacking" are.
If you order AI to "cover you", or guard any friendly ship they will not use afterburners to either get to that ship faster or keep up with you as you're afterburning.

The free-afterburner-use flag has existed for some time now but the only way to use it is to assign it as a ship flag through alter-ship-flag.

Currently, this flag still doesn't make AI use burners for "guarding" a ship but they will use them if you order them to form on your wing. Even this would be much better than having the AI constantly lag behind or having to manually create events that set this flag for every mission.
« Last Edit: July 18, 2016, 04:18:42 pm by FrikgFeek »
[19:31] <MatthTheGeek> you all high up on your mointain looking down at everyone who doesn't beam everything on insane blindfolded

 

Offline General Battuta

  • Poe's Law In Action
  • 214
  • i wonder when my postcount will exceed my iq
Re: Feature Request: free-afterburner-use as an AI profile flag.
In what way is the afterburner currently restricted for ai usage? Waypoints (though they do set ETS to engine max) and?

Escort orders, disarm orders, disable orders, 'cover me' orders I believe, basically everything that's not a plain attack order.

 

Offline AdmiralRalwood

  • 211
  • The Cthulhu programmer himself!
    • Skype
    • Steam
    • Twitter
Re: Feature Request: free-afterburner-use as an AI profile flag.
With free-afterburner-use (which, as the OP notes, can only currently be set with the alter-ship-flag SEXP), the AI code will allow afterburners to be used when: attacking a big ship, flying to a target position, guarding a ship, and flying in formation. As far as I can tell (from searching for AIF_FREE_AFTERBURNER_USE), that list is exhaustive (although note that this is only additional situations allowed by free-afterburner-use; even without the flag, afterburners are allowed when attacking small craft, when evading, or after taking a hit).
« Last Edit: July 18, 2016, 04:00:21 pm by AdmiralRalwood »
Ph'nglui mglw'nafh Codethulhu GitHub wgah'nagl fhtagn.

schrödinbug (noun) - a bug that manifests itself in running software after a programmer notices that the code should never have worked in the first place.

When you gaze long into BMPMAN, BMPMAN also gazes into you.

"I am one of the best FREDders on Earth" -General Battuta

<Aesaar> literary criticism is vladimir putin

<MageKing17> "There's probably a reason the code is the way it is" is a very dangerous line of thought. :P
<MageKing17> Because the "reason" often turns out to be "nobody noticed it was wrong".
(the very next day)
<MageKing17> this ****ing code did it to me again
<MageKing17> "That doesn't really make sense to me, but I'll assume it was being done for a reason."
<MageKing17> **** ME
<MageKing17> THE REASON IS PEOPLE ARE STUPID
<MageKing17> ESPECIALLY ME

<MageKing17> God damn, I do not understand how this is breaking.
<MageKing17> Everything points to "this should work fine", and yet it's clearly not working.
<MjnMixael> 2 hours later... "God damn, how did this ever work at all?!"
(...)
<MageKing17> so
<MageKing17> more than two hours
<MageKing17> but once again we have reached the inevitable conclusion
<MageKing17> How did this code ever work in the first place!?

<@The_E> Welcome to OpenGL, where standards compliance is optional, and error reporting inconsistent

<MageKing17> It was all working perfectly until I actually tried it on an actual mission.

<IronWorks> I am useful for FSO stuff again. This is a red-letter day!
* z64555 erases "Thursday" and rewrites it in red ink

<MageKing17> TIL the entire homing code is held up by shoestrings and duct tape, basically.

 

Offline Spoon

  • 212
  • ヾ(´︶`♡)ノ
Re: Feature Request: free-afterburner-use as an AI profile flag.
Now that I have been educated, I give this feature request a wholehearted +1
Urutorahappī!!

[02:42] <@Axem> spoon somethings wrong
[02:42] <@Axem> critically wrong
[02:42] <@Axem> im happy with these missions now
[02:44] <@Axem> well
[02:44] <@Axem> with 2 of them

 
Re: Feature Request: free-afterburner-use as an AI profile flag.
the AI code will allow afterburners to be used when:  guarding a ship,

Not quite.


Alter-ship-flag SEXP has been used to give alpha 2 free-use-afterburners. As you can see he will happily use them when ordered to "Form on my Wing" but when ordered to "Cover me" he'll stop.
[19:31] <MatthTheGeek> you all high up on your mointain looking down at everyone who doesn't beam everything on insane blindfolded

 

Offline AdmiralRalwood

  • 211
  • The Cthulhu programmer himself!
    • Skype
    • Steam
    • Twitter
Re: Feature Request: free-afterburner-use as an AI profile flag.
the AI code will allow afterburners to be used when:  guarding a ship,

Not quite.

[snip]

Alter-ship-flag SEXP has been used to give alpha 2 free-use-afterburners. As you can see he will happily use them when ordered to "Form on my Wing" but when ordered to "Cover me" he'll stop.
The AI needs to be at least 385 meters away from its goal point to use afterburners in guard mode; completely different logic is used when to decide to afterburn in formation flying.
Ph'nglui mglw'nafh Codethulhu GitHub wgah'nagl fhtagn.

schrödinbug (noun) - a bug that manifests itself in running software after a programmer notices that the code should never have worked in the first place.

When you gaze long into BMPMAN, BMPMAN also gazes into you.

"I am one of the best FREDders on Earth" -General Battuta

<Aesaar> literary criticism is vladimir putin

<MageKing17> "There's probably a reason the code is the way it is" is a very dangerous line of thought. :P
<MageKing17> Because the "reason" often turns out to be "nobody noticed it was wrong".
(the very next day)
<MageKing17> this ****ing code did it to me again
<MageKing17> "That doesn't really make sense to me, but I'll assume it was being done for a reason."
<MageKing17> **** ME
<MageKing17> THE REASON IS PEOPLE ARE STUPID
<MageKing17> ESPECIALLY ME

<MageKing17> God damn, I do not understand how this is breaking.
<MageKing17> Everything points to "this should work fine", and yet it's clearly not working.
<MjnMixael> 2 hours later... "God damn, how did this ever work at all?!"
(...)
<MageKing17> so
<MageKing17> more than two hours
<MageKing17> but once again we have reached the inevitable conclusion
<MageKing17> How did this code ever work in the first place!?

<@The_E> Welcome to OpenGL, where standards compliance is optional, and error reporting inconsistent

<MageKing17> It was all working perfectly until I actually tried it on an actual mission.

<IronWorks> I am useful for FSO stuff again. This is a red-letter day!
* z64555 erases "Thursday" and rewrites it in red ink

<MageKing17> TIL the entire homing code is held up by shoestrings and duct tape, basically.

 
Re: Feature Request: free-afterburner-use as an AI profile flag.
Interesting. So is there a way to make the AI use their burners when ordered to "cover" the player? Because from my testing ordering alpha 2 to "cover me" will not make him use his burners no matter how far away he is. And in the previously linked video he's at least 500m or so away from the player considering the starting distance is like almost 400.
[19:31] <MatthTheGeek> you all high up on your mointain looking down at everyone who doesn't beam everything on insane blindfolded

 
Re: Feature Request: free-afterburner-use as an AI profile flag.
Yeah, formation flying (form up on my wing and waypoint order for a wing) is something entirely different from approaching a target. The latter is just to burn until below a certain distance. Formation works using average speeds that are a bit of an issue with afterburners cause these are not always active. The AI will try to approach its position in the formation gradually and keep a certain speed by using short ab pulses.

I'm surprised it doesn't work for the cover order. As far as I remember there is no different function involved but maybe I dumped too many stop afterburner calls all over the ai code :lol:
Here goes scripting and copy paste coding
Freespace RTS Mod
Checkpoint/Shipsaveload script

 

Offline AdmiralRalwood

  • 211
  • The Cthulhu programmer himself!
    • Skype
    • Steam
    • Twitter
Re: Feature Request: free-afterburner-use as an AI profile flag.
in the previously linked video he's at least 500m or so away from the player considering the starting distance is like almost 400.
Well, I said "at least" 385 meters; that's just the minimum distance needed for the condition to possibly ever be satisfied (according to my math). Note also I said "from its goal point", not "from the object it's guarding"; a better test would probably be ordering a fighter (which has been given free-afterburner-use, of course) to guard something a few kilometers away and seeing if it afterburns.

So is there a way to make the AI use their burners when ordered to "cover" the player?
Change the AI code. :P

No, but seriously, the AI code is littered with magic numbers like this that have long needed to be de-hardcoded and exposed to modders; this is just one example of many, I'm afraid.
Ph'nglui mglw'nafh Codethulhu GitHub wgah'nagl fhtagn.

schrödinbug (noun) - a bug that manifests itself in running software after a programmer notices that the code should never have worked in the first place.

When you gaze long into BMPMAN, BMPMAN also gazes into you.

"I am one of the best FREDders on Earth" -General Battuta

<Aesaar> literary criticism is vladimir putin

<MageKing17> "There's probably a reason the code is the way it is" is a very dangerous line of thought. :P
<MageKing17> Because the "reason" often turns out to be "nobody noticed it was wrong".
(the very next day)
<MageKing17> this ****ing code did it to me again
<MageKing17> "That doesn't really make sense to me, but I'll assume it was being done for a reason."
<MageKing17> **** ME
<MageKing17> THE REASON IS PEOPLE ARE STUPID
<MageKing17> ESPECIALLY ME

<MageKing17> God damn, I do not understand how this is breaking.
<MageKing17> Everything points to "this should work fine", and yet it's clearly not working.
<MjnMixael> 2 hours later... "God damn, how did this ever work at all?!"
(...)
<MageKing17> so
<MageKing17> more than two hours
<MageKing17> but once again we have reached the inevitable conclusion
<MageKing17> How did this code ever work in the first place!?

<@The_E> Welcome to OpenGL, where standards compliance is optional, and error reporting inconsistent

<MageKing17> It was all working perfectly until I actually tried it on an actual mission.

<IronWorks> I am useful for FSO stuff again. This is a red-letter day!
* z64555 erases "Thursday" and rewrites it in red ink

<MageKing17> TIL the entire homing code is held up by shoestrings and duct tape, basically.

  
Re: Feature Request: free-afterburner-use as an AI profile flag.
Putting in an Argo 4kms out and ordering Alpha 2 to protect it seems to make him use his burners, which is good. Now if only some handsome SCP coder could figure out how to make them do that for the "cover me" order  ;7
[19:31] <MatthTheGeek> you all high up on your mointain looking down at everyone who doesn't beam everything on insane blindfolded