Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Starsector 0.97a is out! (02/02/24); New blog post: Simulator Enhancements (03/13/24)

Pages: [1] 2

Author Topic: [0.96a] Boarding Util v.1.0.0 [YRUTL]  (Read 13879 times)

creature

  • Captain
  • ****
  • Posts: 400
    • View Profile
[0.96a] Boarding Util v.1.0.0 [YRUTL]
« on: March 02, 2021, 10:02:56 PM »



I. Summary

This mod is contains the backend logic for combat boarding, first used in Kingdom of Royal Azalea. 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.


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.
  • Minor Damage - A small explosion will erupt somewhere on the ship. This ignores shields and causes minimal HIGH EXPLOSIVE and EMP damage.
  • CR Loss - The ship can lose a small amount of CR. No damage is taken. This is essentially a gatekeeper event as it will eventually lead to the more powerful effects below if allowed to continuously happen. This event won't trigger if 'focused on resisting'.
  • Weapon Destroyed - One weapon mount is disabled for the duration of the battle. This event won't trigger if CR is above 50%. This event also won't trigger if 'focused on resisting'.
  • Engine Destroyed - One engine (one exhaust plume) is disabled for the duration of the battle. This event won't trigger if CR is above 50%. This event also won't trigger if 'focused on resisting'.


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);

« Last Edit: December 24, 2023, 10:03:29 PM by creature »
Logged

shoi

  • Admiral
  • *****
  • Posts: 650
    • View Profile
Re: [0.9.1a] Boarding Util v.1.0.0 [YRUTL]
« Reply #1 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.
Logged

creature

  • Captain
  • ****
  • Posts: 400
    • View Profile
Re: [0.9.1a] Boarding Util v.1.0.0 [YRUTL]
« Reply #2 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.
Logged

bananana

  • Commander
  • ***
  • Posts: 226
    • View Profile
Re: [0.9.1a] Boarding Util v.1.0.0 [YRUTL]
« Reply #3 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
Logged
Any and ALL sprites i ever posted on this forum are FREE to use. even if i'm using them myself. Don't ever, EVER ask for permission, or i will come to your home and EAT YOUR DOG!!!
i do NOT want to see my name appear in the credits section of any published mod and will consider it a personal insult.

SpaceManMonster

  • Ensign
  • *
  • Posts: 4
    • View Profile
Re: [0.9.1a] Boarding Util v.1.0.0 [YRUTL]
« Reply #4 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...
Logged

creature

  • Captain
  • ****
  • Posts: 400
    • View Profile
Re: [0.9.1a] Boarding Util v.1.0.0 [YRUTL]
« Reply #5 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!
Logged

Thaago

  • Global Moderator
  • Admiral
  • *****
  • Posts: 7174
  • Harpoon Affectionado
    • View Profile
Re: [0.9.1a] Boarding Util v.1.0.0 [YRUTL]
« Reply #6 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.
Logged

creature

  • Captain
  • ****
  • Posts: 400
    • View Profile
Re: [0.9.1a] Boarding Util v.1.0.0 [YRUTL]
« Reply #7 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)
« Last Edit: March 05, 2021, 12:47:57 AM by creature »
Logged

Kakroom

  • Commander
  • ***
  • Posts: 172
    • View Profile
Re: [0.9.1a] Boarding Util v.1.0.0 [YRUTL]
« Reply #8 on: March 05, 2021, 01:01:55 AM »

This looks amazing!
Logged

SpaceManMonster

  • Ensign
  • *
  • Posts: 4
    • View Profile
Re: [0.9.1a] Boarding Util v.1.0.0 [YRUTL]
« Reply #9 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!
Logged

creature

  • Captain
  • ****
  • Posts: 400
    • View Profile
Re: [0.9.1a] Boarding Util v.1.0.0 [YRUTL]
« Reply #10 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...
Logged

SpaceManMonster

  • Ensign
  • *
  • Posts: 4
    • View Profile
Re: [0.9.1a] Boarding Util v.1.0.0 [YRUTL]
« Reply #11 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! :)
« Last Edit: March 05, 2021, 05:09:38 PM by SpaceManMonster »
Logged

bananana

  • Commander
  • ***
  • Posts: 226
    • View Profile
Re: [0.9.1a] Boarding Util v.1.0.0 [YRUTL]
« Reply #12 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.
Logged
Any and ALL sprites i ever posted on this forum are FREE to use. even if i'm using them myself. Don't ever, EVER ask for permission, or i will come to your home and EAT YOUR DOG!!!
i do NOT want to see my name appear in the credits section of any published mod and will consider it a personal insult.

creature

  • Captain
  • ****
  • Posts: 400
    • View Profile
Re: [0.9.1a] Boarding Util v.1.0.0 [YRUTL]
« Reply #13 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).
Logged

Sheodoq

  • Ensign
  • *
  • Posts: 6
    • View Profile
Re: [0.9.1a] Boarding Util v.1.0.0 [YRUTL]
« Reply #14 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.
Logged
Pages: [1] 2