[MOD] Better piracy

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

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

leoriq
Posts: 365
Joined: Wed, 20. Mar 13, 06:42
x3ap

Re: [MOD] Better piracy

Post by leoriq » Fri, 8. May 20, 14:42

Alberto.Rota wrote:
Thu, 7. May 20, 20:17
In X-Rebirth it was much more dynamic, you actually helped your small insertion team by scanning areas of the ship to provide intel, hack systems to gain control of some areas of the ship, destroying targets to divert enemy forces, etc.
I cared about them, I leveled them up, we worked together in order to be able to assault bigger ships together!
Yeah, I remember repeatedly boarding ten Fulmekrons just for the fun of it, boarding process in XR was very enjoyable
Signature yes signature a GIGANTIC SIGNATURE!!

Alberto.Rota
Posts: 78
Joined: Fri, 22. Feb 13, 17:34
x4

Re: [MOD] Better piracy

Post by Alberto.Rota » Sun, 10. May 20, 10:55

I've just updated the mod
Create your own pirate gang.
Subordinates of the ship you are piloting will smartly participate in the "Harass operation", helping you while avoiding killing the target.
Tip: Use ships with a lot of shields and prefer high-shield/low-hull damage weapons for maximum effectiveness.

As always, feedback and bug reports are welcome!

Alberto.Rota
Posts: 78
Joined: Fri, 22. Feb 13, 17:34
x4

Re: [MOD] Better piracy

Post by Alberto.Rota » Sun, 10. May 20, 11:34

I've also posted the mod on Nexus, I do NOT use Nexus, so please let me know if I screwed it up at some point:

kmunoz
Posts: 444
Joined: Sun, 25. Feb 07, 19:59
x4

Re: [MOD] Better piracy

Post by kmunoz » Sun, 10. May 20, 16:13

Alberto.Rota wrote:
Sun, 10. May 20, 10:55
I've just updated the mod
Create your own pirate gang.
Subordinates of the ship you are piloting will smartly participate in the "Harass operation", helping you while avoiding killing the target.
Tip: Use ships with a lot of shields and prefer high-shield/low-hull damage weapons for maximum effectiveness.

As always, feedback and bug reports are welcome!
Welp, I've just turned your mod back on. ;) This is what I was waiting for - not having to disassemble my fleet or make them stay in a corner.
Let's Play Poorly! - Suboptimal X4 Playthroughs

Alberto.Rota
Posts: 78
Joined: Fri, 22. Feb 13, 17:34
x4

Re: [MOD] Better piracy

Post by Alberto.Rota » Sun, 10. May 20, 19:06

kmunoz wrote:
Sun, 10. May 20, 16:13
This is what I was waiting for - not having to disassemble my fleet or make them stay in a corner.
Glad to hear that! Let me know if you like how it works now, even if everything is alright, is good to know ;)

Alberto.Rota
Posts: 78
Joined: Fri, 22. Feb 13, 17:34
x4

Re: [MOD] Better piracy

Post by Alberto.Rota » Sun, 10. May 20, 19:10

I've started feedback threads both in Nexus and in SteamWorkshop, the idea is to encourage people to share general feedback about the mod, not just bug-reports.
Feel free to post your general feedback there:

Scoob
Posts: 9921
Joined: Thu, 27. Feb 03, 22:28
x4

Re: [MOD] Better piracy

Post by Scoob » Wed, 13. May 20, 00:56

Alberto.Rota wrote:
Sun, 10. May 20, 10:55
Create your own pirate gang.
I just started afresh and I really like this feature. Having another ship that's actually GOOD at helping out - vs. the micro-management we had to do before - is really nice. Just capturing my way to a small S and M-Class Fleet currently :)

Scoob.

Scoob
Posts: 9921
Joined: Thu, 27. Feb 03, 22:28
x4

Re: [MOD] Better piracy

Post by Scoob » Wed, 13. May 20, 02:53

A question: Are there some M-Class ships that are hard-coded (vanilla) to NEVER bail? The reason I ask is because of this scenario:

I took a "rescue ship from mines" mission, and did exactly that, took out the mines and the ship was free. I then realised that I'd rescued an SCA ship - a Peregrine Sentinel - so I thought I'd see if I could capture it with my tiny Fighter Wing. I've been trying to make this ship bail for about an hour! I'm staying close (<3km) I've taken his shields down as well as a chunk of his hull - all as prompted - but he simply will not bail. The Pilot's stats are good, 4* Piloting but only 2/3rds of a Star Morale.

