[SCRIPT][AP][TC] Advanced Fight Scripts - v. 3.1, 19.01.2014

The place to discuss scripting and game modifications for X³: Terran Conflict and X³: Albion Prelude.

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

RAVEN.myst
Posts: 2585
Joined: Mon, 20. Jun 11, 13:16
x3tc

Post by RAVEN.myst »

AshToDust wrote:This sounds awesome and I m going to test it first thing in my next gaming session ^^

But, on theory, I won't make fighter match target speed but just make them a bit faster. Like target speed + 20% (in range of max speed of course). It's just plain error for fighter to be sitting duck ;)
Erm... if target is sitting still, then 0 + 20% of 0 = still zero! ;) But in principle I think I agree, the fighter should, perhaps, keep some motion relative to its target.

To the author: as soon as I read your description of this script I was blown away - if it's even half as good as your docs imply, then it's excellent - nice job! I'm going to be trying it out shortly. Oh, and for the record, this is the first custom script to EVER tempt me away from vanilla - I think that says a lot.

Raven, out.
AshToDust
Posts: 166
Joined: Thu, 5. Jan 12, 11:12
x3tc

Post by AshToDust »

RAVEN.myst wrote:
AshToDust wrote:This sounds awesome and I m going to test it first thing in my next gaming session ^^

But, on theory, I won't make fighter match target speed but just make them a bit faster. Like target speed + 20% (in range of max speed of course). It's just plain error for fighter to be sitting duck ;)
Erm... if target is sitting still, then 0 + 20% of 0 = still zero! ;) But in principle I think I agree, the fighter should, perhaps, keep some motion relative to its target.

To the author: as soon as I read your description of this script I was blown away - if it's even half as good as your docs imply, then it's excellent - nice job! I'm going to be trying it out shortly. Oh, and for the record, this is the first custom script to EVER tempt me away from vanilla - I think that says a lot.

Raven, out.
:oops:
Cronos988
Posts: 691
Joined: Mon, 27. Aug 07, 12:34
x3tc

Post by Cronos988 »

In a normal battle, fighters will rarely, if ever, sit still. They pretty much only stop when attacking capital ships in groups, and even there they will move when targeted.

Any experience with mixed battles? I mainly did simulations with roughly equal groups or fighter groups vs. capitals, but in actual gameplay, groups will be far more mixed.
RAVEN.myst
Posts: 2585
Joined: Mon, 20. Jun 11, 13:16
x3tc

Post by RAVEN.myst »

Cronos988 wrote:In a normal battle, fighters will rarely, if ever, sit still. They pretty much only stop when attacking capital ships in groups, and even there they will move when targeted.

Any experience with mixed battles? I mainly did simulations with roughly equal groups or fighter groups vs. capitals, but in actual gameplay, groups will be far more mixed.
I will give you what feedback I can as soon as possible :) I've only just gotten back into the game after a couple of months' break, and am role-playing a Teladi game at the moment - that means I'm only flying Teladi ships, and given how slow those are, I haven't installed your script yet (Teladi snail's-pace is quite handicap enough, for now!) However, I'll be getting back to my other characters soon, at which point I'll install this script - am looking forward to fighter behaviour that is much closer to how I envision it ought to be :D
Cronos988
Posts: 691
Joined: Mon, 27. Aug 07, 12:34
x3tc

Post by Cronos988 »

I am currently working on a significantly overhauled version of the fighter AI

In the current version, the improvements in fighter behaviour are mainly based on just attacking more and more consistently. That leads to a higher damage output that has a large impact in group battles and against larger targets.
The stopping at max range system against capitals is pretty effective, I have up to double the damage done until all fighters are lost.

What is currently not working as intended is the behaviour in direct 1 on 1 dogfighting. This is due to the fact that fighter weapons only hit reliably on very short distances. My fighters get far more shots on the enemy than the vanialla software, but that is pretty much just wasting their laser energy because the hitchance is too low. Additionally, defensive moves are largely pointless because at long range, you don't need to evade and at short range, you cannot evade.

But I think I have now figured out Vector mathematics (after I had forgotten all I learned about them at school), and can consequently add some new features. Most important is improved hit chance calculations and position projection, allowing for interception courses.

I am also thinking about adding "custom" defensive moves. The Vanilla "defensive move" command is very unreliable.
Mad_CatMk2
Posts: 518
Joined: Sun, 22. Feb 09, 20:13
x4

Post by Mad_CatMk2 »

damn Cronos, you REALLY are making us want to buy you lots of beer (or is that just me? :lol: )

you know what if (or is it possible even) to make your scripts customizable so that other scripters can extend upon your code and create 'tiers' of combat behavior.

i.e. simulate pilot ranking and etc for such uses?
I fly an OWP. What about you?
Cronos988
Posts: 691
Joined: Mon, 27. Aug 07, 12:34
x3tc

Post by Cronos988 »

Mad_CatMk2 wrote:damn Cronos, you REALLY are making us want to buy you lots of beer (or is that just me? :lol: )

you know what if (or is it possible even) to make your scripts customizable so that other scripters can extend upon your code and create 'tiers' of combat behavior.

i.e. simulate pilot ranking and etc for such uses?
Support for combat ranks (more skilled pilots fly better) is planned, but currently has low priority. First I want to create an "optimal" fight software, then I can make some features rank-dependant.

I should probably state that it's far from finished. I still need tons of testing in order to determine whether my calculations are accurate etc.

Btw., looking at so many NPC-NPC battles has led me to the conclusion that speed is vastly overrated or at least misunderstood in dogfights.
Speed does not actually make you harder to hit (at least not much), because AI ships will lead their targets anyway. What matters in terms of hitchance is size, distance and bullet speed.
The interaction seems to be like this: The smaller and farther away you are, the harder you are to hit. Most ships will miss a fighter above 1000m no matter it's speed, because while they hit the approximate position of the ship, the spread is so high that the actual bullets mostly miss.
Bullet speed only comes into the calculation when the bullet travels slow enough that the fighter has time to change direction before the bullets reach their destination, so it only modifies the base hit chance.
Speed plays almost no role at all. in theory moving perpendicular to the firing ship (a 90° angle) would make it harder to hit you, but leading the target nullifies that advantage.
So what speed actually does it it gets you in and out of range faster. With 490m/s, you only spend 2-4 seconds in the 1000m-Zone, while a Nova with 200m/s spends up to 10 seconds there. Plus the Nova is about 1,5 to 2 times the size of an M4 or M5.
Consequently I am thinking of throwing speed out of the hitchance calculation, which would also mean I could ommit all orientation calculations (which are only used to determine the correct relative speed).

Speed and orientation would then only be used to determine the interception course and the speed of the intercepting fighter.
Jumee
Posts: 2893
Joined: Sat, 29. Oct 11, 20:19
x3tc

Post by Jumee »

I have a question that might turn out to be fairly stupid :) :

