Fractal Softworks Forum

Starsector => Mods => Modding => Topic started by: creature on March 02, 2021, 10:02:56 PM

Title: [0.96a] Boarding Util v.1.0.0 [YRUTL]
Post by: creature on March 02, 2021, 10:02:56 PM

(https://i.ibb.co/pjrYrP7/yrutl-banner-1.png)

Download v.1.0.0 for 0.96a
 (https://bitbucket.org/tanem_rin/tanemrin_yrutl_public/downloads/0.96_YRUTL.zip)

(https://i.ibb.co/Gdf58dC/diagram3.png)

I. Summary

This mod is contains the backend logic for combat boarding, first used in Kingdom of Royal Azalea (https://fractalsoftworks.com/forum/index.php?topic=18698.0). This mod is only a utility. It does not add nor remove any content from your game by itself.

Why is this a separate mod?

So I don't need to copy and paste the same backend to all of my mods when I want to add boarding for them as well.

Can I also add boarding to my mod using this backend?

Sure, if you want. I'll add a short explanation of how boarding works below.



II. Boarding Mechanics

Any boarding instance has two important properties - Boarding Level and Duration.

When a boarding action commences, the defending ship will have a random chance twice every second to suffer negative events for the duration of the boarding action. Moreover, when a ship that is currently being boarded is boarded again, then the boarders will be reinforced. That means the boarding level and duration of the second boarding party is added to the current boarders. This can continue until the boarders have been defeated entirely (the duration runs out). Thus, it is possible to stack boarding level by repeatedly boarding the same ship to both increase its boarding level and extend its duration. *Only the first boarding ship is considered to be the attacking ship, even if more of the boarders come from a different ship. The attacking ship will only change after the boarders are defeated.

(https://i.ibb.co/RN2YcVR/diagram1.png)
A Mora losing CR as a result of a boarding action

The chance for a negative event is influenced by many different things:

First and most significant is the Boarding Level. Each boarding level increases the chance that a negative event will occur.

Next is whether the defending ship has greater CR than the attacking ship. If so, the crew is considered to be "holding on" and event chance is slashed by half.

And lastly, whether the defending ship's crew is focused on resisting. The mod abstracts this state as being the same as the 0-flux boost. The reasoning being, if you're not shooting, maintaining a shield, or actively engaging with fighters, then your crew has time to fight off the boarders. And so, if your crew is focused on resisting, the chances for negative events will be further slashed by half, and the more dangerous negative events will not occur.

There are four negative events that can occur if the event roll succeeds.

(https://i.ibb.co/vL5JCCQ/diagram2.png)
A Mora losing a Light Autocannon (permanently) as a result of a boarding action
Note that its CR has been reduced to 42% from prolonged boarding.

There are finer, more minor details to the probability calculation and conditions for advanced events to occur, but this is all you need to know to use boarding actions effectively.



III. How to Use (Modding)

A boarding instance can be created by a single line call...

Quote

         yrutl_BoardingPlugin.addBoarding((Vector2f)location, (ShipAPI)target, (ShipAPI)ship, (float)visualFXSize, (int)boardingLevel, (float)boardingDuration);


The location here is the point on the ship where the boarders first make contact. It's only important for a single explosion effect on impact, don't worry about it. target is the ship being boarded. ship is the ship doing the boarding action. visualFXSize is the size of the explosions going off on the ship. Only the first boarder will set this. And boardingLevel and duration have been explained above.

Take this example inside a EveryFrameWeaponEffectPlugin class...

Example code
        ShipAPI ship = weapon.getShip();
        ShipAPI target = ship.getShipTarget();
       ...
   yrutl_BoardingPlugin.addBoarding(target.getLocation(), target, ship, 50f, weapon.getAmmo(), 10f);
[close]

The above example adds a boarding instance at the level of the ammo of the weapon (so it can be adjusted up and down easily by simply changing the ammo count of the weapon), and a duration of 10 seconds.

You can also add your own custom boarding sounds using the same call, but filling in 5 extra fields at the end...

Quote

         yrutl_BoardingPlugin.addBoarding( ... , (float)boardingDuration, (string) sfxStart, (string)sfxMinorDamage, (string)sfxCRLoss, (string)sfxDisableWeapon, (string)sfxDisableEngine);

Title: Re: [0.9.1a] Boarding Util v.1.0.0 [YRUTL]
Post by: shoi on March 04, 2021, 03:00:06 PM
How well does boarding work with AI?

You need that glorious 0-flux to resist, which the player can actively elect to do -  but isn't something I would think AI is capable of percepting (at least in vanilla). I haven't been able to try this yet and the question popped into my head after skimming over this.
Title: Re: [0.9.1a] Boarding Util v.1.0.0 [YRUTL]
Post by: creature on March 04, 2021, 03:16:26 PM
How well does boarding work with AI?

...
I have not touched the vanilla AI so they will behave as they normally would. Maybe the constant damage over time and EMP on their weapons would force them to be slightly more cautious, but I don't know. But yes, they don't know how to 0-flux to resist boarding.
Title: Re: [0.9.1a] Boarding Util v.1.0.0 [YRUTL]
Post by: bananana on March 04, 2021, 06:38:24 PM
Maybe the constant damage over time and EMP on their weapons would force them to be slightly more cautious, but I don't know.
it will not
scripted damage does not affect AI
only damage that AI can see and react to is that received directly from projectile/beam impact. and no, that does not include any onHit effects, only the damage listed in the csv
so any damage received from boarding will be treated as "welp, i suddenly have a lot less hp, but whatever, i'm sure it's nothing wrong"
so tying the resist mechanic to something that AI will not actively use under any condition is not really a viable option
Title: Re: [0.9.1a] Boarding Util v.1.0.0 [YRUTL]
Post by: SpaceManMonster on March 04, 2021, 07:13:51 PM
Could you please, please, add a mod file with a basic boarding pod weapon? That way it could appear in the shops and we could have dedicated boarding ships for all factions using troop transports. It would change combat for the entire game and could be one of the most important and useful mods for this game!

I would make this myself but I'm too dumb...
Title: Re: [0.9.1a] Boarding Util v.1.0.0 [YRUTL]
Post by: creature on March 04, 2021, 09:23:10 PM
Could you please, please, add a mod file with a basic boarding pod weapon? That way it could appear in the shops and we could have dedicated boarding ships for all factions using troop transports. It would change combat for the entire game and could be one of the most important and useful mods for this game!

I would make this myself but I'm too dumb...
Sure, sounds like a good idea. I'll try to do this in between the stuff I'm doing for YRXP.

it will not
scripted damage does not affect AI...
Oh, that's a shame. Well, I don't know enough about the game's AI to fix that. Maybe something will come up one day. But thanks for the info!
Title: Re: [0.9.1a] Boarding Util v.1.0.0 [YRUTL]
Post by: Thaago on March 04, 2021, 11:41:58 PM
Is the CR loss permanent, IE would I have to pay supplies to have it come back after combat is over?

Because while using CR as a secondary health bar for combat is neat, if you run into an enemy who boards you could end up paying a LOT of supplies. Depending on how much boarding was done, 2-4 times more supplies than usual could be possible, which is not all that cool.
Title: Re: [0.9.1a] Boarding Util v.1.0.0 [YRUTL]
Post by: creature on March 05, 2021, 12:44:51 AM
Is the CR loss permanent, IE would I have to pay supplies to have it come back after combat is over?

Because while using CR as a secondary health bar for combat is neat, if you run into an enemy who boards you could end up paying a LOT of supplies. Depending on how much boarding was done, 2-4 times more supplies than usual could be possible, which is not all that cool.
Ah, yes, the CR loss is indeed permanent, meaning that it carries over to your campaign after battle! Your concern is quite valid, but in my test campaign I've honestly not even noticed the bump in supply usage when fighting RYAZ. Maybe it has to do with the fact that they're still the only faction with the feature and even then, boarding isn't invoked too often.

But even assuming every faction you'll eventually encounter finally has some boarding feature, I think it's nothing that the player can't easily adjust to. it's only a matter of giving yourself that little more supply buffer for expeditions... or just mothball the really battered ships while you limp back to civilization.  :'(

*Though it might be a problem if you're the the type who always operates on a shoestring budget (of supplies)
Title: Re: [0.9.1a] Boarding Util v.1.0.0 [YRUTL]
Post by: Kakroom on March 05, 2021, 01:01:55 AM
This looks amazing!
Title: Re: [0.9.1a] Boarding Util v.1.0.0 [YRUTL]
Post by: SpaceManMonster on March 05, 2021, 12:50:49 PM
Is it possible for the amount of crew vs the number of marines to increase the chance of a negative effect? I want to try this with all of the factions so badly!
Title: Re: [0.9.1a] Boarding Util v.1.0.0 [YRUTL]
Post by: creature on March 05, 2021, 01:12:02 PM
This looks amazing!
Thank you very much!

Is it possible for the amount of crew vs the number of marines to increase the chance of a negative effect? I want to try this with all of the factions so badly!
While it's a fun and immersive idea, I believe there is no cargo for the AI. The feature itself is already slanted in favor of the player but adding this on top...
Title: Re: [0.9.1a] Boarding Util v.1.0.0 [YRUTL]
Post by: SpaceManMonster on March 05, 2021, 05:05:27 PM
You are right. Making it too powerful for the player is bad :(

What if it took the maximum crew value for AI ships VS your marine count and gave you a percentage increase or decrease in negative effects?
Then ships with lots of marine would be strong and ships with low crew would be weak. Or a close approximation at trying to make it immersive and thematic. Then you could fly pirate ships and just board people! :)
Title: Re: [0.9.1a] Boarding Util v.1.0.0 [YRUTL]
Post by: bananana on March 05, 2021, 07:25:06 PM
What if it took the maximum crew value for AI ships VS your marine count and gave you a percentage increase or decrease in negative effects?
Then ships with lots of marine would be strong and ships with low crew would be weak. Or a close approximation at trying to make it immersive and thematic. Then you could fly pirate ships and just board people! :)

wait, does crew capacity play no role in boarding at all? that's like the most obvious thing to affect it. because after all the fancy, it all boils down to how much meat you can throw in the grinder. because even some unarmed crew that some onslaught might be filled with will easily dispatch those measly five marines that you can send off of a hound, simply due to overwhelming numbers.
Title: Re: [0.9.1a] Boarding Util v.1.0.0 [YRUTL]
Post by: creature on March 05, 2021, 07:49:51 PM
wait, does crew capacity play no role in boarding at all? that's like the most obvious thing to affect it. because after all the fancy, it all boils down to how much meat you can throw in the grinder. because even some unarmed crew that some onslaught might be filled with will easily dispatch those measly five marines that you can send off of a hound, simply due to overwhelming numbers.
Uhh, sort of. It's ship size that plays a role in boarding. To give leeway to the edge cases of 0 crew capacity ships (like those of Aria).
Title: Re: [0.9.1a] Boarding Util v.1.0.0 [YRUTL]
Post by: Sheodoq on March 19, 2021, 05:20:06 PM
I was playing the new RYAZ update and fought Knight Templar ships. It would seem their unique shield type does not react well with the new boarding mechanic as I get a Fatal: null error occasionally when using the skill. Sadly, I'm not sure how to consistently replicate the CTD.
Title: Re: [0.9.1a] Boarding Util v.1.0.0 [YRUTL]
Post by: creature on March 19, 2021, 06:07:44 PM
I was playing the new RYAZ update and fought Knight Templar ships. It would seem their unique shield type does not react well with the new boarding mechanic as I get a Fatal: null error occasionally when using the skill. Sadly, I'm not sure how to consistently replicate the CTD.
Hmm, I've never played with Knight Templar, so I'm afraid I'm unable to give any suggestions. But from a cursory look, it seems the mod is only updated to 0.8.1a, maybe that has something to do with it?
Title: Re: [0.9.1a] Boarding Util v.1.0.0 [YRUTL]
Post by: miles341 on March 19, 2021, 07:31:09 PM
I was playing the new RYAZ update and fought Knight Templar ships. It would seem their unique shield type does not react well with the new boarding mechanic as I get a Fatal: null error occasionally when using the skill. Sadly, I'm not sure how to consistently replicate the CTD.
Hmm, I've never played with Knight Templar, so I'm afraid I'm unable to give any suggestions. But from a cursory look, it seems the mod is only updated to 0.8.1a, maybe that has something to do with it?
It's currently doing Discord only updates, but it is updated to the latest version. Last update was actually only 10 days ago.
Title: Re: [0.9.1a] Boarding Util v.1.0.0 [YRUTL]
Post by: Digganob on March 04, 2022, 07:08:51 AM
Hey, is it possible to use this utility to make a missile weapon or even a ship system that fires boarding pods that, on contact with a ship, start a boarding action? I was considering making a mod adding such boarding pods, so that all factions can take boarding actions.

P.S., would it be possible to make these boarding pods (which I suppose would essentially be missiles) able to pass through shields? I'd imagine it'd be the same way fighters are able to pass through shields.
Title: Re: [0.9.1a] Boarding Util v.1.0.0 [YRUTL]
Post by: creature on March 05, 2022, 04:16:18 AM
I was playing the new RYAZ update and fought Knight Templar ships. It would seem their unique shield type does not react well with the new boarding mechanic as I get a Fatal: null error occasionally when using the skill. Sadly, I'm not sure how to consistently replicate the CTD.
Oh, unfortunately I don't know how knight templar ships work as I've never played with them. But you are likely talking about the lightning strike power right? If their special shield system somehow insisted that the ship has shield, but doesn't actually have a shield that I can reference for its effective arc, then that *might* cause a crash. I'll keep it in mind when updating this in the future, thanks!
Title: Re: [0.9.1a] Boarding Util v.1.0.0 [YRUTL]
Post by: Sheodoq on April 28, 2022, 03:07:42 AM
I was playing the new RYAZ update and fought Knight Templar ships. It would seem their unique shield type does not react well with the new boarding mechanic as I get a Fatal: null error occasionally when using the skill. Sadly, I'm not sure how to consistently replicate the CTD.
Oh, unfortunately I don't know how knight templar ships work as I've never played with them. But you are likely talking about the lightning strike power right? If their special shield system somehow insisted that the ship has shield, but doesn't actually have a shield that I can reference for its effective arc, then that *might* cause a crash. I'll keep it in mind when updating this in the future, thanks!

Yeah Knight Templars have a "skin shield" that protects them and the Lightning Strike skill does not like it. Back in 0.9.1a, it caused a few crash to desktops until people learned that Knight Templar skinshields count. Of note, Knight Templar have a skill that pulses their shield and disables it. If you use Lightning Strike in the second before the shield recharge, it works fine and no crash.

I don't know of any mods with functional skinshields in 0.9.5a so it should be fine unless Knight Templar updates which seems highly unlikely.
Title: Re: [0.9.1a] Boarding Util v.1.0.0 [YRUTL]
Post by: creature on December 24, 2023, 10:03:59 PM
Update for 0.96
Download Here (https://bitbucket.org/tanem_rin/tanemrin_yrutl_public/downloads/0.96_YRUTL.zip)

This update coincides with the release of YRXP 3.0. Please note that YRXP 3.0 now requires Boarding Util.
Title: Re: [0.96a] Boarding Util v.1.0.0 [YRUTL]
Post by: Tokoro on December 28, 2023, 01:49:03 AM
Just wanted to express my thanks to you for going out of the way and keep updating your mods.