Author Topic: Damage Control - Question on how fast it repairs  (Read 3887 times)

0 Members and 1 Guest are viewing this topic.

Offline Steve Walmsley

  • Aurora Designer
  • Star Marshal
  • S
  • Posts: 11692
  • Thanked: 20538 times
Steve, if you can shed any light on how DC actually works, that would be awesome.  I, for one, would love to have regenerating ships that just say 'screw you' to internal damage (if combined with internal armor).  Only issue with a self-regenerating ship would be of course maintenance supplies and the loss of crew when something gets blown up.  Might run out of crew..

The psuedo code is as follows:

Repair Chance = Round Down ((Increment Length in Seconds / Item Cost) x Highest Damage Control Rating*)

If Repair Chance > 1000 Then
    Repair Done = True
Else
    If Random Number(1000) <= Repair Chance Then
        Repair Done = True
    End
End

* This is usually the damage control rating of the ship. However, if the ship is in a hangar and the mothership has a higher damage control rating, then the damage control rating of the mothership is used. This could be used by fighters on a carrier or it could be a huge repair ship that takes full size ships into its internal hangar. In this case, the maintenance supplies of the mothership are used.
« Last Edit: August 09, 2012, 03:01:05 PM by Steve Walmsley »
 

Offline Crustypeanut (OP)

  • Petty Officer
  • **
  • Posts: 25
  • Ph.Dwarf & Practitioner of !!MEDICINE!!
Re: Damage Control - Question on how fast it repairs
« Reply #16 on: August 09, 2012, 01:11:32 PM »
Hm.. Ok so if the repair chance is over 1000 (Aka if you have a metric frakkton of DC or the item is cheap) its repaired much easier, otherwise it can be EXTREMELY variable.

Am I getting that correctly?

For example, say I have 500 DC, and am trying to repair a 500-item cost piece of equipment in 5-second intervals.  Considering that the repair chance in that case is only 5, ((5 / 500) x 500), then basically thats a .5% chance to repair per 5 second interval as it requires it to roll a 1-5 in 1000?

Now if I do it in 30 second or 2 minute intervals, it would end up being ((30 / 500) x 500) and ((120 / 500) x 500) or basically 3% and 12% respectively to repair it.

Hm.. At least this allows me to calculate the estimated chance of repair, if I understand this correctly.


Thanks for the information Steve :D
 

Offline Erik L

  • Administrator
  • Admiral of the Fleet
  • *****
  • Posts: 5657
  • Thanked: 372 times
  • Forum Admin
  • Discord Username: icehawke
  • 2020 Supporter 2020 Supporter : Donate for 2020
    2022 Supporter 2022 Supporter : Donate for 2022
    Gold Supporter Gold Supporter : Support the forums with a Gold subscription
    2021 Supporter 2021 Supporter : Donate for 2021
Re: Damage Control - Question on how fast it repairs
« Reply #17 on: August 09, 2012, 01:20:54 PM »
The way I'm reading Steve's p-code is the best rating, not cumulative, i.e. DC and Advanced DC, it uses the advanced DC rating, not adding them.

Offline Crustypeanut (OP)

  • Petty Officer
  • **
  • Posts: 25
  • Ph.Dwarf & Practitioner of !!MEDICINE!!
Re: Damage Control - Question on how fast it repairs
« Reply #18 on: August 09, 2012, 02:40:00 PM »
Then why can ships have say, 500 Damage Control rating? If that were the case, they wouldn't stack in the ship design, nor would Engineering Spaces also add 1 Damage Control rating each.

Plus I've found it faster when you add more Damage Control.  Ships with a few engineering spaces and 1 damage control (Say 15 rating) repair monumentally slow compared to one with 500 damage control rating.

Though I do see what you're talking about, and it is why I wasn't 100% positive if I was getting it right.
 

Offline Steve Walmsley

  • Aurora Designer
  • Star Marshal
  • S
  • Posts: 11692
  • Thanked: 20538 times
Re: Damage Control - Question on how fast it repairs
« Reply #19 on: August 09, 2012, 02:58:41 PM »
The variable I used in code is called BestDamageControlRating. It's actually the damage control rating of the ship or its mothership (if it is in a hangar), whichever is higher, so the psuedo code is misleading - I'll edit it.

Steve