If my fighters are in a wing, will it in any way affect how the script works? As in if I select a wing and tell them to attack my target (or any other target, or attack everyone) -> do they still use your scripts or default to vanilla?

P.S: when I just installed the script for testing purposes I jumped in 40 fighters and told them to attack all in a pirate sector with large force (m2+, a couple of m7 and a bunch of fighters*) and they wiped the whole sector out with only 3 fighters dead, and several damaged to a different degree O_o

maybe fighters will need a nerf now :lol:

*XRM makes pirates a lot stronger and gives them access to better ships -> thats how they got an M2+
Cronos988
Posts: 691
Joined: Mon, 27. Aug 07, 12:34
x3tc

Post by Cronos988 »

Jumee wrote:I have a question that might turn out to be fairly stupid :) :

If my fighters are in a wing, will it in any way affect how the script works? As in if I select a wing and tell them to attack my target (or any other target, or attack everyone) -> do they still use your scripts or default to vanilla?

P.S: when I just installed the script for testing purposes I jumped in 40 fighters and told them to attack all in a pirate sector with large force (m2+, a couple of m7 and a bunch of fighters*) and they wiped the whole sector out with only 3 fighters dead, and several damaged to a different degree O_o

maybe fighters will need a nerf now :lol:

*XRM makes pirates a lot stronger and gives them access to better ships -> thats how they got an M2+
I do not know exactly how wings work, but from looking at the wing scripts, it seems wing commands just start one of the standard commands on all wing ships. Consequently, wings should be affected by my scripts.

In any case I can confirm XRM fighter wings run my scripts, since I have seen log entries by e.g. "Xenon Fighter Wing Leader L".

I take it your were personally in that pirate sector you cleared? How was performance with 40 fighters around? ;)
Jumee
Posts: 2893
Joined: Sat, 29. Oct 11, 20:19
x3tc

Post by Jumee »

Cronos988 wrote:I take it your were personally in that pirate sector you cleared? How was performance with 40 fighters around? ;)
yes I was even one of those fighters :) (its more fun that way than when you sit in the carrier itself)

performance was pretty good no lags and/or stuttering though I do have a rather decent laptop
Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 22437
Joined: Sun, 14. Nov 04, 23:26
x4

Post by Cycrow »

Cronos988 wrote:
Jumee wrote:I have a question that might turn out to be fairly stupid :) :

If my fighters are in a wing, will it in any way affect how the script works? As in if I select a wing and tell them to attack my target (or any other target, or attack everyone) -> do they still use your scripts or default to vanilla?

P.S: when I just installed the script for testing purposes I jumped in 40 fighters and told them to attack all in a pirate sector with large force (m2+, a couple of m7 and a bunch of fighters*) and they wiped the whole sector out with only 3 fighters dead, and several damaged to a different degree O_o

maybe fighters will need a nerf now :lol:

*XRM makes pirates a lot stronger and gives them access to better ships -> thats how they got an M2+
I do not know exactly how wings work, but from looking at the wing scripts, it seems wing commands just start one of the standard commands on all wing ships. Consequently, wings should be affected by my scripts.

In any case I can confirm XRM fighter wings run my scripts, since I have seen log entries by e.g. "Xenon Fighter Wing Leader L".

