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.9.1a RC8] Doom overloads when using system while phased  (Read 1888 times)

Avanitia

  • Commander
  • ***
  • Posts: 123
  • Local Egg Demon
    • View Profile
[0.9.1a RC8] Doom overloads when using system while phased
« on: September 15, 2019, 02:37:33 AM »

What topic says - you can actually overload when using Mine Strike when phased. It requires very specific timing on player's part - but it's doable. You have to use system when using it will put your flux to exact flux capacity of your ship.
I'm guessing it's a side effect of system being usable when phased.

Here's the screenshot:

and video of this "issue" (I don't know if that's intended or not):
https://youtu.be/hKsdtl8rG04

I used Practice Targets by Tartiflette to better illustrate the issue (and to have something for weapons to shoot)
Logged
You haven't played Starsector unless your storage has one thousand Vulcans in it.

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23988
    • View Profile
Re: [0.9.1a RC8] Doom overloads when using system while phased
« Reply #1 on: September 15, 2019, 08:34:04 AM »

Hmm, interesting. What happens is your flux is maxed (or near it), then the phase cloak increases it past maximum (causing an overload), and, well, that's it. In theory your dissipation would then reduce your soft flux to below-maximum but that step happens after the overload has already begun.

It's not specifically intended, but it's also a consequence of how the system works, so I don't want to try to hack around it. Definitely an odd edge case, though!

