Content: Slate Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate Marble
Background: Slate Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate Marble
Pattern: Blank Waves Notes Sharp Wood Rockface Leather Honey Vertical Triangles
Welcome to TerraFirmaCraft Forums

Register now to gain access to all of our features. Once registered and logged in, you will be able to contribute to this site by submitting your own content or replying to existing content. You'll be able to customize your profile, receive reputation points as a reward for submitting content, while also communicating with other members via your own private inbox, plus much more! This message will be removed once you have signed in.

  • Announcements

    • Dries007

      ATTENTION Forum Database Breach   03/04/2019

      There has been a breach of our database. Please make sure you change your password (use a password manager, like Lastpass).
      If you used this password anywhere else, change that too! The passwords themselves are stored hashed, but may old accounts still had old, insecure (by today's standards) hashes from back when they where created. This means they can be "cracked" more easily. Other leaked information includes: email, IP, account name.
      I'm trying my best to find out more and keep everyone up to date. Discord (http://invite.gg/TerraFirmaCraft) is the best option for up to date news and questions. I'm sorry for this, but the damage has been done. All I can do is try to make sure it doesn't happen again.
    • Claycorp

      This forum is now READ ONLY!   01/20/2020

      As of this post and forever into the future this forum has been put into READ ONLY MODE. There will be no new posts! A replacement is coming SoonTM . If you wish to stay up-to-date on whats going on or post your content. Please use the Discord or Sub-Reddit until the new forums are running.

      Any questions or comments can be directed to Claycorp on either platform.
noobsrtoast

food preservation

42 posts in this topic

just an idea for a new game mechanic, food goes rotten especially meat we all find that out the hard way when we buy stuff that's on sale at the grocery store. I figure bioxx and his team of modders could find a way to make that a game mechanic considering their brilliance and knowhow, heres my idea on what that might look like:

 

how long food lasts: dependent on the type of food you have I figure different types of vegetables/ fruits will spoil faster than others and if you like the idea the life of food is based off of an in game month, many foods will spoil within half a month per se most of the meats, and some foods will last much much longer e.g most of the veggies will last well into the month, many foods can be eaten after they go rotten/stale like grains last a really long time and can be eaten after the expiry date, this would also help to balance grains because they restore so little hunger. with all of this though come preservation methods heres some ideas on that:

 

 

dehydration: this will make the food capable of lasting well over a year as removing the water from the food causes bacteria to die (water= life) my Idea is 2 methods would exist: method 1: dryer (no not the one that finishes your laundry), made by placing a 3x3 pattern of glass at least 1 block above any other block type so long as its not dirt and something to support the glass rewards you with a food dryer which you can then place food items into wait about 4 in game hours and then your food will come out dehydrated pros: lasts longer cons: restores a little less hunger (beef jerky availability over 9000) . method 2: smoking: smoking would do the same thing as drying but it would restore the same hunger and make it last twice as long as just drying made by placing a fire pit with a bellows and a closed 3x3 hut around the 2 utilities add items you need to smoke to it seal it off with the last stone and wait 4 hours, most of these methods would be used for meat.

 

root cellar: used to store vegetables underground prevents spoiling for up to 2 in game years, made by digging a 4x4x4 cave in the dirt and sealing off with any block not affected by gravity and 2 trap doors at least (for access) this will make a root cellar where you can simply place vegetables on the ground similar to with clay and ceramic items  or store them in chests either way they will last for about 2 years

 

cold underground storage (winter only): akin to a fridge sort of, can store meat and veggies for the duration of winter underground to prevent spoiling, to make find an area with snow dig 2 make a 1x2x2 hole in the dirt under the snow seal off with trap doors then you can use it to store meat , veggies so they don't spoil works only during winter

 

canning/ jarring: cans made from tin sheets worked in an anvil can be used to store veggies meat add a bit of alcohol to the jar and they last even longer, jars made by working high temperature glass in an anvil used to store fruit preserves which can last well over 5 years to make fruit preserves simply combine any type of fruit and a jar in the crafting menu. canned foods last 3 years with no alcohol added adding alcohol too the can will make the food last forever. canning follows the same process as jarring combine any food plus any alcohol you want in it with a tin can and boom you have canned food.

 

sorry for the long post I hope it at least all comes in handy to one of you :D

0

Share this post


Link to post
Share on other sites

The problem with food spoilage is not that its impossible to code, its that every instance of food would have to tick and update, causing tons of lag eating memory like its no tomorrow.

1

Share this post


Link to post
Share on other sites

The problem with food spoilage is not that its impossible to code, its that every instance of food would have to tick and update, causing tons of lag eating memory like its no tomorrow.

 

On top of that, with the current way that item stacking and inventory is handled, food items wouldn't be able to stack. In the same way that you can't stack two ingots of different temperatures, you wouldn't be able to stack two foods of different spoilage.

0

Share this post


Link to post
Share on other sites

The problem with food spoilage is not that its impossible to code, its that every instance of food would have to tick and update, causing tons of lag eating memory like its no tomorrow.

 

On top of that, with the current way that item stacking and inventory is handled, food items wouldn't be able to stack. In the same way that you can't stack two ingots of different temperatures, you wouldn't be able to stack two foods of different spoilage.

 

So, unless the food was made at the same time, it won't stack, and it'll lag like we have a army of chickens on the loose.

 

Say, what if at the end of every month or something, the system does a check for food, and depending on the temperature and the type of food, it gives it a chance to rot.

On second thought, that'd make huge lag spikes on the end of every month or something...

 

The idea is great, but the mechanics and technical stuff kinda ruins it... pity

0

Share this post


Link to post
Share on other sites

On top of that, with the current way that item stacking and inventory is handled, food items wouldn't be able to stack. In the same way that you can't stack two ingots of different temperatures, you wouldn't be able to stack two foods of different spoilage.

 

I will again do what I did in topics like this on several occasions - relate to Don't Starve game.

It has rotting food that stacks. The way they did it was as follows:

1. When we stacking two items that both have 100 "max freshness points", but one of them  has 25 freshness points, and another has 75 points, the result would be the stack of two items that has 100 max freshness points and 50 actual points.

2. When we add to aforementioned stack another item that has 100 actual points, the result would be a stack of three item that have (50+50+100)/3 = 66 points (rounded down).

3. When we merge two stack of two items each, one of which has 25 points and another 75, the result is (25 + 25 + 75 + 75) / 4 = 50

 

So, we have a pretty simple formula for resulting stack's freshness, which is

(StackOneFreshness * StackOneSize + StackTwoFreshness * CurrentStackTwoSize) / (StackOneSize + StackTwoSize)

To allow a merge of this kind to happen code-wise, we also need to take corresponding part of metadata out of equals() method for food items.

1

Share this post


Link to post
Share on other sites

So, unless the food was made at the same time, it won't stack, and it'll lag like we have a army of chickens on the loose.

 

Say, what if at the end of every month or something, the system does a check for food, and depending on the temperature and the type of food, it gives it a chance to rot.

On second thought, that'd make huge lag spikes on the end of every month or something...

 

The idea is great, but the mechanics and technical stuff kinda ruins it... pity

damn the challenge of making food last would have been awesome

0

Share this post


Link to post
Share on other sites

On top of that, with the current way that item stacking and inventory is handled, food items wouldn't be able to stack. In the same way that you can't stack two ingots of different temperatures, you wouldn't be able to stack two foods of different spoilage.

 

damn would have been an awesome challenge

0

Share this post


Link to post
Share on other sites

damn would have been an awesome challenge

 

There's "challenge" and "making life even harder and less appealing as a game". Right now TFC has a lot of things in it which exist primarily because it still has to be a game instead of a simulation of reality. Trees still grow faster than they do in reality, as do crops. Injuries are still nonspecific "health" as opposed to "broken ankle". Sepsis isn't an issue, let alone pneumonia or heatstroke. You can drink seawater. Ask yourself the question on whether the appeal of challenge is enough to start adding limitations, especially since getting past the Stone Age is plenty hard.

 

(Try doing a Hardcore game. I'm not going to, as I died roughly 10 times just from starvation before I could get some sort of food source in progress. Not counting the first week of nights where I couldn't quite get myself safe from monsters all the time while foraging . . .)

 

On top of that is the aforementioned "memory issue" of tracking individual food items . . . some of which probably aren't even on the player . . . to submit to timing ticks. There's already an incredible amount of memory I watch disappear when I'm just standing in my farm area. And when zombie hordes catch on fire in the morning (I'm really contemplating moving to Peaceful so I don't have to restart after a particularly busy night). I'm fairly certain this would cause TFC to crash from "Out of Memory" rather quickly.

 

. . . not sure if I want the challenge of "can I beat the chance of the game crashing" added to my experience.

0

Share this post


Link to post
Share on other sites

I will again do what I did in topics like this on several occasions - relate to Don't Starve game.

It has rotting food that stacks. The way they did it was as follows:

1. When we stacking two items that both have 100 "max freshness points", but one of them  has 25 freshness points, and another has 75 points, the result would be the stack of two items that has 100 max freshness points and 50 actual points.

2. When we add to aforementioned stack another item that has 100 actual points, the result would be a stack of three item that have (50+50+100)/3 = 66 points (rounded down).

3. When we merge two stack of two items each, one of which has 25 points and another 75, the result is (25 + 25 + 75 + 75) / 4 = 50

 

So, we have a pretty simple formula for resulting stack's freshness, which is

(StackOneFreshness * StackOneSize + StackTwoFreshness * CurrentStackTwoSize) / (StackOneSize + StackTwoSize)

To allow a merge of this kind to happen code-wise, we also need to take corresponding part of metadata out of equals() method for food items.

 

But that means if I accidentally shift-click my fresh meat into a chest with near-rotten meat, I'll end up spoiling my food..

which, in hindsight, actually makes some sense,(no food comes away clean from contact with bad food) but I'd hate to be getting some fresh meat to sell/give/take long distances, and accidental end up making it bad

0

Share this post


Link to post
Share on other sites

Need to come up with a way to make it not lag though. That is the real nail in the coffin, heck a few people on my server with lower end computers complain when enter my shop since i have over a dozen blast furnaces running at any given time with dozens of ingots cooling. Them blast furnaces are not gentle on ticks

0

Share this post


Link to post
Share on other sites

There's "challenge" and "making life even harder and less appealing as a game". Right now TFC has a lot of things in it which exist primarily because it still has to be a game instead of a simulation of reality. Trees still grow faster than they do in reality, as do crops. Injuries are still nonspecific "health" as opposed to "broken ankle". Sepsis isn't an issue, let alone pneumonia or heatstroke. You can drink seawater. Ask yourself the question on whether the appeal of challenge is enough to start adding limitations, especially since getting past the Stone Age is plenty hard.

 

(Try doing a Hardcore game. I'm not going to, as I died roughly 10 times just from starvation before I could get some sort of food source in progress. Not counting the first week of nights where I couldn't quite get myself safe from monsters all the time while foraging . . .)

 

On top of that is the aforementioned "memory issue" of tracking individual food items . . . some of which probably aren't even on the player . . . to submit to timing ticks. There's already an incredible amount of memory I watch disappear when I'm just standing in my farm area. And when zombie hordes catch on fire in the morning (I'm really contemplating moving to Peaceful so I don't have to restart after a particularly busy night). I'm fairly certain this would cause TFC to crash from "Out of Memory" rather quickly.

 

. . . not sure if I want the challenge of "can I beat the chance of the game crashing" added to my experience.

 

i get it jesus, i understand whats going thats why i said "ok damn would have been a cool challenge" by that i mean "i understand why you cant thats too bad" and it my idea about food preservation only skims the surface of what is required to actually preserve foods, first of all meat does not last a month,neither do veggies. second of all you build areas for you to store items you cant hold anyway how hard is it to dig a small hole in the ground or place a few pieces of cobblestone and glass to make a dryer compared to other items in the game those items are relatively easy to obtain especially since charcoal only requires 27 stacks of wood which with some time and a bunch of stone axes can be easy to get, charcoal is made in 18 hours ingame foods initially last a month, all this would merely add to "beleivability" not "realism", but as they said impossible to code in the first place so whatevs

0

Share this post


Link to post
Share on other sites

But that means if I accidentally shift-click my fresh meat into a chest with near-rotten meat, I'll end up spoiling my food..

which, in hindsight, actually makes some sense,(no food comes away clean from contact with bad food) but I'd hate to be getting some fresh meat to sell/give/take long distances, and accidental end up making it bad

 

That will be seen as a "challenge" by someone no doubt. And better that than completely unstackable items. In heinsight, we can also make it to check for freshness differences and not allowing it to stack if difference is out of the tolerance value (say, about 16% of maximum freshness for food) — that will also invalidate possible exploit where you can preserve some foods by simply stacking them in the right order. The exact tolerance value is a balancing deal and should (and will) be left for devs to deicde, should they choose to go this route, obvoiusly.

0

Share this post


Link to post
Share on other sites

The problem with food spoilage is not that its impossible to code, its that every instance of food would have to tick and update, causing tons of lag eating memory like its no tomorrow.

 

So, this is assuming that we're implementing this via a naive approach.

 

Need to come up with a way to make it not lag though. That is the real nail in the coffin, heck a few people on my server with lower end computers complain when enter my shop since i have over a dozen blast furnaces running at any given time with dozens of ingots cooling. Them blast furnaces are not gentle on ticks

 

If you're taking every piece of food in nested for loops and applying conditional if statements like there's no tomorrow in order to individually calculate spoilage, then yes I'd imagine you'd have a lot of lag. But that's the naive approach, in reality we have queues, linked lists, skip lists, lazy evaluation, etc. Do we really need to know what the exact level of spoilage is on all food in the game from the moment its harvested to the moment it spoils or is eaten/destroyed? I would imagine not. We're not simulating 10,000 individual samples of fruit gradually decomposing in jars on the window of the science classroom. We don't care, I imagine, about those details. All we care about is "Can I eat this right now and if so, how long will I still be able to eat it provided I store it using method X for time t?" We only need to make updates when it actually matters to gameplay.

Provided there's a system of food preservation like spring houses or smoke houses implemented, then you could potentially make a safe assumption that the rate of decay is deterministic and controlled for that which is stored in these preserving environments - they can isolate stored food from the unpredictable side-effects of the environment. If you can make that assumption, there is a lot of freedom and opportunity for optimization you can then make about all the food stored in this manner because its decay is purely functional and you don't need to constantly keep track of it. I'd imagine you could schedule a food item's transition from "fresh" to "stale" to "rotten" via a sorted queue such as a skip list of pointers to the food items themselves (Java doesn't have pointers, but objects should suffice). In order to update the state of the food, you'd only have to check the end of this queue aka the food that's about to switch states. And if memory is the issue, we can initially allocate a reasonable amount of memory via some heuristic (chucks currently loaded, players currently logged on, etc) and extend the queue only when its necessary. It's really just a scheduling problem with some issues of priority and random events. Not all updates are created equal and we can choose to lazily evaluate some of them based on whether they are actually "needed" by a client. We could gracefully choose to "lag" in places where the player won't notice or even care. It's just like being lazy in real life - no one cares what you spend your time doing and when or in what order you do it, just as long as you have it done in time for the deadline that's expected of you. In our case, this deadline would be when the player is about to check the inventory that the food in question is currently stored.The main issue I see is the stacking problem.

0

Share this post


Link to post
Share on other sites

Java doesn't have pointers, but objects should suffice

The hell do you mean Java has no pointers, dood? Java is all pointers, all day every day. You'd have to code in distinct patterns to pass by value in Java.

0

Share this post


Link to post
Share on other sites

The problem with "We don't care about exact freshness" is that java cares, unless you want it to randomly decide all food is bad it needs counters on every single item or stack of items. Anything in minecraft that requires constant updates will cause lag. Many of the mods like rail craft and build craft that add machines that update constantly limit this by how many can be in a given place at a given time. With food, an item that takes up no physical space, you could have over a hundred thousand instances in a single chuck, all of which would need to be updated. Even if scheduled all you would be doing in this case is making a timed lag spike.

 

 

 

-end rant-

 

The main point-- Java needs to track exact numbers to function correctly you can't short cut it by being lazy

0

Share this post


Link to post
Share on other sites

The hell do you mean Java has no pointers, dood? Java is all pointers, all day every day. You'd have to code in distinct patterns to pass by value in Java.

 

*facepalm*, yeah you're right. I still like my C pointers, though. :P

 

 

The problem with "We don't care about exact freshness" is that java cares, unless you want it to randomly decide all food is bad it needs counters on every single item or stack of items. Anything in minecraft that requires constant updates will cause lag. Many of the mods like rail craft and build craft that add machines that update constantly limit this by how many can be in a given place at a given time. With food, an item that takes up no physical space, you could have over a hundred thousand instances in a single chuck, all of which would need to be updated. Even if scheduled all you would be doing in this case is making a timed lag spike.

 

 

 

-end rant-

 

The main point-- Java needs to track exact numbers to function correctly you can't short cut it by being lazy

 

:/ You're right that lazy evaluation, if done improperly, can damage load balance, but my original point is that keeping track of freshness via a ton of counters isn't necessary - that's what data structure locality is for. If I create a list of all the food in my kitchen, ordered with the nearest expiration dates at the top, why would I need to keep track of how many hours have passed since I bought each individual item when all I need to do is observe the current date and start tossing out the top item on my list until I encounter one that still has some time on it? Assuming the list is sorted, the rest of my items should still be fine. What useful information would I gain by doing the math. Sure the freshness of the remaining items has theoretically changed, their time til expiration has definitely decreased and we could keep track of exact numbers and cause a ton of lag. But once again, why do the math for all the rest of the items when I know the list is sorted and that the item I'm currently checking happens to be the closest to going bad. I would rather check a couple of relevant consts to TFC's updating calender using a FIFO data structure rather than waste a ton of time performing computations that isn't providing Java or the player with any useful information.

0

Share this post


Link to post
Share on other sites

Updating the whole inventory of item stacks is not that heavy on performance. For everything else there are timestamps.

0

Share this post


Link to post
Share on other sites

I am not as worryed about Food freshness as I am of the Agricultural hazards/process in the game. With the annoucement of fertilizer, it should improve a bit, however, there is a lack of other challenges like Disease, Pests (animals eating crops), and weather damage (Wind damage, flooding, lightning, etc...).

0

Share this post


Link to post
Share on other sites

Oh god, I wish there were more random events like that. It seems survival games in general have them to keep the game challenging into the late game. I know a friend of mine found the random hound attacks in Don't Starve to be a pretty important feature that added a lot to the game.My main desire for food freshness/spoilage is that its currently too easy to obtain a surplus of food on SMP by logging out while your crops grow.

0

Share this post


Link to post
Share on other sites

just wanted to say thanks for the support/ intelligent discussion on here its nice to know a lot of you support the idea of this being a new game mechanic

0

Share this post


Link to post
Share on other sites

I am not as worryed about Food freshness as I am of the Agricultural hazards/process in the game. With the annoucement of fertilizer, it should improve a bit, however, there is a lack of other challenges like Disease, Pests (animals eating crops), and weather damage (Wind damage, flooding, lightning, etc...).

 

me too but I only want a light touch to the agricultural system cause it would seriously piss me off if my crops got eaten or destroyed by natural disaster just a light touch of realism not a heavy touch like veggies are more filling depending on how long you wait for them to ripen or the need to water crops regularly or during seasons other than winter crops can die if not provided with sufficient nutrients light touches like that otherwise growing crops would become as hard as finding magnetite

0

Share this post


Link to post
Share on other sites

Things like natural disasters could follow a semi scheduled path, like rain storms "destructive ones" would be more common in spring, blizzards in winter and so on. This would require an overhaul of the weather system but natural disasters could cause even more violent temperature swings.

 

A heat wave would threaten water reliant crops like rice, and raise temperatures drastically above normal for that chunk.

 

Blizzard would be several days of snow and lower temperatures

 

An arctic vortex would be dry but super cold

 

Monsoons would coincide in parts of the world that blizzards are prevented due to temperature- these could drown plants that are more arid in nature

0

Share this post


Link to post
Share on other sites

There is also the possibility of salting, pickling, and smoking food as means of preservation. A stack of fish goes into a barrel of salt and comes out preserved, cabbage goes into a barrel of vinegar and comes out sauerkraut. Maybe some animals could drop innards that would allow for the creation of sausages or haggis! Spices perhaps that mask the effects of (slightly) spoiled food. It would also make sense for foods to assume the highest level of spoilage that exists in a container. Thus discouraging people from storing all of their food in one chest. Which makes sense, I mean, putting all of your food in one chest is like storing a pile of assorted fruits, vegetables, and meats in a cabinet! after about a week you would have a mound of compost rather than food.

 

Of course it would only be fair the give an early game means of preserving food. Such as, a drying rack made of sticks that can be placed over a fire-pit to make various dried meats (that would count against your hydration but would stop your food from rotting in a way that would stop you from eating it!) Maybe paper wrappings that would allow you to separate foods so they would not contaminate one another.

0

Share this post


Link to post
Share on other sites

But I don't think I'd wan't 10~20 chests just to keep my food fresh...

 

And keeping a bunch of different food in one place is fine, as long as nothing is rotten(fungus and bacteria spreads, and rots)

And as long as you don't mash them all up into mush

0

Share this post


Link to post
Share on other sites

me too but I only want a light touch to the agricultural system cause it would seriously piss me off if my crops got eaten or destroyed by natural disaster just a light touch of realism not a heavy touch like veggies are more filling depending on how long you wait for them to ripen or the need to water crops regularly or during seasons other than winter crops can die if not provided with sufficient nutrients light touches like that otherwise growing crops would become as hard as finding magnetite

 

Hard as finding magnetite? Dig a deep shaft with some ladders and torches in inventory, with a prospector's pick. It's not HARD just time consuming, like much else in TFC. The challenge is in time management - you won't ever make progress if you don't have a plan. Now. Again weighing in here with opinions. 

 

- We probably don't need random disasters to destroy crops or stockpiles. Random chance can destroy planning and generally turns the game into trying to avoid chance screwing you over before you can diversify enough not to get hammered hard. 

 

- Veggies already "ripen" as they grow and are harvested. Most produce we buy at markets today are harvested before peak ripeness (especially true for tomatoes and bananas) so they can sit for a while before being sold. That's why things get kind of skewed about how people view "ripe". Grow your own veggies sometime, and you can tell the difference between a real ripe tomato and the stuff we're used to having. (Also on the topic of tomatoes and other veggies in general - it's really not a good idea to eat them before they're ripe.) 

 

- The need to water crops is sort of handled by irrigation right now, which also ties down any substantial farm plots to water and a means of getting it where you need it. This is already limiting since you can't move water as easily (well source blocks) as you can in Vanilla. If you require regular watering of crops, then there is a high chance it will require someone to stay there and monitor them and not go mining for metals. (Effectively making single players farm a huge stockpile anyway so they can burn through it as they mine for metals.) 

 

- The idea of crops simply dying out when there's insufficient nutrients? I can get behind. It punishes players who just stick with a stone hoe (*raises hand*) and don't monitor the nutrients in the soil closely. It requires them to plan ahead before starting a farm, as new plots start with minimal nutrient levels, so they need to keep the fields fallow until they're ready. I'd suggest the plants dying out would actually replenish the other nutrients in the soil, so it could be advantageous to let some crops "rot" so you can kickstart fields for another crop.

 

I can see where it'd be believable, and tending the crops is something which needs to be done . . . but it could turn the game into an exceedingly dull experience of "must tend crops or starve" and making it harder to get set up to do mining. And if we add spoilage (somehow) then there's almost no chance for single players to work with the mod and it will always require someone on a multiplayer server to be around to tend the crops and check for rotten food. There's not much fun in forcing players into menial tasks like that. 

0

Share this post


Link to post
Share on other sites