Any idea if this is hard coded as I've NEVER had to battle so long to make a ship bail before.

Scoob.

uberex
Posts: 59
Joined: Wed, 30. Apr 08, 07:50
x4

Re: [MOD] Better piracy

Post by uberex » Wed, 13. May 20, 05:24

Scoob wrote:
Wed, 13. May 20, 02:53
A question: Are there some M-Class ships that are hard-coded (vanilla) to NEVER bail?
Indeed, some mission ships are spawned with capturable="0" flag, and this mod takes this restriction into account.
As a potential idea to this mod's improvement, if a target is set as non-capturable, "Harass" mission should be automatically cancelled.

Btw, great mod! Made my gameplay a much more enjoyable experience.

Alberto.Rota
Posts: 78
Joined: Fri, 22. Feb 13, 17:34
x4

Re: [MOD] Better piracy

Post by Alberto.Rota » Wed, 13. May 20, 06:35

Scoob wrote:
Wed, 13. May 20, 00:56
Having another ship that's actually GOOD at helping out - vs. the micro-management we had to do before - is really nice.
Glad to read that!
For me, it was also quite frustrating to have my own ships working against me.

Let me know how it works/feels since this will be the core part of my next step.
The next step is to create a new default behaviour (I think I'll call it "Corsair") that will be like "Patrol", but "Harassing" S/M ships instead of killing them.

Regards!

Alberto.Rota
Posts: 78
Joined: Fri, 22. Feb 13, 17:34
x4

Re: [MOD] Better piracy

Post by Alberto.Rota » Wed, 13. May 20, 10:20

uberex wrote:
Wed, 13. May 20, 05:24
As a potential idea to this mod's improvement, if a target is set as non-capturable, "Harass" mission should be automatically cancelled.
Make sense, I'll add it to the next version.

Scoob
Posts: 9921
Joined: Thu, 27. Feb 03, 22:28
x4

Re: [MOD] Better piracy

Post by Scoob » Wed, 13. May 20, 13:29

uberex wrote:
Wed, 13. May 20, 05:24
Indeed, some mission ships are spawned with capturable="0" flag, and this mod takes this restriction into account.
As a potential idea to this mod's improvement, if a target is set as non-capturable, "Harass" mission should be automatically cancelled.
Thanks for confirming. It does seem a shame that the game arbitrarily changes the rules like that though.

I wonder if Better Piracy could somehow override that setting? Make it a particular low bail chance, sure, but possible. I guess that could break plot / mission stuff though potentially. I wonder if there's a way to differentiate essential Plot line ships with generic mission spawned ones?
Alberto.Rota wrote:
Wed, 13. May 20, 06:35
The next step is to create a new default behaviour (I think I'll call it "Corsair") that will be like "Patrol", but "Harassing" S/M ships instead of killing them.
Interesting. Basically, you're saying we could assign ships to make other ship bail, but NOT be close by personally? I assume this will be quite heavily configurable in regards to which Faction(s) your ships will Harass as well as, perhaps, which classes. Having them "aware" of larger Wings of ships they might not want to tangle with would be good too.

Personally speaking, I'd likely be preying on SCA and FAF as bail targets, like I do in person. Though being able to pick any race - one assumes one you're an enemy with, but not necessarily - would be cool.

One thing I would love to see, which may well not be in the scope of this mod, is to be able to stealthily force a Bail or Capture. Basically, some technique / equipment etc. that means that the Faction that owns the ship DON'T instantly know what you're up to. I know in vanilla you can get away (no rep hit) with forcing S and M-Class ships to bail, if you're far enough away from a station and kill any DIstress Drones. With L and XL Ships destroying ANY surface element = instant huge rep loss though, which is a shame. I know Better Piracy adds a standing hit for making a ship Bail too, but I still think a stealthy way of doing things would be cool. Not sure how one would implement such a feature though. Egosoft looked like they were thinking along those lines with Distress Drones, but they never really finished the feature as they worked for M-Class Ships OK, but are irrelevant for L and XL-Class due to an instant rep hit upon any element (Turrets, Shields, Engines or even launched Drones) being destroyed - even if in the middle of no-where.

Thought: It'd be good if, in sectors that the Player owns, perhaps communications could be blocked so making a ship bail / capturing a target in your own sectors would mean no Rep loss. Faction might investigate why so many ships go missing though...best behave if they send a fleet and look innocent lol :)

Scoob.

Alberto.Rota
Posts: 78
Joined: Fri, 22. Feb 13, 17:34
x4

Re: [MOD] Better piracy

Post by Alberto.Rota » Wed, 13. May 20, 17:55

A lot of ideas there, let's go one by one:
Scoob wrote:
Wed, 13. May 20, 13:29
I wonder if Better Piracy could somehow override that setting?
No, as you pointed, there is a HUGE risk, and almost no benefit, I prefer to be on the safe side and to disable the Harass operation altogether over those "Protected" targets.
Scoob wrote:
Wed, 13. May 20, 13:29
Interesting. Basically, you're saying we could assign ships to make other ship bail, but NOT be close by personally?
Exactly that, you can have a ship/fleet roaming an area and harassing targets on their own, without player intervention.
Scoob wrote:
Wed, 13. May 20, 13:29
I assume this will be quite heavily configurable in regards to which Faction(s) your ships will Harass as well as, perhaps, which classes. Having them "aware" of larger Wings of ships they might not want to tangle with would be good too.

Personally speaking, I'd likely be preying on SCA and FAF as bail targets, like I do in person. Though being able to pick any race - one assumes one you're an enemy with, but not necessarily - would be cool.
To be fair and to set the expectations, it will be a pretty simple implementation (Unless there is really a need to make it more complex, I prefer to keep things as simple as possible):
  1. You can config the area to "Patrol" exactly like with the "Protect area" command. (Point + radius)
  2. You can specify if they will harass S ships. (Checkbox)
  3. You can specify if they will harass M ships. (Checkbox)
  4. You can specify if they will harass combat ships. (Checkbox)
  5. You can specify if they will harass mining ships. (Checkbox)
  6. You can specify if they will harass trading ships. (Checkbox)
And that's all, the ship/fleet will harass ENEMY ships that match that description, at least for the moment, ideas are welcome.
Scoob wrote:
Wed, 13. May 20, 13:29
One thing I would love to see, which may well not be in the scope of this mod, is to be able to stealthily force a Bail or Capture. Basically, some technique / equipment etc. that means that the Faction that owns the ship DON'T instantly know what you're up to. I know in vanilla you can get away (no rep hit) with forcing S and M-Class ships to bail, if you're far enough away from a station and kill any DIstress Drones.
Yes, this will be done at some time.
A well-planned piracy operation vs an isolated target in deep/neutral/xenon/pirate space... you can always blame Kahak/Xenon/SCA when they ask what happened.
Scoob wrote:
Wed, 13. May 20, 13:29
With L and XL Ships destroying ANY surface element = instant huge rep loss though, which is a shame.
It is, and it will be the first thing I will try to remove once I move onto the boarding, I mean... destroying an S/M ship with 20 people inside is far preferable than destroying a turret, or a combat drone, or even a repair drone... makes no sense.

Scoob
Posts: 9921
Joined: Thu, 27. Feb 03, 22:28
x4

Re: [MOD] Better piracy

Post by Scoob » Thu, 14. May 20, 00:21

Cool. Yes, I did wonder if trying to override that "cannot bail" setting would be opening can of worms lol. Proposed features sound great! :)

On another note, a slight possible bug maybe?

After forcing a ship to bail, the ships in my wing sometimes stop moving, never to move again unless either removed / re-added to my Fleet.

Basically, the ships (a Falcon Sentinel and an Baluur) are happily following me in my Buzzard Sentinel. I start a Harass operation and they do their thing, all working well. The ship Bails, I send a Marine over and send it off for refitting. However, when I start moving again, neither of the subordinate ships follow me. Edit: Even issuing a "Recall Subordinates" doesn't seem to work. I've not tried leaving the Sector to see if that wakes them up. Giving them a fly to order, then cancelling it wakes them up too.

I'm not 100% sure, but sometimes a ship bails very quickly - usually Scout class ships such as the Discoverer used by SCA - so my "helpers" don't get a look in. I think it's when they don't get to help, they lock up like this. Not sure though. My reasoning is that I hadn't seen this before, but it just happened twice in a row, and each time I was Harassing an SCA Discoverer, which bailed very quickly.

Scoob.

Scoob
Posts: 9921
Joined: Thu, 27. Feb 03, 22:28
x4

Re: [MOD] Better piracy

Post by Scoob » Thu, 14. May 20, 01:01

Hi, I just had another thought stemming from my current boarding attempt...

While it's GREAT to have ships in my Wing help me bring the targets shields down, there are other use cases for Wingmen...

When I'm attacking a target during a Harass operation, they might Drop Laser Towers or Drones, ships in my Wing seem to ignore these. It'd be nice (though I'm not sure how) to be able to have some guys set to still protect me, and other Wing Members.

If I'm tackling a larger ship, it'd be great if my Wing could help with neutering the target first. It's cool they help bringing shields down, but the first steps are really to disable Engines and take out any turrets first.

Basically, smart but still configurable behaviour. Could it be done this way:

Subordinates set to "Defence" = they primarily Protect the Player in the lead ship from Drones, Lasertowers and other attackers. If no other threats to the leader (player) then they'll revert to trying to bring down shields, damage hull. The onus being on the Player to disable things.

Subordinates set to "Attack" = they primarily target Engines and Turrets on the target ship.

Obviously this behaviour is subject to a valid Harass operation being in place.

What do you think?

Scoob.

Alberto.Rota
Posts: 78
Joined: Fri, 22. Feb 13, 17:34
x4

Re: [MOD] Better piracy

Post by Alberto.Rota » Fri, 15. May 20, 16:46

Scoob wrote:
Thu, 14. May 20, 00:21
After forcing a ship to bail, the ships in my wing sometimes stop moving, never to move again unless either removed / re-added to my Fleet.
Next version (With a bit of luck this weekend) will have a lot of fixes and technical improvements in that regard, thank you for reporting.
Scoob wrote:
Thu, 14. May 20, 01:01
When I'm attacking a target during a Harass operation, they might Drop Laser Towers or Drones, ships in my Wing seem to ignore these.
They purposely ignore them for the moment.
It is not a problem when targetting SCA/FAF, but if you kill "Laser towers" or "Drones" of a real faction, it will lower your reputation, you can easily go from +30 to -30 if during a harass operation you kill 15~20 Laser towers (Some ships haul literally HUNDREDS of them), 10~15 Defence drones (Reasonable amount for any XL ship) and 5 repair drones (Even if they fall to stray fire)... in a single operation!!!

Again, this is not meant to be this way in the future, once I focus on L/XL piracy systems/mechanics this will change, but for the moment, the best option is to put that decision on player hands rather than on AI hands.

Scoob
Posts: 9921
Joined: Thu, 27. Feb 03, 22:28
x4

Re: [MOD] Better piracy

Post by Scoob » Fri, 15. May 20, 17:27

Thanks.

One other observation if I may. As I started a fresh game recently (also with VRO, XR Ship Mod and Economy/War) I've been building up small fleet of fighters and other ships. I've been particular enjoying buzzing around in my Fighter group with a few fighter escorts. My first few acquisitions were really helpful for forcing ships to bail. However, as I've gotten other Fighters to bail I've added them to my Wing, which can actually cause a problem...I'll give an example...

I was trying to get an M-Class ship to bail. His shields were down and his hull damaged, but guidance was still asking for MORE hull damage. He was at about 50% hull - I'd just done some damage moments earlier - and the progress bar was still going up from this. Then, several of my Wingmen decided to fire at once, destroying the target. It would have been ok for any one of them to fire, maybe two, but not several of them at once lol.

For the record, I don't know if you use VRO currently, my ships are using the PAC Gun - basically a low-leve, but pretty good, anti-fighter fixed gun. Not much damage, but a long-ish burst and it doesn't heat up too quickly. However, when there ware likely 8-10 Guns all on target at once, pretty damaging.

Are the ships in the group that help with a Harass operation aware of their wing mate's damage? Or do they just think "will MY attack kill the target?".

I think, during the initial dropping of the shields, a larger group of relatively weak ships (like I have) are good - VRO makes M-Class ships a LOT tougher - but there's a risk involved once you're attacking the hull and several wing members fire at the same time. If you mod were aware of how many of the team had a firing solution at any one time and perhaps stopped some of them from firing once the hull gets low, that'd really help. Not sure how complex that might be though. Just thought I'd feed back on my experiences though. Really like this mod.

Scoob.

Alberto.Rota
Posts: 78
Joined: Fri, 22. Feb 13, 17:34
x4

Re: [MOD] Better piracy

Post by Alberto.Rota » Sat, 16. May 20, 06:32

I've just updated the mod
  • Created new default order `Corsair`, ships/fleets with this behavior will smartly harass selected enemy targets
  • Improved Harass operation logic
  • Improved debug logging
  • Disabled `combat_reputation_hit` and `harass_reputation_hit`, I need to find a better way of handling it
  • Stations will not allow a fleeing ship to dock if the attacker is allied to them
  • Separated changes into `Major changes` and `Minor changes` to increase readability
Create your own pirate imperium.
You will be able to instruct your most experienced pilots (3 stars or more) to do harass operations on their own, just assemble a small fleet and assing the `Corsair` default order to their leader.

Tip: The _Argon trading station_ in _Hatikvah's Choice I_ is usually full of HOP and ZIA traders (ARG/HAT will not protect nor care about them), that's a good spot to start.

As always, feedback and bug reports are welcome!

Alberto.Rota
Posts: 78
Joined: Fri, 22. Feb 13, 17:34
x4

Re: [MOD] Better piracy

Post by Alberto.Rota » Sat, 16. May 20, 11:18

Scoob wrote:
Fri, 15. May 20, 17:27
One other observation if I may.
Every feedback is welcome, then I might be able/willing to improve/change/do/fix it or not, but seriously, every single piece of feedback is welcome (Especially constructive feedback based on facts and real usage of the mod like the one you provide)
Scoob wrote:
Fri, 15. May 20, 17:27
...
Then, several of my Wingmen decided to fire at once, destroying the target.
...
Are the ships in the group that help with a Harass operation aware of their wing mate's damage? Or do they just think "will MY attack kill the target?".
...
That's exactly why "Tip: Use ships with a lot of shields and prefer high-shield/low-hull damage weapons for maximum effectiveness." is there, to avoid over-kill situations. :wink:

Let's check the possible solutions:
  1. You can down-size/re-arm your wing with more "Piracy-oriented" weapons. (Not really funny, but an option)
  2. With the latest update, you can split your wing into a "kill-wing" (High number of very damaging ships) and a "pirate-wing". (It will pay by itself in a very short time)
  3. I can increase the frequency of "Fire control" checks, especially in the "Damage hull" phase, now is done every sec, can be done every half sec. (The problem is still there, a big amount of high damage weapons such as "Plasma" or "Heavy torpedos" can still over-kill almost any small/medium target in just one volley.)
  4. I can improve the "Fire control" checks logic, make it self aware (Can I instantly kill the target?) and fleet aware (Can we instantly kill the target?)... but that's not realistic at the moment, the complexity of the code required to coordinate in real-time the fire control of a possible huge fleet vs a most likely impeded, damaged and almost dead target is not worth the gains (Not at this point at least, I prefer to invest that time into polishing other aspects and begin with the "Boarding" part)
  5. I can make it so that only members of the fleet assigned to a specific role (Intercept maybe?) join the "Harass operation" while letting the other part of the fleet to freely engage any OTHER target.
Options 1 and 2 are things that you can do right now, but not a real solution to the problem.
Options 3 and 4 will not really fix the problem or are too hard to implement to be worth it.
Option 5 looks right... it seems doable, it fixes the problem, it gives you control, and at the same time, some of your ships will protect you from "Unwanted security forces"... I will look onto it, but I see no major/hard arguments against it. :gruebel:

Scoob
Posts: 9921
Joined: Thu, 27. Feb 03, 22:28
x4

Re: [MOD] Better piracy

Post by Scoob » Sat, 16. May 20, 20:37

Thanks, I'll try out the new version :)

Edit: I'm using the updated version and have made several M-Class ships Bail. However, I'm currently Harassing a Pelican Sentinel and it's been under 25% hull for ages, yet not one single crew member has bailed. Captain Morale is just one star. I've done a number of L-Class ship operations this game, and this isn't what normally happens. Note that I am still at the "Maintain Pressure: Do not kill the target!" stage. Ship has been neutered, so is going nowhere and shooting no one, yet the crew count remains unchanged.

Might just be RNG poor luck on my part, but thought I'd check with you in case there's an error.

Btw: for ships in my Wing, how do I I set them as a "Kill Squad"? Add as an Attack group? My Defence Group is working to help me currently, and not blowing up the target, but it'd be nice to have some guys defending me - I assume they WON'T try to kill the marked Harass Target though, right?

Edit 2: I'm wondering if this is perhaps some sort of Plot ship? I have a mission "HAT: Going Offensive" to Deploy Bombs at a location - that location being a certain SCA Station. The Pelican seems to be heading to that station... so perhaps that's the issue, this ship will NEVER bail? I've got Marine on the way, so perhaps I'll not be able to board it either.

Edit 3: Ha, it WAS indeed a Plot ship. Pure coincidence though. I mean, I saw an SCA Ship on my travels, I Harassed an SCA ship, it's just how things are. I suspect I may break this mission if I board it?

Edit 4: I made the ship mine after that bit of the plot was done :)

Scoob.

Post Reply

Return to “X4: Foundations - Scripts and Modding”