(Edit: seems like you could probably get the same thing to happen with shields and firing juust right - I wonder. But, ahh! Shields can't overload with their flux generation, while phasecloak can.)
Logged

Wyvern

  • Admiral
  • *****
  • Posts: 3786
    • View Profile
Re: [0.9.1a RC8] Doom overloads when using system while phased
« Reply #2 on: September 15, 2019, 09:07:41 AM »

Speaking of phase cloaks and overloads, I've now seen the AI overload itself with a phase cloak once.  It looks like it only happens under extreme edge cases, though, when the ship has just enough flux capacity available to phase out, but not enough for phase out + one tick of cloak maintenance cost.

It's a super-rare behavior, though, and I don't think we'd lose anything by just making phasing fail or cancel when your flux is full.
(Edit: Similar, I suppose, to how you can occasionally have your shields turn themselves off when you're full on flux and still trying to fire with shields up.)
Logged
Wyvern is 100% correct about the math.

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23988
    • View Profile
Re: [0.9.1a RC8] Doom overloads when using system while phased
« Reply #3 on: September 15, 2019, 09:46:43 AM »

Hmm. Might be worth looking at, yeah. But then phase ships can't overload in any way, and that feels a little weird.
Logged

TaLaR

  • Admiral
  • *****
  • Posts: 2794
    • View Profile
Re: [0.9.1a RC8] Doom overloads when using system while phased
« Reply #4 on: September 15, 2019, 09:51:28 AM »

Hmm. Might be worth looking at, yeah. But then phase ships can't overload in any way, and that feels a little weird.

Is it though? For normal ships overload has element of choice - blocking a big projectile and eating overload can be preferable to letting it hit.
For phase cloak it's a pure mistake, and due to much lower variance of changes (no spikes from outgoing or incoming fire) usually easily avoidable.
Logged

Wyvern

  • Admiral
  • *****
  • Posts: 3786
    • View Profile
Re: [0.9.1a RC8] Doom overloads when using system while phased
« Reply #5 on: September 15, 2019, 09:58:27 AM »

Oh, thanks for moving this thread to suggestions - I'd thought it was already here.  Oops.

And as for "weird" - is it really any weirder than any other shield-less ship being unable to overload?
Logged
Wyvern is 100% correct about the math.

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23988
    • View Profile
Re: [0.9.1a RC8] Doom overloads when using system while phased
« Reply #6 on: September 15, 2019, 10:12:58 AM »

Ok, that's very fair on both counts.

(Edit: did this.)
« Last Edit: September 15, 2019, 10:23:58 AM by Alex »
Logged

Avanitia

  • Commander
  • ***
  • Posts: 123
  • Local Egg Demon
    • View Profile
Re: [0.9.1a RC8] Doom overloads when using system while phased
« Reply #7 on: September 15, 2019, 11:45:38 AM »

Hmm, interesting. What happens is your flux is maxed (or near it), then the phase cloak increases it past maximum (causing an overload), and, well, that's it. In theory your dissipation would then reduce your soft flux to below-maximum but that step happens after the overload has already begun.

It's not specifically intended, but it's also a consequence of how the system works, so I don't want to try to hack around it. Definitely an odd edge case, though!

(Edit: seems like you could probably get the same thing to happen with shields and firing juust right - I wonder. But, ahh! Shields can't overload with their flux generation, while phasecloak can.)

In my case I thought I got to 10000 flux (base capacity) by using the system - and ship overloads when it hits the cap, which is what happened.
That screenshot I got was the best thing I could get reliably - I don't exactly want to go frame-by-frame and find exact moment I use the system, hit 10000 flux by doing so and overload  :D

I thought Phase Cloak overwrites the soft flux with hard flux? That's not a thing?
Only thing that gives soft flux to phase ship are its guns and the system as far as I am concerned.
Logged
You haven't played Starsector unless your storage has one thousand Vulcans in it.

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23988
    • View Profile
Re: [0.9.1a RC8] Doom overloads when using system while phased
« Reply #8 on: September 15, 2019, 11:53:23 AM »

In my case I thought I got to 10000 flux (base capacity) by using the system - and ship overloads when it hits the cap, which is what happened.
That screenshot I got was the best thing I could get reliably - I don't exactly want to go frame-by-frame and find exact moment I use the system, hit 10000 flux by doing so and overload  :D

I thought Phase Cloak overwrites the soft flux with hard flux? That's not a thing?
Only thing that gives soft flux to phase ship are its guns and the system as far as I am concerned.

The ship overloads when it exceeds the cap, not when it hits the cap. Phase cloak adds hard flux, which means that if say you have 1000 hard flux, and 2000 soft flux, and you add 100 hard flux to it, you'd have 1100 hard flux and 2100 soft flux.
Logged

Avanitia

  • Commander
  • ***
  • Posts: 123
  • Local Egg Demon
    • View Profile
Re: [0.9.1a RC8] Doom overloads when using system while phased
« Reply #9 on: September 15, 2019, 01:11:07 PM »

In my case I thought I got to 10000 flux (base capacity) by using the system - and ship overloads when it hits the cap, which is what happened.
That screenshot I got was the best thing I could get reliably - I don't exactly want to go frame-by-frame and find exact moment I use the system, hit 10000 flux by doing so and overload  :D

I thought Phase Cloak overwrites the soft flux with hard flux? That's not a thing?
Only thing that gives soft flux to phase ship are its guns and the system as far as I am concerned.

The ship overloads when it exceeds the cap, not when it hits the cap. Phase cloak adds hard flux, which means that if say you have 1000 hard flux, and 2000 soft flux, and you add 100 hard flux to it, you'd have 1100 hard flux and 2100 soft flux.

Okay, bit of derp on my side about overloads :P

And now I'm confused about cloak.
Assume we're in phase ship, I have around half of my capacity in soft flux.
When I activate phase cloak I get hard flux equal to activation cost, then as I keep being phased, I get more hard flux (due to soft flux being overwritten by hard flux), but my overall flux keeps dropping due to soft flux being dissipated, as long as there's soft flux to dissipate.

That means I overloaded myself by going over the cap by using the system, which shouldn't really
happen?
And on screenshot I included (though it's not really that good, so it can be hard to see) - around 4/5th of capacity is hard flux, rest if soft flux, so...

I don't know anymore :P
Logged
You haven't played Starsector unless your storage has one thousand Vulcans in it.

sotanaht

  • Captain
  • ****
  • Posts: 297
    • View Profile
Re: [0.9.1a RC8] Doom overloads when using system while phased
« Reply #10 on: September 15, 2019, 01:32:22 PM »

In my case I thought I got to 10000 flux (base capacity) by using the system - and ship overloads when it hits the cap, which is what happened.
That screenshot I got was the best thing I could get reliably - I don't exactly want to go frame-by-frame and find exact moment I use the system, hit 10000 flux by doing so and overload  :D

I thought Phase Cloak overwrites the soft flux with hard flux? That's not a thing?
Only thing that gives soft flux to phase ship are its guns and the system as far as I am concerned.

The ship overloads when it exceeds the cap, not when it hits the cap. Phase cloak adds hard flux, which means that if say you have 1000 hard flux, and 2000 soft flux, and you add 100 hard flux to it, you'd have 1100 hard flux and 2100 soft flux.

Okay, bit of derp on my side about overloads :P

And now I'm confused about cloak.
Assume we're in phase ship, I have around half of my capacity in soft flux.
When I activate phase cloak I get hard flux equal to activation cost, then as I keep being phased, I get more hard flux (due to soft flux being overwritten by hard flux), but my overall flux keeps dropping due to soft flux being dissipated, as long as there's soft flux to dissipate.

That means I overloaded myself by going over the cap by using the system, which shouldn't really
happen?
And on screenshot I included (though it's not really that good, so it can be hard to see) - around 4/5th of capacity is hard flux, rest if soft flux, so...

I don't know anymore :P
It's not overwritten and Alex does a poor job of explaining.

Better to think of it like this, Soft and Hard flux are too separate things.  You have 1000 soft and 1000 hard, equaling to 2000 total flux.  You gain 100 hard flux because you used your phase cloak, but in that same time you lost 200 soft flux from dissipation, you now have 1100+800=2100 total flux.  The soft flux was not "replaced", you simply lost some soft and gained some hard.

The way he describes it, Soft flux and total flux are interchangeable terms.  It's easier to see the effect though if you consider them as 3 separate numbers.  The way it works in game is the same.


As for why the overload happens, it's because dissipation and maintenance flux aren't exactly continuous, and they update at different times.  Say you had 1499 total flux out of 2000 max flux.  In one instant of game you gained 500 flux from using the ship system and 2 flux from maintenance.  You would have then lost 3 flux from dissipation, but because that calculation hasn't happened yet, you are now at 2001 total flux out of 2000 max, meaning you overloaded.

It might be somewhat more intuitive to design the system to calculate maintenance minus dissipation together and only update total flux once instead of twice.  That's the way it probably works in your head, but in the game it's different.  But then, soft and hard flux totals still have to be adjusted separately each tick, so that probably just complicates things.
« Last Edit: September 15, 2019, 01:40:47 PM by sotanaht »
Logged

Avanitia

  • Commander
  • ***
  • Posts: 123
  • Local Egg Demon
    • View Profile
Re: [0.9.1a RC8] Doom overloads when using system while phased
« Reply #11 on: September 15, 2019, 01:43:59 PM »

It's not overwritten and Alex does a poor job of explaining.

Better to think of it like this, Soft and Hard flux are too separate things.  You have 1000 soft and 1000 hard, equaling to 2000 total flux.  You gain 100 hard flux because you used your phase cloak, but in that same time you lost 200 soft flux from dissipation, you now have 1100+800=2100 total flux.  The soft flux was not "replaced", you simply lost some soft and gained some hard.

The way he describes it, Soft flux and total flux are interchangeable terms.  It's easier to see the effect though if you consider them as 3 separate numbers.  The way it works in game is the same.


As for why the overload happens, it's because dissipation and maintenance flux aren't exactly continuous, and they update at different times.  Say you had 1499 total flux out of 2000 max flux.  In one instant of game you gained 500 flux from using the ship system and 2 flux from maintenance.  You would have then lost 3 flux from dissipation, but because that calculation hasn't happened yet, you are now at 2001 total flux out of 2000 max, meaning you overloaded.

It might be somewhat more intuitive to design the system to calculate maintenance minus dissipation together and only update total flux once instead of twice.  That's the way it probably works in your head, but in the game it's different.  But then, soft and hard flux totals still have to be adjusted separately each tick, so that probably just complicates things.

Oooooooooooooh, I didn't know that!
That's for explanation on how it exactly works.
Logged
You haven't played Starsector unless your storage has one thousand Vulcans in it.

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23988
    • View Profile
Re: [0.9.1a RC8] Doom overloads when using system while phased
« Reply #12 on: September 15, 2019, 01:53:45 PM »

Yeah, I definitely should've said "total flux" instead of "soft flux". That's what the game keeps track of, anyway - the total flux, and how much of it is "hard".

It might be somewhat more intuitive to design the system to calculate maintenance minus dissipation together and only update total flux once instead of twice.  That's the way it probably works in your head, but in the game it's different.  But then, soft and hard flux totals still have to be adjusted separately each tick, so that probably just complicates things.

I see what you're saying, but that gets a bit weird, too - what happens when multiple projectiles hit shields on the same frame? What about when there are multiple sources of dissipation (say, one via a script or a ship system)? It's more straightforward just to apply flux changes right away, since there are going to be some potentially odd edge cases regardless.
Logged

Midnight Kitsune

  • Admiral
  • *****
  • Posts: 2846
  • Your Friendly Forum Friend
    • View Profile
Re: [0.9.1a RC8] Doom overloads when using system while phased
« Reply #13 on: September 15, 2019, 06:20:19 PM »

Hey Alex, do you think you could add in something to the API that would allow mods to have ships that overload when using their Not Phase, Right Click Systems?
Logged
Help out MesoTroniK, a modder in need

2021 is 2020 won
2022 is 2020 too

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23988
    • View Profile
Re: [0.9.1a RC8] Doom overloads when using system while phased
« Reply #14 on: September 15, 2019, 06:32:53 PM »

It would only be an issue if those systems had "type":"PHASE_CLOAK", which it seems like that'd be kind of odd - there's *a lot* of phase-cloak-specific code in the class that handles it, aside from the overload.

Edit:
Added "canNotCauseOverload" to .system files; defaults to false, used by type:PHASE_CLOAK systems only
« Last Edit: September 15, 2019, 06:46:45 PM by Alex »
Logged
Pages: [1] 2