Looking for specific aiscript

The place to discuss scripting and game modifications for X4: Foundations.

Moderators: Moderators for English X Forum, Scripting / Modding Moderators

Post Reply
deemerz
Posts: 4
Joined: Sat, 24. Sep 22, 03:39

Looking for specific aiscript

Post by deemerz » Fri, 7. Oct 22, 12:51

Is there any aiscript in the box that I can mess with to try and improve AI behavior in cases where NPC ship is attacking player controlled ship? I mean those situations when you get close to some enemy ship and it pretends to be chasing you in order to get you out of the travel mode. AI do this so ineptly that it literally has no chance of success even if its ships' actual parameters (speed/maneuverability) are significantly superior to yours. I want to check if this behavior can be improved.

deemerz
Posts: 4
Joined: Sat, 24. Sep 22, 03:39

Re: Looking for specific aiscript

Post by deemerz » Sun, 9. Oct 22, 14:38

Judging by the many answers here, this aforementioned behavior is implemented internally and cannot be changed by modding. Is this so?

User avatar
euclid
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 13293
Joined: Sun, 15. Feb 04, 20:12
x4

Re: Looking for specific aiscript

Post by euclid » Mon, 10. Oct 22, 00:59

No, it's not hardcoded but the problem is that there are many scripts and interrupts that trigger and define combat. And none is restricted to player-owned ships only. You would need to check all attack/fight related scripts which is tricky (and tedious) as most are called by other scripts like patrol, plunder etc. and those have restrictions that may limit, even cancel any engagement at one point.

Cheers Euclid
"In any special doctrine of nature there can be only as much proper science as there is mathematics therein.”
- Immanuel Kant (1724-1804), Metaphysical Foundations of the Science of Nature, 4:470, 1786

deemerz
Posts: 4
Joined: Sat, 24. Sep 22, 03:39

Re: Looking for specific aiscript

Post by deemerz » Mon, 10. Oct 22, 05:02

Thanks for the tip. To be honest, I already checked some of the scripts you mentioned and didn't find what I seek.

My concern is not that the enemies can cancel engagement at some point, but the fact that AI isn't taking full advantage of ship's capabilities. Eg, I can circle in travel mode around a pack of [ZYA] Asps, Mambas and Chimeras using my Mk1-geared Courier for as long as you want, and they won't be able to even get close to me, not to mention hit me. In theory, such encounter should be incredibly dangerous for a player and should be avoided at all costs, but in practice, it's easier than taking candy from a baby - just turn travel mode on and fly thru them like a knife thru butter - they are unable to catch you anyway.

There seems to be some kind of restriction that forces AI controlled ships not to use travel mode properly in order to effectively intercept their targets. It looks as if they deliberately slow down long before getting close to their target, speed up again for a few seconds, slow down again, and so on and so forth. Inadequate behavior, in short. That's what I'd like to find in the scripts and try to fix. If it's possible.

User avatar
euclid
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 13293
Joined: Sun, 15. Feb 04, 20:12
x4

Re: Looking for specific aiscript

Post by euclid » Mon, 10. Oct 22, 12:10

Hm ... combat during TM, interesting. I cannot recall ever encourtered that but think it's a nice idea. Maybe you should adjust the title of your post accordingly to attract other scripters/modders ;-)

Cheers Euclid
"In any special doctrine of nature there can be only as much proper science as there is mathematics therein.”
- Immanuel Kant (1724-1804), Metaphysical Foundations of the Science of Nature, 4:470, 1786

deemerz
Posts: 4
Joined: Sat, 24. Sep 22, 03:39

Re: Looking for specific aiscript

Post by deemerz » Thu, 13. Oct 22, 04:54

euclid wrote:
Mon, 10. Oct 22, 12:10
Hm ... combat during TM, interesting.
I wouldn't call it "combat during TM". Rather, a way for AI to effectively chase and intercept ships out of TM.

But, it seems like this behavior is a part of internal implementation.. after all. I tried to reproduce given scenario with debugging enabled in all available attack and interrupt scripts, but none of them ever triggered for player controlled ship. Travel mode is OP and can't be fixed via modding. Sadge.

User avatar
euclid
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 13293
Joined: Sun, 15. Feb 04, 20:12
x4

Re: Looking for specific aiscript

Post by euclid » Thu, 13. Oct 22, 12:47

Quite right, maybe something like "Combat using TM". And I'm not sure but think you can adjust that using modified scripts. For example there are restrictions like

Code: Select all

<check_value value="not this.zone.isclass.highway and not this.assignedcontrolled.travel.active and (this.assignedcontrolled.attention ge attention.visible)"/>
and I wonder what happens if you remove the travel.active part. Moreover there is the travel="true" option in the <move_to object= .. command and hence it should be possible to force the npc ships to use TM. However, I've never tested that and might be wrong.

Cheers Euclid
"In any special doctrine of nature there can be only as much proper science as there is mathematics therein.”
- Immanuel Kant (1724-1804), Metaphysical Foundations of the Science of Nature, 4:470, 1786

Realspace
Posts: 1372
Joined: Wed, 15. Nov 06, 10:21
x4

Re: Looking for specific aiscript

Post by Realspace » Mon, 17. Oct 22, 16:36

I'd like to improve this aspect too. I've made both space very big and speeds high in my mods. Traveling through enemies is a piece of cake. It should not be..

User avatar
euclid
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 13293
Joined: Sun, 15. Feb 04, 20:12
x4

Re: Looking for specific aiscript

Post by euclid » Mon, 17. Oct 22, 19:47

In the past we had the disruptor missiles which are quite effective to disable TM. A missile that is fast, does no damage but disables engines for a few seconds. Not sure something like that can be implemented via script but worth a thought.

Cheers Euclid
"In any special doctrine of nature there can be only as much proper science as there is mathematics therein.”
- Immanuel Kant (1724-1804), Metaphysical Foundations of the Science of Nature, 4:470, 1786

Post Reply

Return to “X4: Foundations - Scripts and Modding”