Skip to content
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

Boiler breakdown rate should depend on stuff #490

Closed
TheCycoONE opened this issue Dec 24, 2014 · 14 comments · Fixed by #1709
Closed

Boiler breakdown rate should depend on stuff #490

TheCycoONE opened this issue Dec 24, 2014 · 14 comments · Fixed by #1709
Labels
enhancement issue type Googlecode Origin P4 Low Priority S:Accepted State - Someone is interested in working on this but can still be picked up by someone else

Comments

@TheCycoONE
Copy link
Member

From henke@henke37.cjb.net on April 12, 2012 19:32:18

The boiler currently breaks randomly. According to the manual it should depend on the number of radiators and the number of handymen. I think that the set heating level should be a variable too.

Original issue: http://code.google.com/p/corsix-th/issues/detail?id=1220

@TheCycoONE
Copy link
Member Author

From mark.l1...@hotmail.co.uk on April 13, 2012 00:31:37

It may say that in the manual, but test it in TH and it is random

@TheCycoONE
Copy link
Member Author

From henke@henke37.cjb.net on April 18, 2012 16:52:54

Of course there still was a random part to it, but even random effects can be influenced by other variables.

@TheCycoONE
Copy link
Member Author

From mark.l1...@hotmail.co.uk on December 03, 2012 12:51:30

Issue 1392 has been merged into this issue.

@TheCycoONE
Copy link
Member Author

From maartenp...@hotmail.nl on April 01, 2013 07:17:12

Labels: -Priority-Medium Priority-Low

@TheCycoONE
Copy link
Member Author

From maartenp...@hotmail.nl on July 04, 2013 12:06:53

Status: Queued
Labels: Component-Logic

@Alberth289346 Alberth289346 added enhancement issue type and removed bug issue type labels Oct 27, 2015
@da4id
Copy link

da4id commented Jan 24, 2018

Im new in CorsixTH, but i know very well the orignal game. I've made some thougs about this issue which i want to discuss.

Boiler Breakdown should depend on

  • number of Handymens
  • number of Radiators
  • heating level
  • some random

My idea ist to have a breakdown score. Each day this score will be increased by some value depend on heating level, ratio radiators/handyman and some random value. If score reaches critical level boiler breaks down. But there should be some independent random part too.

The decision if boiler breaks down is now implemented with
local breakdown = math.random(1, 240)
if breakdown == 1 and not self.heating_broke and self.boiler_can_break and self.world.object_counts.radiator > 0 then
this gives average brekdown every 3 Months.

What do you think about having something like:
local breakdown = math.random(1, 10000)
self.boiler_breakdown_score += math.random()*self.radiator_heat*nb_radiators/nb_handyman

if (self.boiler_breakdown_score > criticalLevel or breakdown == 1) and not self.heating_broke and self.boiler_can_break and self.world.object_counts.radiator > 0 then

with a very low probability it is possible that you have multiple breakdowns within short time, because there is still some random part.
criticalLevel should be something like:
if you have 5 Radiators per Handyman and a heating level of 50% the boiler should breakdown in average after 5 years. This gives critical level = 5 years * 365 * 5 radiatorsPerHandyman / 4 = 2281.2

I've tested this algorithm in Matlab with 1000 runs and the boiler will breakdown between 58 and 63 months. If you run the same values but with 100% heating rate breakdown will occur every 28 to 32 months.

Im not sure about a good ratio radiators/handyman and average time for breakdown.
Do you think 5 years with 5 Radiators per Handyman is a good choice? Or should there be more Radiators per Handyman? Are 5 years to much? Is one or two years better?

@TheCycoONE
Copy link
Member Author

In my uninformed opinion both of the time frames are too long. Boiler breakdowns were a semiregular occurrence and most levels can be easily beaten before 5 years.

Did you measure the average breakdown rate and range in the original?

@da4id
Copy link

da4id commented Jan 25, 2018

Played yesterday the original game level 1 and 2.
Level 1 one year and boiler never broke down. Level 2 five years and it happened one time after 2 years. It was possible to finish layer 1 and 2 without any boiler break down. In level 2 i denied the next level message multiple times.
I build 30 radiators and employed 3 handymans.

Another thing that i noticed which could be related to this topic is that the stuff ask much more for salery in corsixTH than in the original game.

@mugmuggy
Copy link
Contributor

mugmuggy commented Jan 26, 2018

In the original, disasters are controlld by gbv.DisasterLaunch from what I can observe - this is days between disasters. When that ticks over, there is 25% chance of nothing happening, 50% chance of boiler breakdown (low or high heat) and 25% chance of a vomit wave, you can only get hit with one at a time.

Boiler breakdown and duration of breakdowns is affected by handyman/radiator ratios. A ratio of 1 handyman per 8 radiators or better appears to veto all of the breakdowns. Vomit waves get vetoed by some variable also.

So its possible to avoid breakdowns, and possible the game randomly doesn't give you the opportunity.

If a boiler breakdown is active, its duration is also affected by that ratio, if it goes 1 to 8 or better, then the remaining duration ticks down at twice the rate, if 1 to 5 or better, 3 times the rate.

Boiler breakdowns last randomly between 10-30 days.

@da4id
Copy link

da4id commented Jan 29, 2018

Thank you for your analysis.
How often is this disasterLaunch called?
With a ratio higher than 8 is it still possible to get hit by boiler breakdown?

@mugmuggy
Copy link
Contributor

How often is in the level configuration, but its every 150, 200, 300 days depending on difficulty. The original literally translates as; if 8 * handymancount < num_radiators then do setbreakdownparameters. The other code paths, just clean up the state so it doesn't interfere next time the function is called, as it is called to count down the duration of the breakdown also.

@da4id
Copy link

da4id commented Feb 4, 2018

I have now implemented it as in the original game.
Boiler will now breakdown every 200 days. This should depend on difficulty. how can I get the difficulty level in lua?

@TheCycoONE
Copy link
Member Author

From hospital self.world.map.difficulty is equal to easy, full, or hard

@lewri
Copy link
Member

lewri commented Jun 9, 2020

Link PR #1345 to this issue. But it might also be abandoned.

@lewri lewri linked a pull request Jul 21, 2020 that will close this issue
@lewri lewri added the S:Help wanted Development needed label Aug 1, 2020
@lewri lewri added S:Accepted State - Someone is interested in working on this but can still be picked up by someone else and removed S:Help wanted Development needed labels Sep 13, 2020
@lewri lewri added this to To do in 0.65 Release via automation Sep 14, 2020
@lewri lewri moved this from To do to In progress in 0.65 Release Sep 14, 2020
0.65 Release automation moved this from In progress to Done Sep 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement issue type Googlecode Origin P4 Low Priority S:Accepted State - Someone is interested in working on this but can still be picked up by someone else
Projects
No open projects
0.65 Release
  
Done
5 participants