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: New music for Galatia Academy (06/12/24)

Pages: [1] 2

Author Topic: [0.97a-RC11] Mirror 1.4 & DecoLib 0.3  (Read 36113 times)

Wyvern

  • Admiral
  • *****
  • Posts: 3806
    • View Profile
[0.97a-RC11] Mirror 1.4 & DecoLib 0.3
« on: November 02, 2022, 11:40:07 PM »

For when you really, really want your ships to be symmetrical.

Download Mirror v1.4
& Download DecoLib v0.3

Mirror is a simple mod that reflects most vanilla weapons, based on where they're installed on your ship. In general, weapons will be mirrored if they are to the left of the ship's centerline and facing forwards, or if they're to the right of the ship's centerline and facing backwards.

DecoLib is the library mod that contains the actual code for mirroring weapons, and is required for Mirror.

List of Mirrored Weapons
  • light dual autocannon
  • assault chaingun
  • heavy autocannon
  • heavy mortar
  • hypervelocity driver
  • thumper
  • hellbore cannon
  • mark IX autocannon
  • mjolnir cannon
  • mining laser
  • ion beam
  • autopulse laser
  • annihilator rocket launcher
  • atropos-class torpedo rack
  • breach SRM
  • gazer DEM SRM
  • gorgon DEM SRM
  • hammer-class torpedo
  • harpoon MRM
  • sabot SRM
  • swarmer SRM
  • annihilator rocket pod
  • breach srm pod
  • dragonfire DEM torpedo
  • gazer SRM pod
  • gorgon SRM pod
  • harpoon MRM pod
  • jackhammer
  • pilum LRM launcher
  • sabot SRM pod
  • salamander MRM pod
  • cyclone reaper launcher
  • hammer barrage
  • locust SRM launcher
  • pilum LRM catapult
  • squall MLRS
  • shock repeater
  • minipulser
  • volatile particle driver
  • cryoblaster
  • cryoflamer
  • antimatter SRM
  • resonator MRM
[close]
F.A.Q.
Q: Why the frogwaffles is this distributed as two separate mods?
A: Separating out DecoLib into its own thing makes it easy for other modders to establish a dependency on it, using its code without mandating that the player use Mirror. (Also, I've got plans for DecoLib; it's supposed to be a lot more than it currently is. There's a reason its version number started at 0.1 and not 1.0. Presumably it'll get its own thread at some point.)

Q: So, uh, what about weapons that are on the centerline, or that are facing directly left or right?
A: In general, 'on the centerline' counts as 'right', and facing directly left/right counts as 'forward' - however, there are no guarantees. Sometimes a weapon mount might look as if it's on the centerline, but it isn't exactly. Similarly, weapons that appear to be facing directly left or right may not have the expected value for 'forwardsness'. I've added a 0.1 degree fudge factor to account for some ORA hulls having weapon mounts that look like they're facing directly to the side, but are actually pointed a tiny fraction of a degree backwards. If you've got a specific example of this code doing the 'wrong' thing, let me know, and I'll see what I can do about it.

Q: Why didn't you mirror vanilla weapon X?
A: Probably just forgot about it - I didn't mirror literally everything, just the weapons where I thought it might matter. If you think there's something I missed, let me know and I'll take a look.

Q: Why did you mirror weapons like the Mjolnir? That's already symmetrical!
A: It's subtle, but try putting two Mjolnir cannons on a Dominator with linked fire. Vanilla behavior has them firing their left barrels, then their right barrels, then left again, etc.  With mirroring active, they instead fire outside barrels, then inside barrels, etc. (Of course, in actual combat, this can easily get out of sync. Still, I think it's a neat effect.)

Q: Why didn't you mirror mod-added weapon Y?
A: First, it's rude to make a mod that changes the behavior of other people's mods. Second, if I made this mirror weapons from some other mod, I'd need to also make this depend on that other mod, and that'd be extraordinarily inconvenient for anyone who doesn't run with that other mod. So, no, I will not be mirroring mod-added weaponry.

Q: So... how hard is it for someone else to mirror mod-added weaponry?
A: Nothing in Mirror is deliberately obfuscated. If you're a mod author and want to use DecoLib to mirror your own weaponry - it should be pretty easy to figure out how to do that, and you're welcome to ask me for help if you need it. If you're not a mod author, and want to create a personal mod to mirror specific weapons... well, that could be a bit trickier.

