TerraFirmaCraft

TerraFirmaCraft

2M Downloads

Food expiration needs multiplayer protection of some sort

Gaelmare opened this issue · 9 comments

commented

Unless the server you play is only up when you're on it, food expiration makes multiplayer nutrition maintenance almost impossible. This was a Classic feature: https://1710-wiki.terrafirmacraft.com/Configuration see "decayProtectionDays".

Dries' opinion: https://clips.twitch.tv/SpoopyFitSmoothieDoritosChip

  • TFC Version: build 132
commented

As far as we can tell, there is no solution which is performant, non-exploitable, and multiplayer friendly.

I look forward to seeing your easy solution.

commented
commented

Everything that has been said about this has been said - we aren't changing the fundamental systems here. Playing on servers where people are on at different frequencies will unfortunately have this problem for the foreseeable future, with respect to food decay.

commented

Easy solution, literally just add a config option that protects inventory food when offline and leave it off by default. Pretty lame attitude on this, might just fork this and do it myself for the server I just started. I'll see if I get time for this.

commented

Is this just a vague handwavey statement of "I wish items existed in the world" or do you have an actual suggestion. This has been discussed many times in discord, with no actionable solutions. The fundamental problem is applying single player mechanics (time tracking) to a fundamentally multiplayer game, and unless we want to go in and rework that in it's entirety, we're out of luck.

Edit: Saying "classic did this, so therefor we can" is idiotic as it's missing the fundamental difference between how we handle decay and they did. We don't tick items, we don't try and find every item in the world and check it for decay, so there's nothing that can be done operating under that assumption.

commented

I've noticed that when there isn't any player in a server, TFC automatically turns doDaylightCycle to false, like this:

[18:52:57] [Server thread/INFO] [tfc]: Player Logged Out - Checking for Calendar Updates.
[18:52:57] [Server thread/INFO] [tfc]: Forced doDaylightCycle to false as no players are logged in. Will revert to true as soon as a player logs in.

Does this prevent food from decay?

commented

I suppose one solution is to protect food that is in players' inventory, so that one go offline and back won't see his food go bad with others playing. I have no idea whether it's easy or hard to implement.

commented

Yes, it does. It stops the calendar, and stops decay tracking. This is only a problem when there are multiple people playing on a server, at different frequencies. And given the lack of actual solutions to the problem, the current solution is the best that we can come up with.

commented

What about saving log out time in player's save file and when he come back online add it to creation time of all food in his inventory at least. As an option to expand it futher - save sealer of large vessels, and when unsealed if sealer is not online, add the delta between sealer's log out and unseal time to all food in it.