-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat(weapon): new "untouchable" tag that keeps projectiles alive after they collided with a ship and more #9079
Conversation
Pretty neat! This feels like something that, applied with an appropriate adjustment to the raw damage number, might be utilized on the Emerald Sword's spinal weapon; in concept it's a "pierce everything fusion pumped laser" (and visually does pierce everything), but was implemented with available technical limitations at the time to only deal damage in an AoE on the first thing the beam appears to hit. This tag could be used to fix it in order to match the current visuals of the weapon in game; so that it would function as it looks as a piercing beam attack in a line. |
How does this work with beam weapons, both in terms of visuals and the way damage is calculated? Does it do more damage to ships if more of the beam slices through them, or is it always constant since beams are a single projectile? |
My guess is that it would hit only once but I will try |
After a test quick test, it does hit only one ship |
I think I will add another tag "multi hit" to this PR as it kinda belongs to it |
added new "multi hit" tag, will update description |
Oh, this will make some of the things I was hoping to do roundabout through emitters much simpler :D How does this handle AoE? Every hit sets it off? |
yes |
This could make it hard to balance weapons, as they would deal incredible damage to largest ships (because they hit them multiple times) while doing tiny damage to the smallest ships (because they hit them only once).
That's an example of what I think this feature is not for. But also for the following reason:
The shot from the Emerald Sword's spinal weapon IS physical and should be able to be blocked by strong enough shields and armor. But it certainly gives this weapon some style when it pierces through a ship's hull. I just think it's not fair for large ships facing it, maybe add an option so that the damages are only dealt once per ship per projectile? |
the damage is dealt once per frame per ship per projectile, the merald swords projectiles have a lifetime of 1 so it would deal the same damage to every ship |
Yeah, it'd certainly match the in-game visuals then if it hit everything in a line and had the current AoE removed. This new functionality can fix that. |
I'm not seeing how this is different than #6276. If a projectile is still alive after hitting a ship, then it can hit another. I think it would be weird if this isn't the case (for weapons with just |
#6276 is different in the ability to have an upper limit of pixels doing damage, at which point it stops continuing to penetrate. Which would still be useful to also have. |
#6276 has a case where negative penetration values on a projectile result in that projectile having no hit limit. What's the distinction between that mechanic from my PR and the "untouchable" mechanic from this one? So "untouchable" just seems like a less customizable version of "penetration." |
I was not aware of that. In that case I would say this could serve as the basis for a more customisable version. |
The reason that #6276 was closed is because Tehhowch asked for something that would be a performance improvement to penetrating projectiles that I didn't have the time to work on when the PR was active. Realistically though, his suggestion would only be a major performance improvement in the case where a single projectile hits multiple ships in the same frame. (And even then, I don't imagine we'll EVER have a case where a projectile hits so many ships in the same frame that the current method of #6276 would cause the game to slow down.) I imagine that penetrating projectiles will still mainly be hitting a single ship each frame. The main case where you'd see multiple ships hit in the same frame would be for laser projectiles, but at that point it's probably worth asking where in vanilla we'd even be using this, and the only case right now (at least for a laser weapon) would be the Dragonflame (and maybe the Ember Tear, but that's such a rare appearance that it's probably negligible), which has a very high reload time, meaning that having a single frame every 3 seconds that could potentially be more performant probably isn't worth holding back the mechanic of penetration for. Point being, I think we should probably just reopen #6276, make any slight changes that are needed, merge it, and leave any potential minor performance improvement for the future so that we can at least make use of the penetration mechanic now. |
As long as the mechanic gets in I am fine with it, I just opened this so it gets in sooner. If you don't have the time to reopen it rn, I offer that I take over the PR. |
Important, this is not a replacement for #6276 as this does not allow for setting a maximum amount of hits, this is more thought for "field" like weapons that only interact with ships but are not something physical themself.
Feature Details
Adds a new tag, "untouchable" which prevents the projectile from disappearing when it hits a ship.
This can be used for deploy able, field like weapons as an example, as you don't want them to disappear once a ship enters that field. Other use cases would maybe be weapons that shoot dark matter, which only has gravitational impact on the world but pass through ships (I am not saying that's how dark matter really works, just giving an example).
This is just to give some examples, I could probably name some more if you need them.
Damage will be dealt per frame, which can result in very high damage numbers, content creators should keep that in mind.
Adds another tag "multi hit" that makes weapons able to hit multiple ships at the same time, useful for beam weapons. Only works in combination with "untouchable" as a projectile will die after the first hit otherwise.
UI Screenshots
2023-07-26.16-20-22.mp4
2023-07-27.14-46-49.mp4
Usage Examples
Testing Done
See the recording
Performance Impact
N/A