Q: Hey, I made this mod that mirrors someone else's mod-added weaponry! Could you put a link to it in your post?
A: No. See: it's rude to make a mod that changes the behavior of other people's mods. You are welcome to construct such mods for your own personal use (as long as you understand that you're basically voiding the warranty - mod authors will be understandably upset if you report a bug with 'their' mod and it turns out to be something you broke in your own personal tinkering), but you are not welcome to distribute such mods. (Unless, of course, you have explicit permission from the original mod's author, in which case distribute away.)
[close]
Changelog
  • Mirror 1.4
    • Added mirroring for ion beams and mining lasers
  • Mirror 1.3
    • Updated for Starsector 0.97a
    • Fixed a bug where the Volatile Particle Driver's default WeaponEffectPlugin was accidentally overwritten
  • DecoLib 0.3
    • Updated for Starsector 0.97a
    • Changed mod to work via included jar file instead of uncompiled scripts
    • The source code is still included; you can find it inside the jar
  • Mirror 1.2
    • Added mirroring for most missile weapons
  • Mirror 1.1
    • Updated for Starsector 0.96a
    • Added mirroring for Assault Chaingun and Thumper
  • DecoLib 0.2
    • Updated for Starsector 0.96a
    • Implemented mirroring for animated weapons
    • Added a 0.1 degree margin of error for deciding that a weapon counts as pointing forwards
      • i.e. 'forwards' is considered to be turret angles from -90.1 to 90.1
      • this is relevant for ORA hulls, whose turret layouts include subtle asymmetries to help address AI issues with broadside ships.
    • Removed special handling intended for 0.95.1's buggy asymmetric missile turrets
  • Mirror 1.0
    • Initial release for Starsector 0.95.1a
  • DecoLib 0.1
    • Initial release for Starsector 0.95.1a
[close]
Credits:
 • Tecrys and Xenoargh, whose initial work on weapon mirroring provided the prototype for being able to do this at all.
 • Alex, who has repeatedly added features and fixed issues in order to make weapon mirroring work consistently across all most* contexts.

* And the contexts where it doesn't work don't matter for Mirror, as they're situations where modular weapons don't display in the first place.
« Last Edit: March 11, 2024, 11:27:13 AM by Wyvern »
Logged
Wyvern is 100% correct about the math.

Wyvern

  • Admiral
  • *****
  • Posts: 3806
    • View Profile
Re: [0.96a-RC10] Mirror 1.1 & DecoLib 0.2
« Reply #1 on: May 25, 2023, 01:33:48 PM »

Mod updated for Starsector 0.96.

Implemented mirroring for assault chaingun and thumper.

Now mirroring asymmetric missiles in turret mounts (without having to explicitly set a setting for it), as the Starsector bug that caused issues with this was fixed in 0.96.
Logged
Wyvern is 100% correct about the math.

lustfull

  • Commander
  • ***
  • Posts: 106
    • View Profile
Re: [0.96a-RC10] Mirror 1.1 & DecoLib 0.2
« Reply #2 on: June 06, 2023, 09:27:54 AM »

Just, thank you.
Logged

sb

  • Ensign
  • *
  • Posts: 4
    • View Profile
Re: [0.96a-RC10] Mirror 1.1 & DecoLib 0.2
« Reply #3 on: June 07, 2023, 12:10:27 PM »

Quote from: Wyvern
Q: Why didn't you mirror vanilla weapon X?
A: Probably just forgot about it - I didn't mirror literally everything, just the weapons where I thought it might matter. If you think there's something I missed, let me know and I'll take a look.
Squall, that asymetric piece of ***!
Logged

Zr0Potential

  • Commander
  • ***
  • Posts: 112
    • View Profile
Re: [0.96a-RC10] Mirror 1.1 & DecoLib 0.2
« Reply #4 on: June 07, 2023, 03:09:50 PM »

Quote from: Wyvern
Q: Why didn't you mirror vanilla weapon X?
A: Probably just forgot about it - I didn't mirror literally everything, just the weapons where I thought it might matter. If you think there's something I missed, let me know and I'll take a look.
Squall, that asymetric piece of ***!

And Swarmer SRM too please
Logged

Wyvern

  • Admiral
  • *****
  • Posts: 3806
    • View Profile
Re: [0.96a-RC10] Mirror 1.2 & DecoLib 0.2
« Reply #5 on: June 07, 2023, 06:23:04 PM »

...Huh, I guess the Squall is asymmetric, if just barely. Okay then.
...Same goes for Swarmer.

Fine.

Now mirroring: Cyclone Reaper, Squall MLRS, Pilum LRM Catapult, Dragonfire DEM Torpedo, Gorgon SRM Pod, Gazer SRM Pod (Does anyone else find it weird that this shows four missiles but fires two at a time?), Annihilator Rocket Pod, Harpoon MRM Pod, Pilum LRM Launcher, Gorgon DEM SRM, Gazer DEM SRM, Swarmer SRM Launcher.

Edit: To note, these are the missile weapons that weren't previously mirrored, but now are. The total list of mirrored missile weapons is a bit more extensive.
« Last Edit: June 07, 2023, 06:27:15 PM by Wyvern »
Logged
Wyvern is 100% correct about the math.

Wyvern

  • Admiral
  • *****
  • Posts: 3806
    • View Profile
Re: [0.96a-RC10] Mirror 1.2 & DecoLib 0.2
« Reply #6 on: August 10, 2023, 12:09:50 PM »