I take it your were personally in that pirate sector you cleared? How was performance with 40 fighters around? ;)
Actually the wing commands are seperate to the others. When you run a wing command it runs a global script on the wing that then controls the individual ships within the wings.
some commands might call standard scripts or command on the individual ships
Nicoman35
Posts: 681
Joined: Thu, 17. Nov 05, 13:12
x3tc

Post by Nicoman35 »

Is this script compatible with Litcube's bounce? Or will there be some interferences?
Cronos988
Posts: 691
Joined: Mon, 27. Aug 07, 12:34
x3tc

Post by Cronos988 »

Nicoman35 wrote:Is this script compatible with Litcube's bounce? Or will there be some interferences?
As I said before, it should work fine, but you probably wont need it as much anymore.
Nicoman35
Posts: 681
Joined: Thu, 17. Nov 05, 13:12
x3tc

Post by Nicoman35 »

Cronos988 wrote:
Nicoman35 wrote:Is this script compatible with Litcube's bounce? Or will there be some interferences?
As I said before, it should work fine, but you probably wont need it as much anymore.
:oops: Sorry for that. Thanks for the info.
TouchMyNipple
Posts: 181
Joined: Wed, 15. Sep 10, 13:09
x4

Post by TouchMyNipple »

Damn it is sexy! All the fighter management is so kewl-looking that it simply had to be made effective.
By the way, maybe some turret scripts (like smart?) that run on non-player ships and decide on layouts could make some clearence to the capital ships behaviour?
Haste-whip TrixX!
Cronos988
Posts: 691
Joined: Mon, 27. Aug 07, 12:34
x3tc

Post by Cronos988 »

TouchMyNipple wrote:Damn it is sexy! All the fighter management is so kewl-looking that it simply had to be made effective.
By the way, maybe some turret scripts (like smart?) that run on non-player ships and decide on layouts could make some clearence to the capital ships behaviour?
Smart does turret layout? Sounds interesting, I'll take a look at it, thanks!

The to-do list for my update is kinda getting longer instead of smarter. I now have a system in place that calculates the victim's relative speed, based on which the attacker chooses it's own speed to arrive precisely within firing optimal firing distance without having to avoid.
The Idea is to keep ships from just constantly flying at each other and then doing avoid collission moves.

The issue here is that while it is working and seems efficient, it does not look good. If the enemy is coming at them and they are in range, fighters will just stop dead in space as long as they are not fired at by sufficient forces.

I am now considering making fighters try to stay behind their target if their target is slower than them and otherwise try to intercept the target instead of doing attack runs.
TouchMyNipple
Posts: 181
Joined: Wed, 15. Sep 10, 13:09
x4

Post by TouchMyNipple »

Wonder if it is possible to decide behaviour based on shipclass... Like tail-hug for m3 and less and another tactic for heavier ships...
Well i don't realy know how smart turrets manage layouts but as for what i've seen it did change some anti-capital into a flak to clear the field after eemy capital was dead. And mars on AI ships is turned off.

By the way, as you seem to plan a massive overhaul of fighter behavior maybe you should contact some other modders that also deal with the subject?
Haste-whip TrixX!
Nicoman35
Posts: 681
Joined: Thu, 17. Nov 05, 13:12
x3tc

Post by Nicoman35 »

Request: I would be most gratefull, if this briliant script could be made TC compatible. :)
Cronos988
Posts: 691
Joined: Mon, 27. Aug 07, 12:34
x3tc

Post by Cronos988 »

TouchMyNipple wrote:Wonder if it is possible to decide behaviour based on shipclass... Like tail-hug for m3 and less and another tactic for heavier ships...
Well i don't realy know how smart turrets manage layouts but as for what i've seen it did change some anti-capital into a flak to clear the field after eemy capital was dead. And mars on AI ships is turned off.

By the way, as you seem to plan a massive overhaul of fighter behavior maybe you should contact some other modders that also deal with the subject?
Actually, deciding behaviour based on ship classes would be the easiest solution, but I dislike it. It would reduce mod compatibility. Just take the M3 Bombers from XRM. They are M3 class, but they are not fighters.

I would rather decide behaviour based directly on the ship stats. Speed, frontal weapons, turret coverage etc. I have some ideas how to do it already, but development is currently halted due to the fact that I am moving to a different town ;).
Request: I would be most gratefull, if this briliant script could be made TC compatible.
Unfortunately, that is not possible without some significant alterations. X3TC lacks some of the script commands I am using (not a lot, but some important weapon information is AP only). Furthermore, it uses different turret scripts so it would probably require a modified Version of MARS.

In any case, developing a TC version isn't on the list until I have finished the AP version, sorry.
TouchMyNipple
Posts: 181
Joined: Wed, 15. Sep 10, 13:09
x4

Post by TouchMyNipple »

I guess you should post your adress here so greatfull users can order you some pizza-delivery )
Haste-whip TrixX!

Return to “X³: Terran Conflict / Albion Prelude - Scripts and Modding”