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)

Author Topic: [0.65.1a] Armor Repair Hullmod v0.3  (Read 6692 times)

orost

  • Captain
  • ****
  • Posts: 436
    • View Profile
[0.65.1a] Armor Repair Hullmod v0.3
« on: January 24, 2015, 03:35:37 AM »

There's nothing to repair armor in-battle in SS, and I think it's weird. So here is a mod.


Current version: 0.3 (released 26 Jan 2015)
Dependencies: none!
Download link
Previous versions

The Armor Repair Hullmod will repair your ship's armor in battle, following these rules:

  • Repair starts only when the damaged armor cell hasn't taken any damage for a while (10 seconds) and is interrupted when the cell takes damage again.
  • Each cell is tracked individually. Some recently-hit cells may be still waiting for their 10 seconds to pass while other are repairing or have finished their repairs.
  • Only a fraction of damage is repaired, starting at 80%.
  • The repair isn't infinite. As the hullmod works, the fraction of damage repaired will begin to deteriorate, reaching zero when total damage repaired reaches ten times of the ship's armor rating. If you're curious, the curve looks like this.
  • As it works, the hullmod drains CR, up to 10% per battle. (10% of CR drained concides with repair efficiency dropping to 0)
  • It won't repair any pre-existing damage.


Known issues and planned changes:
  • Placeholder icon: I have the artistic capability of a dead frog, so I just reused the stock Heavy Armor icon. If you like the mod and would like to contribute something better, that would be hugely appreciated.
  • Statusbar indicator: I would like to add an indicator to the statusbar on the left showing that repairs are in progress, and maybe how many armor cells are being repaired. If you know a reasonable way to do it, please let me know.
  • Balancing: Most values have been pulled straight out of my bum. The hullmod is probably overpowered. I haven't given it an unlock requirement. After I play with it for a while, I might adjust some of that. If you have any input, feel free to give it and I'll take it into account.
  • Saner formulas: Some formulas, such as the efficiency curve, are not quite there. I'll keep thinking about them.

Changelog:

Code
v0.3 (released 26 Jan 2015)
- Fixed: major breakage when more than one ship has the hullmod
- The code is now compiled into a .jar. This makes customization more difficult - the source is still included, but you'll have to compile it if you make any changes. Sorry, Janino just doesn't cut it.
- All ships given a base repair rate of 0.2 HP per cell per second in addition to the 1% per second. This will barely affect heavily armored ships, but will give ones with weak armor a non-negligible repair rate.
v0.2 (released 25 Jan 2015)
- Total repair capacity now scales with ship's total armor HP, not armor rating
- Expanded and improved in-game description
- Added comments to explain customizable constants
- Added image (curves.png) to illustrate effects of changing the EFFICIENCY_CURVE_POWER constant
v0.1 (released 24 Jan 2015)
- Initial release
« Last Edit: April 05, 2015, 12:48:26 AM by orost »
Logged

Nicke535

  • Commander
  • ***
  • Posts: 240
  • Degenerate Core
    • View Profile
Re: [0.65.1a] Armor Repair Hullmod v0.1
« Reply #1 on: January 24, 2015, 12:40:19 PM »

This seems like a really good idea, actually! I have seen (and created(sort of)) armor repairing systems and weapons before, but never a hullmod.

Best of luck!

Wyvern

  • Admiral
  • *****
  • Posts: 3784
    • View Profile
Re: [0.65.1a] Armor Repair Hullmod v0.1
« Reply #2 on: January 24, 2015, 01:15:44 PM »

This is nice; while I haven't played with the mod in-game yet*, I am planning a faction of ships that rely on armor and hull regeneration instead of shields; having an example of this will be useful.

_____
* In part because my normal play style regards taking damage to armor at all as a sign that I goofed; if my shields can't take the hit, I shouldn't have been there.  Though, hm.  I have a small pile of Templar ships lying around; regenerating armor would be really useful for them, since they don't have conventional shields...
Logged
Wyvern is 100% correct about the math.

Midnight Kitsune

  • Admiral
  • *****
  • Posts: 2846
  • Your Friendly Forum Friend
    • View Profile
Re: [0.65.1a] Armor Repair Hullmod v0.1
« Reply #3 on: January 24, 2015, 02:20:46 PM »

The only problem you are going to run into with this is that you can't remove "damage decals" in battle. This is also why many modders have not built something like this. Hell, Exi would have had this if it weren't for that issue
Logged
Help out MesoTroniK, a modder in need

2021 is 2020 won
2022 is 2020 too

orost

  • Captain
  • ****
  • Posts: 436
    • View Profile
Re: [0.65.1a] Armor Repair Hullmod v0.1
« Reply #4 on: January 24, 2015, 11:28:49 PM »

The only problem you are going to run into with this is that you can't remove "damage decals" in battle. This is also why many modders have not built something like this. Hell, Exi would have had this if it weren't for that issue

Yeah, at least this will never repair armor back to 100% so the decals staying is not that bad. But if I wanted to make a more expensive variant that can repair fully it would be a bit weird.
Logged

Tommy

  • Commander
  • ***
  • Posts: 150
    • View Profile
Re: [0.65.1a] Armor Repair Hullmod v0.1
« Reply #5 on: January 25, 2015, 12:43:22 AM »

Isn't visual damage based on hull damage ? Or armor aswell ?
Logged

orost

  • Captain
  • ****
  • Posts: 436
    • View Profile
Re: [0.65.1a] Armor Repair Hullmod v0.1
« Reply #6 on: January 25, 2015, 07:45:04 AM »

Minor update:

Code
v0.2 (released 25 Jan 2015)
- Total repair capacity now scales with ship's total armor HP, not armor rating
- Expanded and improved in-game description
- Added comments to explain customizable constants
- Added image (curves.png) to illustrate effects of changing the EFFICIENCY_CURVE_POWER constant
Logged

orost

  • Captain
  • ****
  • Posts: 436
    • View Profile
Re: [0.65.1a] Armor Repair Hullmod v0.2
« Reply #7 on: January 25, 2015, 10:18:53 PM »

This update brought to you by this guy:

Spoiler
[close]

So it turns out that my assumption that every ship gets an instance of the hullmod class is wrong. There's only one, and it needs to handle all the ships that have the hullmod. Which requires a pretty significant rewrite. Which required me to use generics. Which are not supported by Janino, the compiler built into Starsector. Which meant I had to set up an IDE and build .jars myself. Bloody hell!

Code
v0.3 (released 26 Jan 2015)
- Fixed: major breakage when more than one ship has the hullmod
- The code is now compiled into a .jar. This makes customization more difficult - the source is still included, but you'll have to compile it if you make any changes. Sorry, Janino just doesn't cut it.
- All ships given a base repair rate of 0.2 HP per cell per second in addition to the 1% per second. This will barely affect heavily armored ships, but will give ones with weak armor a non-negligible repair rate.
« Last Edit: January 25, 2015, 10:41:57 PM by orost »
Logged