Updated OP with list of mirrored weapons (hm, next version should include mining lasers and ion beams); also added credits (whooops, that should've been there from the start...)
Logged
Wyvern is 100% correct about the math.

Tecrys

  • Admiral
  • *****
  • Posts: 607
  • repair that space elevator!
    • View Profile
Re: [0.96a-RC10] Mirror 1.2 & DecoLib 0.2
« Reply #7 on: September 14, 2023, 10:16:33 AM »

Wow! This has evolved so much since I last saw the code.
I'm really happy that it works in all instances now and I will definitely incorporate it into SVC since it will lower vram impact immensely.
Amazing!
Logged
Symbiotic Void Creatures 0.5.0-alpha for 0.97a is out
https://fractalsoftworks.com/forum/index.php?topic=28010.0

Wyvern

  • Admiral
  • *****
  • Posts: 3806
    • View Profile
Re: [0.96a-RC10] Mirror 1.2 & DecoLib 0.2
« Reply #8 on: September 14, 2023, 10:22:55 AM »

Glad to hear that!

If you need any help with getting this to work with your mod, please don't hesitate to reach out; my primary goal with DecoLib is, in fact, making it easier to make space monsters.

...Which is why DecoLib is only on version 0.2; mirroring is nice, but something like, oh, a space dragon, needs animated tail/neck segments at a minimum. (And, sure, that's technically doable with multi-module ships ala the old Kingdom of Terra mod, but I'd rather do it with deco weapons. Still a work in progress, there, though.)
Logged
Wyvern is 100% correct about the math.

Tecrys

  • Admiral
  • *****
  • Posts: 607
  • repair that space elevator!
    • View Profile
Re: [0.96a-RC10] Mirror 1.2 & DecoLib 0.2
« Reply #9 on: September 19, 2023, 07:07:17 AM »

I'm done with mirror code integration.

Unfortunately it didn't work out to use DecoLib as a library but I'll make sure to include a link to it in all places I make SVC available for download.

Thanks again for making this and poking Alex until he implemented that method!
Logged
Symbiotic Void Creatures 0.5.0-alpha for 0.97a is out
https://fractalsoftworks.com/forum/index.php?topic=28010.0

Wyvern

  • Admiral
  • *****
  • Posts: 3806
    • View Profile
Re: [0.96a-RC10] Mirror 1.2 & DecoLib 0.2
« Reply #10 on: September 19, 2023, 08:31:17 AM »

I'm done with mirror code integration.
Cool!

Unfortunately it didn't work out to use DecoLib as a library but I'll make sure to include a link to it in all places I make SVC available for download.
Can I ask why it didn't work? (To clarify: I have exactly zero problem with you just including the needed code in your mod - the question here is aimed at "What can I do to make DecoLib more useful to people in the future?")

Thanks again for making this and poking Alex until he implemented that method!
You are welcome, and thank you for your original tinkering with this stuff, too.
Logged
Wyvern is 100% correct about the math.

Tecrys

  • Admiral
  • *****
  • Posts: 607
  • repair that space elevator!
    • View Profile
Re: [0.96a-RC10] Mirror 1.2 & DecoLib 0.2
« Reply #11 on: September 19, 2023, 10:50:16 AM »

Not being compiled in a .jar was the problem. I had no way of telling IntelliJ to use DecoLib as a library.
But I'm also not very knowledgable in these kinds of things so I might just have overlooked how.
Logged
Symbiotic Void Creatures 0.5.0-alpha for 0.97a is out
https://fractalsoftworks.com/forum/index.php?topic=28010.0

Wyvern

  • Admiral
  • *****
  • Posts: 3806
    • View Profile
Re: [0.96a-RC10] Mirror 1.2 & DecoLib 0.2
« Reply #12 on: September 19, 2023, 10:52:23 AM »

Fair enough! I left it out of a jar because that was more convenient for my own early development, but I did already have plans that the next version of DecoLib would be distributed as a jar rather than as loose .java files.
Logged
Wyvern is 100% correct about the math.

XyttheElite117

  • Ensign
  • *
  • Posts: 34
  • Halo fanatic
    • View Profile
Re: [0.96a-RC10] Mirror 1.2 & DecoLib 0.2
« Reply #13 on: March 02, 2024, 02:11:29 AM »

I  really like this mod, it satisfies my OCD. Will there be a 0.97 update or does it work with a simple version change, for both this and the decolib?
Logged
Wort wort wort

Wyvern

  • Admiral
  • *****
  • Posts: 3806
    • View Profile
Re: [0.96a-RC10] Mirror 1.2 & DecoLib 0.2
« Reply #14 on: March 02, 2024, 06:50:38 AM »

Yes, and also yes.

I will absolutely be updating this for 0.97 at some point.

But it does also work with a simple version change, so you don't need to wait on me.
Logged
Wyvern is 100% correct about the math.
Pages: [1] 2