Cabin Fever: Use exponentially-weighted moving average


Recommended Posts

Currently the Cabin Fever affliction is applied based on a simple moving average of time spent outdoors over the last 6 days. This creates frustrating situations where you spend the whole day outside and your Cabin Fever Risk increases (because exactly 6 days ago, you spend not only the day outside but the night as well). Whereas at other times you can spend just a couple of hours outdoors and see the risk decrease (because exactly 6 days ago, you were sheltering inside from a blizzard all day). Unless the player is tracking precisely their time spent outdoors each day, this tends to appear arbitrary.

An exponentially-weighted moving average is pretty much the same as a moving average, but it doesn't have the annoying tendencies described above. Risk today depends only on risk yesterday and time spent outdoors today. Moreover the implementation is trivial (even easier than a simple moving average).

  • Upvote 1
Link to post
Share on other sites

I don't know how the risk of cabin fever is calculated, and maybe it's bugged, but I don't think it's a simple moving average. I have had instances where I slept indoors and my risk was lower when I woke up in the morning than it was when I went to sleep. OTOH, I don't think I've ever seen my risk increase from spending time outdoors.

 

Link to post
Share on other sites

I think it's easy enough to just not spend so much time indoors.  Fireboxes (that is to say other than actual campfires) are windproof outside, and campfires in the front end of caves are also effectively windproof (campfires in hollowed out tree trunks fairly well protected as well).  So I think there are plenty of relatively easy ways to avoid being "indoors."

Besides which, we have to equal or exceed more than 50% of our time spent indoors over the last 6 days (including the current day)... that's a lot of time to be spending inside.  This effectively means that given to the total hours in 6 days (144 h) the number of hours we spend inside would have to meet or exceed 72 (the equivalent of 3 days).

:coffee::fire::coffee:
Personally I don't think this mechanic needs to be changed, I like the balance that Hinterland has already achieved.

Edited by ManicManiac
Link to post
Share on other sites

This isn't about balance. Changing to an ewma wouldn't directly make it easier to avoid cabin fever (for example, a simple strategy like "spend every 6th night in a fishing hut" wouldn't work anymore). But it would make the system more intuitive and make the risk increase and decrease more gradually. It is only in this respect that the affliction would be easier to deal with.

Link to post
Share on other sites
1 hour ago, Ragwort said:

The wiki says it's a simple moving average:

https://thelongdark.fandom.com/wiki/Cabin_Fever

The wiki is (a) unofficial and sometimes inaccurate and (b) doesn't say that the risk percentage is based on a simple moving average. What it says is

Quote

 The affliction first appears as "Cabin Fever Risk" if the player has spent more than 12 hours per day (averaged over the last 6 days) indoors. The risk increases by staying indoors until reaching 100%, when it is replaced by the affliction Cabin Fever. 

The mention of averaging is only in the sentence talking about the onset of the risk, and while one interpretation of this is that there is a simple moving average behind the calculation, that's not the only possible interpretation. There's no mention of the details of the calculation behind the risk percentage increasing or decreasing.

I agree that the current behavior is sometimes unintuitive; spending time outdoors should always decrease the risk and spending time (awake??) indoors should increase the risk. But without knowing the details of the implementation, it's impossible to suggest a specific remedy.

Link to post
Share on other sites

Hmm, fair enough - simple moving average was my interpretation of what the wiki said, based on what I've experienced in-game. I've also read other discussion of Cabin Fever which arrived at the same conclusion. In any case, these properties:

4 minutes ago, Dr. S. said:

spending time outdoors should always decrease the risk and spending time (awake??) indoors should increase the risk

would be strongly satisfied by an ewma.

Link to post
Share on other sites
1 hour ago, Ragwort said:

But it would make the system more intuitive

As is... I would say it's already pretty intuitive to not spend so much time inside.  That's why I don't think the mechanic needs to be altered.  Besides just spending 1 night outside every six days doesn't immediately undo the previous 5 days.

I think that by replacing a fairly straightforward and simple metric, with a system incorporating an "exponentially-weighted moving average" would (I think) make things more complicated than they really need to be.

Right now I think it's pretty simple, spend less than half of your time indoors... and you never have to worry about Cabin Fever.
Spend more than half of your time indoors... and you do need to worry about Cabin Fever.  :)


:coffee::fire::coffee:
Personally, I think it's more intuitive to simply spend less time inside than it would be to try and mentally calculate an exponentially-weighted moving average.

I just think that the current system works fine and I don't feel that it needs to be re-worked.
 

Edited by ManicManiac
Link to post
Share on other sites

