Sign in to follow this  
Arium

[FIXED] Login resets current fatigue counter

Recommended Posts

# What happened

Logging into the game will reset the fatigue timer and take on the timestamp of the login/the first player polling.
# What you expected to happen

That the fatigue refresh ticks keep happening every 3 hours after an avatar is created, regardless of wether he is online or offline and an avatar actually regains 8 hours of fatigue a day. This is also the common belief of how it works.
# Steps to reproduce

Login in an avatar, wear down his fatigue, preferably below 9 hours.

Take note the initial timestamp of when the character was logged in as well as successive "You feel rested." messages.

Check the /fatigue time and take note of it too.

Log out the character and log back in roughly 5 hours after the last "You feel rested." message.

Check the /fatigue time and notice that an hour has been added.

Wait for another 3 hours after logging back in and notice that you get another "You feel rested." message whereas it would have been expected to happen about 1 hour after logging back in as you have been offline for 5 hours.

 

Please note that these times are only suggestions but the general steps remain the same wether you choose to wear down fatigue more and stay offline longer or not. As long as you log in with less than 12 hours of fatigue or wear it back down a bit after logging back in you will notice that the time stamps for rested messages will have changed.

 

Additional info:
The current fatigue system calculates the fatigue refreshes for the period the character was offline after the login and adds an hour of fatigue for every three hours spent offline.

However the current system is unable to handle partial fatigue ticks and as such only treats full 3 hour periods. Anything going above those full periods is lost and the time of the login/first player polling after the login will then become the new time for following fatigue refreshes.

If this explanation shouldn't be clear enough please check the spoiler at the bottom of the post.

 

If this bit of code is working the same as in WU the responsible function for this can be found in com.wurmonline.server.players.PlayerInfo.class

(spoiler for WU code, i am certain it works the same as logs and their time stamps support this claim)

Spoiler

final boolean checkFatigue()
  {
    long times = 0L;
    
    times = (System.currentTimeMillis() - this.lastFatigue) / 10800000L;
    if (times > 0L)
    {
      for (int x = 0; x < Math.min(times, 8L); x++) {
        this.fatigueSecsLeft = Math.min(this.fatigueSecsLeft + 3600, 43200);
      }
      this.lastFatigue = System.currentTimeMillis(); this in addition to the initial dividing results in the current phenomenon.
      setFatigueSecs(this.fatigueSecsLeft, this.lastFatigue);
      return true;
    }
    return false;
  }

 

my suggestion would be to change the line i pointed out to

this.lastFatigue += times * 10800000;

this should result in a static fatigue refresh time no longer impacted by relogs.

 

 

 

Spoiler showing my post about this in another topic:

Spoiler

you do regenerate 8 hours of fatigue if you are offline for 24 hours. yes.

 

the problem that i described is that if you log out with 0 minutes of fatigue left and log back in 2 days later, you will still only get 8 hours of fatigue. that is the limit to how much you can regenerate in a single offline session.

 

the other problem i described is that Finnn is wrong in his believes that fatigue is regenerated once every 3 hours regardless of wether you are online or not.

when you go offline your character stops doing everything at all. completely. there is no schedule on how to handle offline players.

the fatigue is only regenerated once you log back in. 1 hour for every FULL 3 hours that you were offline.

so lets imagine you log out right after a fatigue tick (the you feel rested message).

if you were offline for 1 hour you dont get anything. nothing else happens.

if you were offline for 2 hours you dont get anything. nothing else happens.

if you were offline for 3 hours you get 1 hour of fatigue. nothing else happens.

if you were offline for 4 hours you get 1 hour of fatigue. logging in now will result in the timer being reset to 0 and you loosing 1 hour of the timer ticking down since the game does not handle overflow over the last tick. it only reacts to full timers.

if you were offline for 5 hours you get 1 hour of fatigue. the other 2 hours are lost.

if you were offline for 5 hours 45 minutes you get 1 hour of fatigue. the other 2 hours 45 minutes are lost.

 

i hope this explains it a bit better.

 

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this