If you think about how a simple moving average works and how an ewma works, you will see it is the other way around. Using an ewma simplifies, rather than complicates, the mechanic from the player's point of view. There is nothing to calculate - the risk displayed by the game tells you everything.

Link to post
Share on other sites

I don't know.  The game currently has no meter about where a player stands with respect to cabin fever or its risk until it actually says you have the risk.  Ewma would seem as mysterious and indefinite as six-day moving average. 

 

Link to post
Share on other sites

I'd just like to see a line (or two) added to the daily log that shows the percentage of the day spent indoors (and outdoors, if two lines added).  This would make it a lot easier to determine how much time is needed during each upcoming day to spend outdoors in order to lower cabin fever risk.

Link to post
Share on other sites

It might just be just a couple of entries on the physical status page which related what the six-day moving average for outdoor and indoor time was at the time it was viewed.  The game must track that anyway in some fashion so letting the player know might help with working out what to do with less of a mystery about it.  If the idea was to just give qualitative rather than quantitative feedback, then a single meter that has red, yellow, and green indications (red = risk, yellow = getting close to risk, green =  no risk) might be reasonable. 

Link to post
Share on other sites

I think we could just not spend more than half our days indoors. :D  Then we'd never even get the risk of cabin fever at all.  I just don't see the need to have the game tell us things that we can manage ourselves just by playing a little more attention to what we are doing.


:coffee::fire::coffee:

Edited by ManicManiac
Link to post
Share on other sites
41 minutes ago, ManicManiac said:

I think we could just not spend more than half our days indoors. :D  Then we'd never even get the risk of cabin fever at all.  I just don't see the need to have the game tell us things that we can manage ourselves just by playing a little more attention to what we are doing.


:coffee::fire::coffee:

Easy to remember to try... not so easy to accomplish on each and every day.  Easy to remember also perhaps if you're playing on only one file and playing every day... hard to remember if you set the game down for a weak or you're playing multiple different files.

Link to post
Share on other sites
3 hours ago, ManicManiac said:

I think we could just not spend more than half our days indoors. :D  Then we'd never even get the risk of cabin fever at all.  I just don't see the need to have the game tell us things that we can manage ourselves just by playing a little more attention to what we are doing.

Easier said than done sometimes, e.g., when there are blizzards for 3 days straight.

2 hours ago, UpUpAway95 said:

Easy to remember also perhaps if you're playing on only one file and playing every day... hard to remember if you set the game down for a weak or you're playing multiple different files.

Maybe it would help if I describe precisely how an ewma might work in this case? Because it removes the need to remember anything or take notes, unless you want more time to deal with cabin fever than is given by the risk notification.

I'm taking the numbers from this thread: https://www.reddit.com/r/thelongdark/comments/au9vlq/how_cabin_fever_works/ - I don't have in-game experience right now to corroborate the info in that thread but it should serve at least as an illustration. The tl;dr is that cabin fever triggers if you spend more than 125 out of any interval of 150 hours indoors.

To convert this to an ewma you keep a running tally A of the number of hours spent indoors. Let A_t be the value of this tally after t hours. Each hour we update A according to:

A_{t+1} = (149 / 150) A_t + H_{t+1}

where H_t is the proportion of hour t spend inside. (So if you spent 45 minutes inside during hour t then H_t = 0.75 - i.e. three quarters.) You get cabin fever if ever A_t exceeds 125.

In the link it's stated that cabin fever risk is equal to ({#hours indoors} - 110) / 15, and that it's displayed as soon as the {#hours indoors} exceeds 113. Assuming this is correct, we do exactly the same thing when using an ewma - just replace {#hours indoors} with A_t. The big advantage of this is that as soon as the cabin fever risk is displayed, you can know exactly how long you have before cabin fever triggers. I did a quick calculation: with these numbers a cabin fever risk of 20% (the value when it first appears) means you have 59 hours left (indoors, assuming no time spent outdoors), at 50% it means you have 40 hours left, and at 90% you have 15 hours left.

With this system cabin fever risk rises smoothly and predictably when indoors and falls smoothly and predictably when outdoors. You don't get wild swings anymore where the risk appears and rises from 20% to 100% in only 12 hours. Nor does the risk ever stay at 50% for 24 hours straight, despite being indoors the entire time. And when you load up a save file after a month of dormancy, you can just look at your CF risk (if any) and get a rough idea of how soon you need to spend some time outside.

 

Edited by Ragwort
Link to post
Share on other sites
5 minutes ago, Ragwort said:

Easier said than done sometimes, e.g., when there are blizzards for 3 days straight.

...which I would say is part of the challenge of the game.  I still don't think the game needs to hold our hand, and tell us things that I think we ought to be able to manage ourselves.

:coffee::fire::coffee:

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now